Documentation
¶
Index ¶
- func WithEnvCredentialProvider(ctx server.Cmd, fn func(provider.CredentialProvider) error) error
- func WithFileCredentialManager(ctx server.Cmd, path string, passphrases []string, ...) error
- func WithFileCredentialProvider(ctx server.Cmd, path string, passphrases []string, env bool, ...) error
- func WithPGCredentialManager(ctx server.Cmd, pool pg.PoolConn, schema string, passphrases []string, ...) error
- func WithPGCredentialProvider(ctx server.Cmd, pool pg.PoolConn, schema string, passphrases []string, ...) error
- type AWSFlags
- type BitwardenFlags
- type CredentialDeleteCmd
- type CredentialGetCmd
- type CredentialListCmd
- type CredentialManagerCommands
- type CredentialProviderCommands
- type CredentialRotateCmd
- type CredentialSetCmd
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WithEnvCredentialProvider ¶
WithEnvCredentialProvider creates a provider which only reads environment variables, and calls fn with it
func WithFileCredentialManager ¶
func WithFileCredentialManager(ctx server.Cmd, path string, passphrases []string, fn func(provider.CredentialManager) error) error
WithFileCredentialManager creates the file backend in the directory at the path, which is created with permissions 0700 and must be writable, with the passphrases, for versions 1, 2 and so on, without the environment as a fallback, and calls fn with it
func WithFileCredentialProvider ¶
func WithFileCredentialProvider(ctx server.Cmd, path string, passphrases []string, env bool, fn func(provider.CredentialProvider) error) error
WithFileCredentialProvider creates the file backend in the directory at the path, which is created with permissions 0700 and must be writable, with the passphrases, and the environment as a fallback when env is true, and calls fn with it
func WithPGCredentialManager ¶
func WithPGCredentialManager(ctx server.Cmd, pool pg.PoolConn, schema string, passphrases []string, fn func(provider.CredentialManager) error, opts ...pgcredential.Opt) error
WithPGCredentialManager creates the pg backend in the pool and schema, which is the default when it's empty, with the passphrases, for versions 1, 2 and so on, without the environment as a fallback, and calls fn with it, with the store's own options, such as pg.WithChannel. It needs a passphrase.
func WithPGCredentialProvider ¶
func WithPGCredentialProvider(ctx server.Cmd, pool pg.PoolConn, schema string, passphrases []string, env bool, fn func(provider.CredentialProvider) error) error
WithPGCredentialProvider creates the pg backend in the pool and schema, which is the default when it's empty, with the passphrases, and the environment as a fallback when env is true, and calls fn with it. Without a passphrase, credentials are only from the environment, or there are none without env.
Types ¶
type AWSFlags ¶
type AWSFlags struct {
Region string `name:"region" help:"AWS region, in place of AWS_REGION"`
Profile string `name:"profile" help:"AWS shared configuration profile, in place of AWS_PROFILE"`
Endpoint string `name:"endpoint" help:"Secrets Manager endpoint URL, such as for a local emulator"`
Prefix string `name:"prefix" env:"AWS_CREDENTIAL_PREFIX" help:"Prefix of secret names, such as myapp/"`
KMSKey string `name:"kms-key" env:"AWS_CREDENTIAL_KMS_KEY" help:"KMS key for new secrets, in place of the account's default key"`
RecoveryWindow *int `` /* 175-byte string literal not displayed */
}
AWSFlags stores credentials in AWS Secrets Manager. The region and credentials are otherwise from the AWS environment variables, such as AWS_REGION and AWS_PROFILE, and the shared configuration files.
func (AWSFlags) WithAWSCredentialManager ¶
func (flags AWSFlags) WithAWSCredentialManager(ctx server.Cmd, fn func(provider.CredentialManager) error) error
WithAWSCredentialManager creates the aws backend, without the environment as a fallback, and calls fn with it
func (AWSFlags) WithAWSCredentialProvider ¶
func (flags AWSFlags) WithAWSCredentialProvider(ctx server.Cmd, env bool, fn func(provider.CredentialProvider) error) error
WithAWSCredentialProvider creates the aws backend, with the environment as a fallback when env is true, and calls fn with it
type BitwardenFlags ¶
type BitwardenFlags struct {
AccessToken string `name:"access-token" env:"BWS_ACCESS_TOKEN" help:"Machine account access token"`
ServerURL string `` /* 129-byte string literal not displayed */
APIURL string `name:"api-url" help:"API server, with the identity server, such as https://api.bitwarden.eu"`
IdentityURL string `name:"identity-url" help:"Identity server, with the API server, such as https://identity.bitwarden.eu"`
}
BitwardenFlags stores credentials in Bitwarden Secrets Manager, for a machine account
func (BitwardenFlags) WithBitwardenCredentialManager ¶
func (flags BitwardenFlags) WithBitwardenCredentialManager(ctx server.Cmd, project string, fn func(provider.CredentialManager) error) error
WithBitwardenCredentialManager creates the bitwarden backend, without the environment as a fallback, and calls fn with it. New secrets are created in the project, by its identifier, which is required, as machine accounts can only create secrets in a project they can write to.
func (BitwardenFlags) WithBitwardenCredentialProvider ¶
func (flags BitwardenFlags) WithBitwardenCredentialProvider(ctx server.Cmd, env bool, fn func(provider.CredentialProvider) error) error
WithBitwardenCredentialProvider creates the bitwarden backend, with the environment as a fallback when env is true, and calls fn with it
type CredentialDeleteCmd ¶
type CredentialDeleteCmd struct {
Key string `arg:"" name:"key" help:"Credential key (identifier)."`
}
type CredentialGetCmd ¶
type CredentialListCmd ¶
type CredentialListCmd struct{}
type CredentialManagerCommands ¶
type CredentialManagerCommands struct {
CredentialList CredentialListCmd `cmd:"" name:"credentials" help:"List credential keys." group:"CREDENTIAL"`
CredentialDelete CredentialDeleteCmd `cmd:"" name:"credential-delete" help:"Delete a credential by key." group:"CREDENTIAL"`
CredentialRotate CredentialRotateCmd `` /* 158-byte string literal not displayed */
}
CredentialManagerCommands list, delete and rotate stored credentials
type CredentialProviderCommands ¶
type CredentialProviderCommands struct {
CredentialGet CredentialGetCmd `` /* 163-byte string literal not displayed */
CredentialSet CredentialSetCmd `` /* 132-byte string literal not displayed */
}
CredentialProviderCommands store credentials, and get a credential's value, with the passphrase it was encrypted with