authstore

package
v0.15.3 Latest Latest
Warning

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

Go to latest
Published: May 2, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CacheDir

func CacheDir() (string, error)

func ClearAll

func ClearAll() error

func ClearRefreshToken

func ClearRefreshToken() error

func ClearRefreshTokenFile

func ClearRefreshTokenFile() error

func ClearRefreshTokenKeyring

func ClearRefreshTokenKeyring() error

func ClearSession

func ClearSession() error

func ConfigDir

func ConfigDir() (string, error)

func ConfigFilePath

func ConfigFilePath() (string, error)

func CredentialsFilePath

func CredentialsFilePath() (string, error)

func KeyringAvailable

func KeyringAvailable() bool

func LoadRefreshToken

func LoadRefreshToken() (string, string, error)

func LoadRefreshTokenWithPreferredBackend

func LoadRefreshTokenWithPreferredBackend(preferred string) (string, string, error)

func LockFilePath

func LockFilePath() (string, error)

func ResetKeyring

func ResetKeyring()

func ResetKeyringAvailability

func ResetKeyringAvailability()

func SaveRefreshToken

func SaveRefreshToken(token string) (string, error)

func SaveSession

func SaveSession(session Session) error

func SessionFilePath

func SessionFilePath() (string, error)

func SetKeyringBackend

func SetKeyringBackend(backend KeyringBackend)

func WithLock

func WithLock[T any](ctx context.Context, fn func() (T, error)) (T, error)

func WriteFileAtomically

func WriteFileAtomically(path string, data []byte, perm fs.FileMode) error

Types

type Identity

type Identity struct {
	Subject           string         `json:"subject,omitempty"`
	Email             string         `json:"email,omitempty"`
	Name              string         `json:"name,omitempty"`
	PreferredUsername string         `json:"preferred_username,omitempty"`
	Claims            map[string]any `json:"claims,omitempty"`
}

type KeyringBackend

type KeyringBackend interface {
	Get(service, key string) (string, error)
	Set(service, key, value string) error
	Delete(service, key string) error
}

type Session

type Session struct {
	IssuerURL        string    `json:"issuer_url"`
	ClientID         string    `json:"client_id"`
	Audience         string    `json:"audience,omitempty"`
	Scopes           []string  `json:"scopes,omitempty"`
	GrantedScopes    []string  `json:"granted_scopes,omitempty"`
	AccessToken      string    `json:"access_token"`
	TokenType        string    `json:"token_type,omitempty"`
	Expiry           time.Time `json:"expiry,omitempty"`
	IDToken          string    `json:"id_token,omitempty"`
	AuthorizationURL string    `json:"authorization_url,omitempty"`
	TokenURL         string    `json:"token_url,omitempty"`
	UserInfoURL      string    `json:"userinfo_url,omitempty"`
	RevocationURL    string    `json:"revocation_url,omitempty"`
	JWKSURL          string    `json:"jwks_url,omitempty"`
	Algorithms       []string  `json:"algorithms,omitempty"`
	StorageBackend   string    `json:"storage_backend,omitempty"`
	Identity         Identity  `json:"identity,omitempty"`
	CreatedAt        time.Time `json:"created_at,omitempty"`
	UpdatedAt        time.Time `json:"updated_at,omitempty"`
}

func LoadSession

func LoadSession() (*Session, error)

Jump to

Keyboard shortcuts

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