Documentation
¶
Overview ¶
Package store defines simple token and client-configuration stores used by the authorization helpers in the parent `auth` package.
It currently ships with an in-memory implementation that is sufficient for most CLI or unit-test scenarios but can be swapped for a persistent backend if required.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MemoryStoreOption ¶
type MemoryStoreOption func(*memoryStore)
func WithClientConfig ¶
func WithClientConfig(client *oauth2.Config) MemoryStoreOption
type Store ¶
type Store interface {
LookupClientConfig(issuer string) (*oauth2.Config, bool)
AddClientConfig(issuer string, client *oauth2.Config) error
AddAuthorizationServerMetadata(metadata *meta.AuthorizationServerMetadata) error
LookupAuthorizationServerMetadata(issuer string) (*meta.AuthorizationServerMetadata, bool)
AddIssuerPublicKeys(issuer string, keys map[string]crypto.PublicKey) error
LookupIssuerPublicKeys(issuer string) (map[string]crypto.PublicKey, bool)
AddToken(key TokenKey, token *oauth2.Token) error
LookupToken(key TokenKey) (*oauth2.Token, bool)
}
Store is a pluggable persistence layer for tokens & client IDs. The in‑memory default is fine for CLI tools; swap with Redis/SQL for fleets.
func NewMemoryStore ¶
func NewMemoryStore(options ...MemoryStoreOption) Store
Click to show internal directories.
Click to hide internal directories.