secret

package
v1.6.3 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2024 License: MIT Imports: 25 Imported by: 2

Documentation

Overview

Package secret retrieves secrets.

Index

Constants

View Source
const (
	DefaultSecretsManagerPrefix = "aws-secretsmanager"
	DefaultParameterStorePrefix = "aws-parameterstore"
	DefaultS3Prefix             = "aws-s3"
	DefaultDynamoDbPrefix       = "aws-dynamodb"
	DefaultLambdaPrefix         = "aws-lambda"
	DefaultHTTPPrefix           = "#http"
	DefaultVaultPrefix          = "vault"
	DefaultProxyPrefix          = "proxy"
)

Define default prefixes for Secrets Manager and Parameter Store.

Variables

This section is empty.

Functions

This section is empty.

Types

type AwsConfigSolver added in v1.6.0

type AwsConfigSolver interface {
	// contains filtered or unexported methods
}

AwsConfigSolver provides aws configuration.

type AwsConfigSource added in v1.6.0

type AwsConfigSource struct {
	AwsConfigOptions awsconfig.Options
}

AwsConfigSource implements AwsConfigSolver.

type Options

type Options struct {
	Debug                bool
	Printf               boilerplate.FuncPrintf // defaults to log.Printf
	PrefixSecretsManager string                 // defaults to "aws-secretsmanager"
	PrefixParameterStore string                 // defaults to "aws-parameterstore"
	PrefixS3             string                 // defaults to "aws-s3"
	PrefixDynamoDb       string                 // defaults to "aws-dynamodb"
	PrefixLambda         string                 // defaults to "aws-lambda"
	PrefixHTTP           string                 // defaults to "#http"
	PrefixVault          string                 // defaults to "vault"
	PrefixProxy          string                 // defaults to "proxy"
	CrashOnQueryError    bool                   // require secret
	CacheTTLSeconds      int                    // cache TTL in seconds: -1=noCache 0=useDefault (60)
	AwsConfigSource      AwsConfigSolver
}

Options provide optional parameters for client.

type Secret

type Secret struct {
	// contains filtered or unexported fields
}

Secret holds context information for retrieving secrets.

func New

func New(opt Options) *Secret

New creates a Secret context for retrieving secrets.

func (*Secret) Retrieve

func (s *Secret) Retrieve(name string) string

Retrieve fetches a secret. If an error is found, only crashes if CrashOnQueryError is set. name: aws-secretsmanager:region:name:json_field

func (*Secret) RetrieveWithError added in v1.5.0

func (s *Secret) RetrieveWithError(name string) (string, error)

RetrieveWithError fetches a secret. name: aws-secretsmanager:region:name:json_field

Jump to

Keyboard shortcuts

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