Help us shape the future of Go! Take the 2026 Go Developer Survey

secretsmanager

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Overview

Package secretsmanager emulates AWS Secrets Manager over JSON 1.1: secrets with versions and staging labels, rotation through a Lambda function, random passwords, resource policies, tags, replica metadata and scheduled deletion.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Replica

type Replica struct {
	Region        string
	KmsKeyId      string `json:",omitempty"`
	Status        string `json:",omitempty"`
	StatusMessage string `json:",omitempty"`
}

Replica is the replication status of one region (API shape).

type RotationRules

type RotationRules struct {
	AutomaticallyAfterDays int64  `json:",omitempty"`
	Duration               string `json:",omitempty"`
	ScheduleExpression     string `json:",omitempty"`
}

RotationRules is the rotation schedule (API shape).

type Secret

type Secret struct {
	Name           string              `json:"name"`
	Account        string              `json:"account"`
	Region         string              `json:"region"`
	ARN            string              `json:"arn"`
	Description    string              `json:"description,omitempty"`
	KmsKeyID       string              `json:"kmsKeyId,omitempty"`
	Tags           []Tag               `json:"tags,omitempty"`
	Versions       map[string]*Version `json:"versions"`
	Policy         string              `json:"policy,omitempty"`
	Replicas       []Replica           `json:"replicas,omitempty"`
	Rotation       bool                `json:"rotation,omitempty"`
	RotationLambda string              `json:"rotationLambda,omitempty"`
	RotationRules  *RotationRules      `json:"rotationRules,omitempty"`
	Created        time.Time           `json:"created"`
	Changed        time.Time           `json:"changed"`
	Accessed       time.Time           `json:"accessed,omitzero"`
	Rotated        time.Time           `json:"rotated,omitzero"`
	Deleted        time.Time           `json:"deleted,omitzero"` // when DeleteSecret was called
	PurgeAt        time.Time           `json:"purgeAt,omitzero"` // end of the recovery window
}

Secret is one secret and its versions.

type Service

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

Service is the Secrets Manager emulator.

func New

func New(hub *core.Hub) *Service

New creates the Secrets Manager service.

func (*Service) Info

func (s *Service) Info() core.Info

func (*Service) Inspect

func (s *Service) Inspect(table, id string) any

Inspect returns a secret's DescribeSecret view; the value is never shown.

func (*Service) Load

func (s *Service) Load(b []byte) error

func (*Service) Reset

func (s *Service) Reset()

func (*Service) Resources

func (s *Service) Resources() []core.Table

Resources lists secrets for the console (never their values).

func (*Service) Save

func (s *Service) Save() ([]byte, error)

func (*Service) ServeHTTP

func (s *Service) ServeHTTP(w http.ResponseWriter, r *http.Request)

type Tag

type Tag struct {
	Key   string
	Value string
}

Tag is a secret tag (API shape).

type Version

type Version struct {
	ID       string    `json:"id"`
	String   *string   `json:"string,omitempty"`
	Binary   []byte    `json:"binary,omitempty"`
	Stages   []string  `json:"stages"`
	Created  time.Time `json:"created"`
	Accessed time.Time `json:"accessed,omitzero"`
}

Version is one secret value and its staging labels. A version without a value is the placeholder RotateSecret creates for the rotation function.

Jump to

Keyboard shortcuts

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