auth

package
v1.9.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultConfigPath

func DefaultConfigPath() string

DefaultConfigPath returns the default config path. It is the same file as everywhere else (store.ResolvePath): SESHAT_AUTH_PATH, or auth.json in the .seshat folder of the user's home.

Types

type Loader

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

Loader loads authentication configuration

func Default

func Default() (*Loader, error)

Default returns the default auth loader backed by an encrypted file store. Set SESHAT_MASTER_KEY (64 hex chars) to control the encryption key explicitly; otherwise a machine-derived key is used automatically.

func NewLoader

func NewLoader(store store.Store) *Loader

NewLoader creates a new auth loader

func (*Loader) GetAPIKey

func (l *Loader) GetAPIKey(ctx context.Context, provider string) (string, error)

GetAPIKey returns the API key for a provider

func (*Loader) GetAuthMethod

func (l *Loader) GetAuthMethod(ctx context.Context, provider string) (types.AuthMethod, error)

GetAuthMethod returns the auth method for a provider

func (*Loader) ListProviders

func (l *Loader) ListProviders(ctx context.Context) ([]string, error)

ListProviders lists all configured providers

func (*Loader) SetAPIKey

func (l *Loader) SetAPIKey(ctx context.Context, provider, key string) error

SetAPIKey sets the API key for a provider

func (*Loader) SetAuthMethod

func (l *Loader) SetAuthMethod(ctx context.Context, provider string, method types.AuthMethod) error

SetAuthMethod sets the auth method for a provider

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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