Documentation
¶
Index ¶
- type Backend
- type BlobBackend
- type ConfigTokenBackend
- func (b *ConfigTokenBackend) DefaultRef(name, account string) string
- func (b *ConfigTokenBackend) DeleteBlob(ctx context.Context, ref Ref) error
- func (b *ConfigTokenBackend) DisplayName() string
- func (b *ConfigTokenBackend) Exists(ctx context.Context, ref Ref) (bool, error)
- func (b *ConfigTokenBackend) LoadBlob(_ context.Context, ref Ref) ([]byte, error)
- func (b *ConfigTokenBackend) Resolve(ctx context.Context, ref Ref) (string, error)
- func (b *ConfigTokenBackend) SaveBlob(ctx context.Context, ref Ref, data []byte) error
- func (b *ConfigTokenBackend) Scheme() string
- func (b *ConfigTokenBackend) Store(ctx context.Context, ref Ref, value string) error
- func (b *ConfigTokenBackend) WriteSupported() bool
- type EnvBackend
- type EnvLookup
- type Error
- type ErrorKind
- type FileBackend
- func (b *FileBackend) DefaultRef(name, account string) string
- func (b *FileBackend) DeleteBlob(_ context.Context, ref Ref) error
- func (b *FileBackend) DisplayName() string
- func (b *FileBackend) Exists(_ context.Context, ref Ref) (bool, error)
- func (b *FileBackend) LoadBlob(_ context.Context, ref Ref) ([]byte, error)
- func (b *FileBackend) Resolve(ctx context.Context, ref Ref) (string, error)
- func (b *FileBackend) SaveBlob(_ context.Context, ref Ref, data []byte) error
- func (b *FileBackend) Scheme() string
- func (b *FileBackend) Store(ctx context.Context, ref Ref, value string) error
- func (b *FileBackend) WriteSupported() bool
- type KeychainBackend
- func (b *KeychainBackend) DefaultRef(storeName, account string) string
- func (b *KeychainBackend) DeleteBlob(ctx context.Context, ref Ref) error
- func (b *KeychainBackend) DisplayName() string
- func (b *KeychainBackend) Exists(ctx context.Context, ref Ref) (bool, error)
- func (b *KeychainBackend) LoadBlob(ctx context.Context, ref Ref) ([]byte, error)
- func (b *KeychainBackend) Resolve(ctx context.Context, ref Ref) (string, error)
- func (b *KeychainBackend) SaveBlob(ctx context.Context, ref Ref, data []byte) error
- func (b *KeychainBackend) Scheme() string
- func (b *KeychainBackend) Store(ctx context.Context, ref Ref, value string) error
- func (b *KeychainBackend) WriteSupported() bool
- type Ref
- type Resolver
- func (r *Resolver) DeleteBlob(ctx context.Context, raw string) error
- func (r *Resolver) Exists(ctx context.Context, raw string) (bool, error)
- func (r *Resolver) LoadBlob(ctx context.Context, raw string) ([]byte, error)
- func (r *Resolver) Resolve(ctx context.Context, raw string) (string, error)
- func (r *Resolver) SaveBlob(ctx context.Context, raw string, data []byte) error
- func (r *Resolver) Store(ctx context.Context, raw, value string) error
- func (r *Resolver) WritableBackends() []WritableBackend
- type SecretServiceBackend
- func (b *SecretServiceBackend) DefaultRef(storeName, account string) string
- func (b *SecretServiceBackend) DisplayName() string
- func (b *SecretServiceBackend) Exists(ctx context.Context, ref Ref) (bool, error)
- func (b *SecretServiceBackend) Resolve(ctx context.Context, ref Ref) (string, error)
- func (b *SecretServiceBackend) Scheme() string
- func (b *SecretServiceBackend) Store(ctx context.Context, ref Ref, value string) error
- func (b *SecretServiceBackend) WriteSupported() bool
- type WincredBackend
- func (b *WincredBackend) DefaultRef(storeName, account string) string
- func (b *WincredBackend) DisplayName() string
- func (b *WincredBackend) Exists(ctx context.Context, ref Ref) (bool, error)
- func (b *WincredBackend) Resolve(ctx context.Context, ref Ref) (string, error)
- func (b *WincredBackend) Scheme() string
- func (b *WincredBackend) Store(ctx context.Context, ref Ref, value string) error
- func (b *WincredBackend) WriteSupported() bool
- type WritableBackend
- type WritableBlobBackend
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BlobBackend ¶ added in v1.14.0
type BlobBackend interface {
Backend
Scheme() string
LoadBlob(ctx context.Context, ref Ref) ([]byte, error)
}
BlobBackend extends a backend to support binary data retrieval.
type ConfigTokenBackend ¶ added in v1.14.0
type ConfigTokenBackend struct{}
ConfigTokenBackend handles config-token://<provider>/<name> references. It stores tokens in the app's managed config directory.
func NewConfigTokenBackend ¶ added in v1.14.0
func NewConfigTokenBackend() *ConfigTokenBackend
func (*ConfigTokenBackend) DefaultRef ¶ added in v1.14.0
func (b *ConfigTokenBackend) DefaultRef(name, account string) string
func (*ConfigTokenBackend) DeleteBlob ¶ added in v1.14.0
func (b *ConfigTokenBackend) DeleteBlob(ctx context.Context, ref Ref) error
func (*ConfigTokenBackend) DisplayName ¶ added in v1.14.0
func (b *ConfigTokenBackend) DisplayName() string
func (*ConfigTokenBackend) Scheme ¶ added in v1.14.0
func (b *ConfigTokenBackend) Scheme() string
func (*ConfigTokenBackend) WriteSupported ¶ added in v1.14.0
func (b *ConfigTokenBackend) WriteSupported() bool
type EnvBackend ¶
type EnvBackend struct {
// contains filtered or unexported fields
}
EnvBackend resolves env://VAR references.
func NewEnvBackend ¶
func NewEnvBackend(lookup EnvLookup) *EnvBackend
type FileBackend ¶ added in v1.14.0
type FileBackend struct{}
FileBackend handles file://<path> references.
func NewFileBackend ¶ added in v1.14.0
func NewFileBackend() *FileBackend
func (*FileBackend) DefaultRef ¶ added in v1.14.0
func (b *FileBackend) DefaultRef(name, account string) string
func (*FileBackend) DeleteBlob ¶ added in v1.14.0
func (b *FileBackend) DeleteBlob(_ context.Context, ref Ref) error
func (*FileBackend) DisplayName ¶ added in v1.14.0
func (b *FileBackend) DisplayName() string
func (*FileBackend) Scheme ¶ added in v1.14.0
func (b *FileBackend) Scheme() string
func (*FileBackend) WriteSupported ¶ added in v1.14.0
func (b *FileBackend) WriteSupported() bool
type KeychainBackend ¶
type KeychainBackend struct {
// contains filtered or unexported fields
}
KeychainBackend resolves keychain://service/account references.
func NewKeychainBackend ¶
func NewKeychainBackend() *KeychainBackend
NewKeychainBackend creates a keychain backend for the current platform.
func (*KeychainBackend) DefaultRef ¶ added in v1.13.0
func (b *KeychainBackend) DefaultRef(storeName, account string) string
func (*KeychainBackend) DeleteBlob ¶ added in v1.14.0
func (b *KeychainBackend) DeleteBlob(ctx context.Context, ref Ref) error
func (*KeychainBackend) DisplayName ¶ added in v1.13.0
func (b *KeychainBackend) DisplayName() string
func (*KeychainBackend) Scheme ¶ added in v1.13.0
func (b *KeychainBackend) Scheme() string
func (*KeychainBackend) WriteSupported ¶ added in v1.13.0
func (b *KeychainBackend) WriteSupported() bool
type Resolver ¶
type Resolver struct {
// contains filtered or unexported fields
}
Resolver routes secret references by scheme.
func NewDefaultResolver ¶
func NewDefaultResolver() *Resolver
NewDefaultResolver builds the standard resolver with built-in env, file, config-token, and platform-native secret backends.
func NewResolver ¶
NewResolver creates a resolver from scheme backends.
func (*Resolver) DeleteBlob ¶ added in v1.14.0
DeleteBlob parses and removes a binary blob from a secret reference.
func (*Resolver) Exists ¶ added in v1.13.0
Exists reports whether a writable secret reference already exists.
func (*Resolver) LoadBlob ¶ added in v1.14.0
LoadBlob parses and retrieves a binary blob from a secret reference.
func (*Resolver) SaveBlob ¶ added in v1.14.0
SaveBlob parses and atomically stores a binary blob to a secret reference.
func (*Resolver) WritableBackends ¶ added in v1.13.0
func (r *Resolver) WritableBackends() []WritableBackend
WritableBackends returns registered backends that support interactive writes.
type SecretServiceBackend ¶ added in v1.13.0
type SecretServiceBackend struct {
// contains filtered or unexported fields
}
SecretServiceBackend resolves secret-service://collection/item references.
func NewSecretServiceBackend ¶ added in v1.13.0
func NewSecretServiceBackend() *SecretServiceBackend
NewSecretServiceBackend creates a Secret Service backend for the current platform.
func (*SecretServiceBackend) DefaultRef ¶ added in v1.13.0
func (b *SecretServiceBackend) DefaultRef(storeName, account string) string
func (*SecretServiceBackend) DisplayName ¶ added in v1.13.0
func (b *SecretServiceBackend) DisplayName() string
func (*SecretServiceBackend) Scheme ¶ added in v1.13.0
func (b *SecretServiceBackend) Scheme() string
func (*SecretServiceBackend) WriteSupported ¶ added in v1.13.0
func (b *SecretServiceBackend) WriteSupported() bool
type WincredBackend ¶ added in v1.13.0
type WincredBackend struct {
// contains filtered or unexported fields
}
WincredBackend resolves wincred://target references.
func NewWincredBackend ¶ added in v1.13.0
func NewWincredBackend() *WincredBackend
NewWincredBackend creates a Windows Credential Manager backend for the current platform.
func (*WincredBackend) DefaultRef ¶ added in v1.13.0
func (b *WincredBackend) DefaultRef(storeName, account string) string
func (*WincredBackend) DisplayName ¶ added in v1.13.0
func (b *WincredBackend) DisplayName() string
func (*WincredBackend) Scheme ¶ added in v1.13.0
func (b *WincredBackend) Scheme() string
func (*WincredBackend) WriteSupported ¶ added in v1.13.0
func (b *WincredBackend) WriteSupported() bool
type WritableBackend ¶ added in v1.13.0
type WritableBackend interface {
Backend
Scheme() string
DisplayName() string
WriteSupported() bool
DefaultRef(storeName, account string) string
Exists(ctx context.Context, ref Ref) (bool, error)
Store(ctx context.Context, ref Ref, value string) error
}
WritableBackend extends a backend with native-store write and existence checks for interactive CLI flows.