Documentation
¶
Index ¶
Constants ¶
const ServiceName = "zoh"
ServiceName is the service identifier for keyring storage
Variables ¶
var ErrNotFound = errors.New("key not found")
ErrNotFound is returned when a key is not found in the store
Functions ¶
func IsHeadless ¶
func IsHeadless() bool
IsHeadless returns true if running in a headless environment (no display server). Only applicable on Linux; macOS and Windows are assumed to have GUI.
Types ¶
type FileStore ¶
type FileStore struct {
// contains filtered or unexported fields
}
FileStore implements the Store interface using an AES-256-GCM encrypted file. This is a fallback for environments where OS keyring is unavailable (WSL, headless, Docker).
func NewFileStore ¶
NewFileStore creates a new file-backed credential store. If password is empty, uses a machine-specific default (less secure, prints warning). Future improvement: use scrypt or argon2 for key derivation instead of sha256.
type KeyringStore ¶
type KeyringStore struct {
// contains filtered or unexported fields
}
KeyringStore implements the Store interface using the OS keyring.
func NewKeyringStore ¶
func NewKeyringStore() (*KeyringStore, error)
NewKeyringStore creates a new keyring-backed credential store. Returns an error if the keyring is unavailable on this platform.
func (*KeyringStore) Delete ¶
func (s *KeyringStore) Delete(key string) error
Delete removes a credential from the keyring.
func (*KeyringStore) Get ¶
func (s *KeyringStore) Get(key string) (string, error)
Get retrieves a credential by key from the keyring.
func (*KeyringStore) List ¶
func (s *KeyringStore) List() ([]string, error)
List returns all credential keys stored in the keyring.
func (*KeyringStore) Set ¶
func (s *KeyringStore) Set(key, value string) error
Set stores a credential in the keyring.