secrets

package
v1.5.10 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2026 License: Apache-2.0 Imports: 4 Imported by: 0 modules, 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

Overview

Package secrets reads and writes SSM Parameter Store and Secrets Manager. Values travel as awsx.Secret and are scrubbed from every error.

Index

Constants

View Source
const Redacted = "[redacted]"

Redacted is what Redact writes in place of a value.

Variables

View Source
var (
	SSM            = awsx.Service{Name: "ssm", Prefix: "ssm", SigningName: "ssm", TargetPrefix: "AmazonSSM"}
	SecretsManager = awsx.Service{Name: "secretsmanager", Prefix: "secretsmanager", SigningName: "secretsmanager", TargetPrefix: "secretsmanager"}
)

SSM and Secrets Manager services (target prefixes checked against the botocore models).

Functions

func Redact

func Redact(text string, values ...string) string

Redact replaces every non-empty value in text, so logs and errors cannot carry one.

Types

type Client

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

Client is the lazy secrets module.

func New

func New(c *awsx.Client) *Client

New wraps a shared client.

func (*Client) GetParametersByPath

func (c *Client) GetParametersByPath(ctx context.Context, region, path string, recursive bool) ([]Parameter, error)

GetParametersByPath reads parameters under a path, decrypting SecureStrings.

func (*Client) GetSecretValue

func (c *Client) GetSecretValue(ctx context.Context, region, id string) (awsx.Secret, error)

GetSecretValue returns the string value of a secret.

func (*Client) ListSecrets

func (c *Client) ListSecrets(ctx context.Context, region string) ([]SecretSummary, error)

ListSecrets pages through the secrets in a region.

func (*Client) PutParameter

func (c *Client) PutParameter(ctx context.Context, region, name string, value awsx.Secret, overwrite bool) (int64, error)

PutParameter writes a SecureString and returns its new version.

func (*Client) PutSecretValue

func (c *Client) PutSecretValue(ctx context.Context, region, id string, value awsx.Secret) error

PutSecretValue stores a new version of an existing secret.

type Parameter

type Parameter struct {
	Name  string
	Type  string
	Value awsx.Secret
}

Parameter is one SSM parameter. Value is a Secret.

type SecretSummary

type SecretSummary struct{ Name, ARN string }

SecretSummary is one Secrets Manager entry without its value.

Jump to

Keyboard shortcuts

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