store

package
v0.1.16-rc.1 Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

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

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
}

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.

func (*KeyringStore) WhoAmI

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

WhoAmI returns the username associated with the grant for the given audience.

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

Jump to

Keyboard shortcuts

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