Documentation
¶
Overview ¶
Package store provides token storage implementations for authentication credentials. It includes a KeyringStore implementation that uses the system keyring for secure storage.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrNoAuthenticationData = errors.New("authentication data is not available")
ErrNoAuthenticationData indicates that stored authentication data is not available
var ErrUnsupportedAuthData = errors.New("authentication data is not usable")
ErrUnsupportedAuthData ndicates that stored authentication data is unusable
Functions ¶
This section is empty.
Types ¶
type KeyringStore ¶
type KeyringStore struct {
// contains filtered or unexported fields
}
KeyringStore provides secure token storage using the system keyring.
func NewKeyringStore ¶
func NewKeyringStore(kr keyring.Keyring) (*KeyringStore, error)
NewKeyringStore creates a store based on a keyring.
func (*KeyringStore) LoadGrant ¶
func (f *KeyringStore) LoadGrant(audience string) (*auth.AuthorizationGrant, error)
LoadGrant loads an authorization grant from the keyring.
func (*KeyringStore) Logout ¶
func (f *KeyringStore) Logout() error
Logout removes all stored grants from the keyring.
func (*KeyringStore) SaveGrant ¶
func (f *KeyringStore) SaveGrant(audience string, grant auth.AuthorizationGrant) error
SaveGrant saves an authorization grant to the keyring.
type Store ¶
type Store interface {
// SaveGrant stores an authorization grant for a given audience
SaveGrant(audience string, grant auth.AuthorizationGrant) error
// LoadGrant loads an authorization grant for a given audience
LoadGrant(audience string) (*auth.AuthorizationGrant, error)
// WhoAmI returns the current user name (or an error if nobody is logged in)
WhoAmI(audience string) (string, error)
// Logout deletes all stored credentials
Logout() error
}
Store is responsible for persisting authorization grants