Documentation
¶
Overview ¶
Package secretversion provides version resolution for AWS Secrets Manager.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( ErrInvalidID = errors.New("# must be followed by a version ID") ErrInvalidLabel = errors.New(": must be followed by a label") )
Secrets Manager-specific errors.
Functions ¶
func GetSecretWithVersion ¶
func GetSecretWithVersion(ctx context.Context, client Client, spec *Spec) (*secretapi.GetSecretValueOutput, error)
GetSecretWithVersion retrieves a secret with version/shift/label support.
func ParseDiffArgs ¶
ParseDiffArgs parses diff command arguments for Secrets Manager. This is a convenience wrapper around diff.ParseArgs with Secrets Manager-specific settings.
func TruncateVersionID ¶
TruncateVersionID truncates a version ID to 8 characters for display. Secrets Manager version IDs are UUIDs which are long; this provides a readable short form similar to git commit hashes.
Types ¶
type AbsoluteSpec ¶
type AbsoluteSpec struct {
ID *string // Version ID (#VERSION)
Label *string // Staging label (:LABEL)
}
AbsoluteSpec represents the absolute version specifier for Secrets Manager.
type Client ¶
type Client interface {
secretapi.GetSecretValueAPI
secretapi.ListSecretVersionIdsAPI
}
Client is the interface for GetSecretWithVersion.
type Spec ¶
type Spec = version.Spec[AbsoluteSpec]
Spec represents a parsed Secrets Manager secret version specification.
Grammar: <name>[#<id> | :<label>]<shift>*
- #<id> optional version ID (0 or 1, mutually exclusive with :LABEL)
- :<label> optional staging label (0 or 1, mutually exclusive with #VERSION)
- <shift> ~ or ~<N>, repeatable (0 or more, cumulative)
Examples: my-secret, my-secret#abc123, my-secret:AWSCURRENT, my-secret~1