store

package
v0.0.0-...-c247619 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 10, 2022 License: Apache-2.0 Imports: 8 Imported by: 8

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNoAuthenticationData = errors.New("authentication data is not available")

ErrNoAuthenticationData indicates that stored authentication data is not available

View Source
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
}

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) (*oauth2.AuthorizationGrant, error)

func (*KeyringStore) Logout

func (f *KeyringStore) Logout() error

func (*KeyringStore) SaveGrant

func (f *KeyringStore) SaveGrant(audience string, grant oauth2.AuthorizationGrant) error

func (*KeyringStore) WhoAmI

func (f *KeyringStore) WhoAmI(audience string) (string, error)

type MemoryStore

type MemoryStore struct {
	// contains filtered or unexported fields
}

func (*MemoryStore) LoadGrant

func (f *MemoryStore) LoadGrant(audience string) (*oauth2.AuthorizationGrant, error)

func (*MemoryStore) Logout

func (f *MemoryStore) Logout() error

func (*MemoryStore) SaveGrant

func (f *MemoryStore) SaveGrant(audience string, grant oauth2.AuthorizationGrant) error

func (*MemoryStore) WhoAmI

func (f *MemoryStore) WhoAmI(audience string) (string, error)

type Store

type Store interface {
	// SaveGrant stores an authorization grant for a given audience
	SaveGrant(audience string, grant oauth2.AuthorizationGrant) error

	// LoadGrant loads an authorization grant for a given audience
	LoadGrant(audience string) (*oauth2.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

func NewMemoryStore

func NewMemoryStore() Store

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL