Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Provider ¶
Provider represents the behaviour of obtaining a Buildkite token.
func Must ¶
Must is a helper function to ensure a Provider object can be successfully instantiated when calling any of the constructor functions provided by this package.
This helper is intended to be used at program startup to load the Provider implementation to be used. Such as:
var provider := token.Must(token.NewSSMProvider())
func NewInMemory ¶
NewInMemory constructs a Buildkite API token provider backed by a in-memory string.
func NewSSM ¶
func NewSSM(client SSMClient, name string, opts ...SSMProviderOpt) (Provider, error)
NewEnvironment constructs a Buildkite API token provider backed by AWS Systems Manager parameter store.
func NewSecretsManager ¶
func NewSecretsManager(client SecretsManagerClient, secretID string, opts ...SecretsManagerOpt) (Provider, error)
NewSecretsManager constructs a Buildkite API token provider backed by AWS Secrets Manager.
type SSMClient ¶
type SSMClient interface {
GetParameter(*ssm.GetParameterInput) (*ssm.GetParameterOutput, error)
}
SSMService represents the minimal subset of interactions required to retrieve a Buildkite API token from AWS Systems Manager parameter store.
type SSMProviderOpt ¶
type SSMProviderOpt func(prov *ssmProvider) error
SSMProviderOpt represents a configuration option for the AWS SSM Buildkite token provider.
type SecretsManagerClient ¶
type SecretsManagerClient interface {
GetSecretValue(*secretsmanager.GetSecretValueInput) (*secretsmanager.GetSecretValueOutput, error)
}
SecretsManagerClient represents the minimal interactions required to retrieve a Buildkite API token from AWS Secrets Manager.
type SecretsManagerOpt ¶
type SecretsManagerOpt func(opts *secretsManagerProvider) error
SecretsManagerOpt represents a configuration option for the AWS SecretsManager Buildkite token provider.
func WithSecretsManagerJSONSecret ¶
func WithSecretsManagerJSONSecret(key string) SecretsManagerOpt
WithSecretsManagerJSONSecret instructs SecretsManager Buidlkite token provider that the token is stored within a JSON payload. The key parameter specifies the JSON field holding the secret value within the JSON blob.
This configuration option works for both AWS supported secret formats (SecretString and SecretBinary). However, for the later case, the binary payload must be a valid JSON document containing the 'key' field.