Documentation
¶
Overview ¶
Package keychain implements a vault.Store backed by the operating system keychain via go-keyring. On macOS this uses Keychain, on Linux the Secret Service API, and on Windows the Credential Manager.
An index entry is maintained alongside stored values so that Store.List works across all platforms. The index is stored under a reserved key within the same keyring service.
Index ¶
- type Option
- type Store
- func (s *Store) Delete(_ context.Context, key string) error
- func (s *Store) Get(_ context.Context, key string) (vault.Entry, error)
- func (s *Store) List(ctx context.Context) ([]vault.Entry, error)
- func (s *Store) Set(_ context.Context, entry vault.Entry) error
- func (s *Store) WithNamespace(ns string) vault.Store
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Option ¶
type Option func(*Store)
Option configures a keychain Store.
func WithService ¶
WithService overrides the default keyring service name ("vault").
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store is a vault.Store backed by the system keychain. It implements vault.Namespaced — calling Store.WithNamespace returns a store scoped to a different keyring service name.
func (*Store) List ¶
List returns all entries stored in the keychain by reading the key index and fetching each entry individually.
func (*Store) WithNamespace ¶
WithNamespace returns a vault.Store scoped to the given namespace. The namespace is appended to the service name (e.g. "vault/prod").