Documentation
¶
Index ¶
- func DefaultStorePath() string
- type EncryptedFileStore
- func (s *EncryptedFileStore) DeleteCredentials(ctx context.Context, provider string) error
- func (s *EncryptedFileStore) ListProviders(ctx context.Context) ([]string, error)
- func (s *EncryptedFileStore) LoadCredentials(ctx context.Context, provider string) (*types.Credentials, error)
- func (s *EncryptedFileStore) SaveCredentials(ctx context.Context, creds *types.Credentials) error
- type FileStore
- func (s *FileStore) DeleteCredentials(ctx context.Context, provider string) error
- func (s *FileStore) ListProviders(ctx context.Context) ([]string, error)
- func (s *FileStore) LoadCredentials(ctx context.Context, provider string) (*types.Credentials, error)
- func (s *FileStore) SaveCredentials(ctx context.Context, creds *types.Credentials) error
- type MemoryStore
- func (s *MemoryStore) DeleteCredentials(ctx context.Context, provider string) error
- func (s *MemoryStore) ListProviders(ctx context.Context) ([]string, error)
- func (s *MemoryStore) LoadCredentials(ctx context.Context, provider string) (*types.Credentials, error)
- func (s *MemoryStore) SaveCredentials(ctx context.Context, creds *types.Credentials) error
- type Store
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultStorePath ¶
func DefaultStorePath() string
DefaultStorePath returns the default store path
Types ¶
type EncryptedFileStore ¶
type EncryptedFileStore struct {
// contains filtered or unexported fields
}
EncryptedFileStore stores credentials encrypted with AES-256-GCM.
Key precedence:
- SESHAT_MASTER_KEY env var (64 hex chars = 32 bytes)
- Machine-derived key (SHA-256 of machine ID + constant)
Existing plaintext files are read transparently and re-encrypted on the next write, providing a seamless migration path.
func NewEncryptedFileStore ¶
func NewEncryptedFileStore(path string) (*EncryptedFileStore, error)
NewEncryptedFileStore creates a new encrypted file-based auth store. Returns an error only if key derivation fails; a missing file is not an error.
func (*EncryptedFileStore) DeleteCredentials ¶
func (s *EncryptedFileStore) DeleteCredentials(ctx context.Context, provider string) error
DeleteCredentials implements Store.
func (*EncryptedFileStore) ListProviders ¶
func (s *EncryptedFileStore) ListProviders(ctx context.Context) ([]string, error)
ListProviders implements Store.
func (*EncryptedFileStore) LoadCredentials ¶
func (s *EncryptedFileStore) LoadCredentials(ctx context.Context, provider string) (*types.Credentials, error)
LoadCredentials implements Store.
func (*EncryptedFileStore) SaveCredentials ¶
func (s *EncryptedFileStore) SaveCredentials(ctx context.Context, creds *types.Credentials) error
SaveCredentials implements Store.
type FileStore ¶
type FileStore struct {
// contains filtered or unexported fields
}
FileStore stores credentials in a JSON file
func NewFileStore ¶
NewFileStore creates a new file-based auth store
func (*FileStore) DeleteCredentials ¶
DeleteCredentials implements Store
func (*FileStore) ListProviders ¶
ListProviders implements Store
func (*FileStore) LoadCredentials ¶
func (s *FileStore) LoadCredentials(ctx context.Context, provider string) (*types.Credentials, error)
LoadCredentials implements Store
func (*FileStore) SaveCredentials ¶
SaveCredentials implements Store
type MemoryStore ¶
type MemoryStore struct {
// contains filtered or unexported fields
}
MemoryStore is an in-memory store for testing
func NewMemoryStore ¶
func NewMemoryStore() *MemoryStore
NewMemoryStore creates a new in-memory store
func (*MemoryStore) DeleteCredentials ¶
func (s *MemoryStore) DeleteCredentials(ctx context.Context, provider string) error
DeleteCredentials implements Store
func (*MemoryStore) ListProviders ¶
func (s *MemoryStore) ListProviders(ctx context.Context) ([]string, error)
ListProviders implements Store
func (*MemoryStore) LoadCredentials ¶
func (s *MemoryStore) LoadCredentials(ctx context.Context, provider string) (*types.Credentials, error)
LoadCredentials implements Store
func (*MemoryStore) SaveCredentials ¶
func (s *MemoryStore) SaveCredentials(ctx context.Context, creds *types.Credentials) error
SaveCredentials implements Store
type Store ¶
type Store interface {
// Save credentials for a provider
SaveCredentials(ctx context.Context, creds *types.Credentials) error
// Load credentials for a provider
LoadCredentials(ctx context.Context, provider string) (*types.Credentials, error)
// Delete credentials for a provider
DeleteCredentials(ctx context.Context, provider string) error
// List all providers with stored credentials
ListProviders(ctx context.Context) ([]string, error)
}
Store persists authentication credentials