Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Token ¶
type Token struct {
ID string `json:"id"`
Name string `json:"name"`
ExpiresAt *time.Time `json:"expiresAt,omitempty"`
CreatedAt *time.Time `json:"createdAt,omitempty"`
Value string `json:"value,omitempty"`
}
Token represents an access token
type TokenStore ¶
type TokenStore interface {
Store(userID string, token *Token) error
Lookup(userID string, tokenID string) (*Token, error)
Exists(userID string, tokenID string) (bool, error)
Revoke(userID string, tokenID string) error
List(userID string) ([]*Token, error)
GC() error
}
TokenStore is general interface for storing access tokens
func NewInMemoryTokenStore ¶
func NewInMemoryTokenStore() TokenStore
NewInMemoryTokenStore is a basic in-memory TokenStore implementation (thread-safe)
func NewVaultTokenStore ¶
func NewVaultTokenStore(role string) TokenStore
NewVaultTokenStore creates a new Vault backed token store
func NewVaultTokenStoreFromClient ¶
func NewVaultTokenStoreFromClient(client *vault.Client) TokenStore
Click to show internal directories.
Click to hide internal directories.