Documentation ¶
Index ¶
- Constants
- type ASM
- func (a *ASM) Delete(ctx context.Context, ref configuration.Ref) error
- func (*ASM) Key() configuration.ProviderKey
- func (ASM) Role() configuration.Secrets
- func (a *ASM) Store(ctx context.Context, ref configuration.Ref, value []byte) (*url.URL, error)
- func (a *ASM) Sync(ctx context.Context) (map[configuration.Ref]configuration.SyncedValue, error)
- func (a *ASM) SyncInterval() time.Duration
- type Envar
- func (e Envar[R]) Delete(ctx context.Context, ref configuration.Ref) error
- func (Envar[R]) Key() configuration.ProviderKey
- func (e Envar[R]) Load(ctx context.Context, ref configuration.Ref, key *url.URL) ([]byte, error)
- func (Envar[R]) Role() R
- func (e Envar[R]) Store(ctx context.Context, ref configuration.Ref, value []byte) (*url.URL, error)
- type Factory
- func NewASMFactory(secretsClient *secretsmanager.Client, advertise *url.URL, leaser leases.Leaser) (configuration.ProviderKey, Factory[configuration.Secrets])
- func NewEnvarFactory[R configuration.Role]() (configuration.ProviderKey, Factory[R])
- func NewInlineFactory[R configuration.Role]() (configuration.ProviderKey, Factory[R])
- func NewKeychainFactory() (configuration.ProviderKey, Factory[configuration.Secrets])
- func NewOnePasswordFactory(vault string, projectName string) (configuration.ProviderKey, Factory[configuration.Secrets])
- type Inline
- func (Inline[R]) Delete(ctx context.Context, ref configuration.Ref) error
- func (Inline[R]) Key() configuration.ProviderKey
- func (Inline[R]) Load(ctx context.Context, ref configuration.Ref, key *url.URL) ([]byte, error)
- func (Inline[R]) Role() R
- func (Inline[R]) Store(ctx context.Context, ref configuration.Ref, value []byte) (*url.URL, error)
- type Keychain
- func (k Keychain) Delete(ctx context.Context, ref configuration.Ref) error
- func (k Keychain) Key() configuration.ProviderKey
- func (k Keychain) Load(ctx context.Context, ref configuration.Ref, key *url.URL) ([]byte, error)
- func (Keychain) Role() configuration.Secrets
- func (k Keychain) Store(ctx context.Context, ref configuration.Ref, value []byte) (*url.URL, error)
- type OnePassword
- func (o OnePassword) Delete(ctx context.Context, ref configuration.Ref) error
- func (o OnePassword) Key() configuration.ProviderKey
- func (OnePassword) Role() configuration.Secrets
- func (o OnePassword) Store(ctx context.Context, ref configuration.Ref, value []byte) (*url.URL, error)
- func (o OnePassword) Sync(ctx context.Context) (map[configuration.Ref]configuration.SyncedValue, error)
- func (o OnePassword) SyncInterval() time.Duration
- type Registry
Constants ¶
const ASMProviderKey configuration.ProviderKey = "asm"
const EnvarProviderKey configuration.ProviderKey = "envar"
const InlineProviderKey configuration.ProviderKey = "inline"
const KeychainProviderKey configuration.ProviderKey = "keychain"
const OnePasswordProviderKey configuration.ProviderKey = "op"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ASM ¶
type ASM struct {
// contains filtered or unexported fields
}
ASM implements a Provider for AWS Secrets Manager (ASM). Only supports loading "string" secrets, not binary secrets.
One controller is elected as the leader and is responsible for syncing the cache of secrets from ASM (see asmManager). Others get secrets from the leader via AdminService (see asmFollower).
func NewASM ¶
func NewASM(secretsClient *secretsmanager.Client) *ASM
func (*ASM) Key ¶
func (*ASM) Key() configuration.ProviderKey
func (ASM) Role ¶
func (ASM) Role() configuration.Secrets
func (*ASM) Sync ¶
func (a *ASM) Sync(ctx context.Context) (map[configuration.Ref]configuration.SyncedValue, error)
func (*ASM) SyncInterval ¶
type Envar ¶
type Envar[R configuration.Role] struct{}
Envar is a configuration provider that reads secrets or configuration from environment variables.
func NewEnvar ¶
func NewEnvar[R configuration.Role]() Envar[R]
func (Envar[R]) Key ¶
func (Envar[R]) Key() configuration.ProviderKey
type Factory ¶
type Factory[R configuration.Role] func(ctx context.Context) (configuration.Provider[R], error)
func NewASMFactory ¶
func NewASMFactory(secretsClient *secretsmanager.Client, advertise *url.URL, leaser leases.Leaser) (configuration.ProviderKey, Factory[configuration.Secrets])
func NewEnvarFactory ¶
func NewEnvarFactory[R configuration.Role]() (configuration.ProviderKey, Factory[R])
func NewInlineFactory ¶
func NewInlineFactory[R configuration.Role]() (configuration.ProviderKey, Factory[R])
func NewKeychainFactory ¶
func NewKeychainFactory() (configuration.ProviderKey, Factory[configuration.Secrets])
func NewOnePasswordFactory ¶
func NewOnePasswordFactory(vault string, projectName string) (configuration.ProviderKey, Factory[configuration.Secrets])
type Inline ¶
type Inline[R configuration.Role] struct{}
Inline is a configuration provider that stores configuration in its key.
func NewInline ¶
func NewInline[R configuration.Role]() Inline[R]
func (Inline[R]) Key ¶
func (Inline[R]) Key() configuration.ProviderKey
type Keychain ¶
type Keychain struct{}
func NewKeychain ¶
func NewKeychain() Keychain
func (Keychain) Key ¶
func (k Keychain) Key() configuration.ProviderKey
func (Keychain) Role ¶
func (Keychain) Role() configuration.Secrets
type OnePassword ¶
OnePassword is a configuration provider that reads passwords from 1Password vaults via the "op" command line tool.
func NewOnePassword ¶
func NewOnePassword(vault string, projectName string) OnePassword
func (OnePassword) Delete ¶
func (o OnePassword) Delete(ctx context.Context, ref configuration.Ref) error
func (OnePassword) Key ¶
func (o OnePassword) Key() configuration.ProviderKey
func (OnePassword) Role ¶
func (OnePassword) Role() configuration.Secrets
func (OnePassword) Store ¶
func (o OnePassword) Store(ctx context.Context, ref configuration.Ref, value []byte) (*url.URL, error)
Store will save the given secret in 1Password via the `op` command.
op does not support "create or update" as a single command. Neither does it support specifying an ID on create. Because of this, we need check if the item exists before creating it, and update it if it does.
func (OnePassword) Sync ¶
func (o OnePassword) Sync(ctx context.Context) (map[configuration.Ref]configuration.SyncedValue, error)
Sync will fetch all secrets from the 1Password vault and store them in the values map. Do not just sync the o.Vault, instead find all vaults found in entries and sync them.
func (OnePassword) SyncInterval ¶
func (o OnePassword) SyncInterval() time.Duration
type Registry ¶
type Registry[R configuration.Role] struct { // contains filtered or unexported fields }
Registry that lazily constructs configuration
func NewDefaultConfigRegistry ¶
func NewDefaultConfigRegistry() *Registry[configuration.Configuration]
NewDefaultConfigRegistry creates a new registry with the default configuration providers.
func NewDefaultSecretsRegistry ¶
func NewDefaultSecretsRegistry(config projectconfig.Config, onePasswordVault string) *Registry[configuration.Secrets]
NewDefaultSecretsRegistry creates a new registry with the default secrets providers.
func NewRegistry ¶
func NewRegistry[R configuration.Role]() *Registry[R]
func (*Registry[R]) Get ¶
func (r *Registry[R]) Get(ctx context.Context, name configuration.ProviderKey) (configuration.Provider[R], error)
func (*Registry[R]) Providers ¶
func (r *Registry[R]) Providers() []configuration.ProviderKey
Providers returns the list of registered provider keys.
func (*Registry[R]) Register ¶
func (r *Registry[R]) Register(name configuration.ProviderKey, factory Factory[R])