credential

package
v0.0.21 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 20, 2026 License: Apache-2.0 Imports: 26 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WithEnvCredentialProvider

func WithEnvCredentialProvider(ctx server.Cmd, fn func(provider.CredentialProvider) error) error

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)."`
}

func (*CredentialDeleteCmd) Run

func (cmd *CredentialDeleteCmd) Run(ctx server.Cmd) error

type CredentialGetCmd

type CredentialGetCmd struct {
	Json bool   `name:"json" help:"Output string credentials as JSON strings." negatable:""`
	Show bool   `name:"show" help:"Print the credential when the output is a terminal, rather than a pipe or file."`
	Key  string `arg:"" name:"key" help:"Credential key (identifier)."`
}

func (*CredentialGetCmd) Run

func (cmd *CredentialGetCmd) Run(ctx server.Cmd) error

type CredentialListCmd

type CredentialListCmd struct{}

func (*CredentialListCmd) Run

func (cmd *CredentialListCmd) Run(ctx server.Cmd) error

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

type CredentialRotateCmd

type CredentialRotateCmd struct {
	All bool   `name:"all" help:"Rotate every credential which needs rotating, rather than one."`
	Key string `arg:"" optional:"" name:"key" help:"Credential key (identifier)."`
}

func (*CredentialRotateCmd) Run

func (cmd *CredentialRotateCmd) Run(ctx server.Cmd) error

type CredentialSetCmd

type CredentialSetCmd struct {
	Json        bool    `name:"json" help:"Interpret the credential value as JSON, rather than a string." negatable:""`
	Description *string `` /* 141-byte string literal not displayed */
	Key         string  `arg:"" name:"key" help:"Credential key (identifier)."`
}

func (*CredentialSetCmd) Run

func (cmd *CredentialSetCmd) Run(ctx server.Cmd) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL