Documentation
¶
Overview ¶
Package secrets provides opaque secret references and redaction helpers.
ShiftLock never becomes a secret manager: values are resolved at use sites and must not appear in logs, diagnostics, or incident bundles.
Index ¶
Constants ¶
const DefaultMaxRotations = 256
DefaultMaxRotations bounds tracked rotation records.
Variables ¶
Functions ¶
Types ¶
type EnvFileResolver ¶
type EnvFileResolver struct {
ReadFile func(name string) ([]byte, error)
LookupEnv func(key string) (string, bool)
}
EnvFileResolver resolves env:// and file:// references.
type Ref ¶
type Ref struct {
// contains filtered or unexported fields
}
Ref is an opaque secret locator. String() never includes resolved material.
func ParseRef ¶
ParseRef accepts env://NAME or file://path (and file:///absolute).
func (Ref) PathOrName ¶
PathOrName returns the env var name or filesystem path.
type RotationLog ¶
type RotationLog struct {
// contains filtered or unexported fields
}
RotationLog records rotation workflow steps by opaque Ref strings.
func NewRotationLog ¶
func NewRotationLog(max int) *RotationLog
NewRotationLog creates an empty rotation log.
func (*RotationLog) Advance ¶
func (l *RotationLog) Advance(name string, phase RotationPhase, message string) error
Advance moves a rotation to the next recorded phase (references only).
func (*RotationLog) Get ¶
func (l *RotationLog) Get(name string) (RotationRecord, error)
Get returns a copy of the rotation record.
func (*RotationLog) List ¶
func (l *RotationLog) List() []RotationRecord
List returns all rotation records (references only).
type RotationPhase ¶
type RotationPhase string
RotationPhase is a secret rotation lifecycle stage.
const ( RotationPlanned RotationPhase = "planned" RotationIssued RotationPhase = "issued" RotationPropagated RotationPhase = "propagated" RotationVerified RotationPhase = "verified" RotationRetired RotationPhase = "retired" RotationFailed RotationPhase = "failed" )
type RotationRecord ¶
type RotationRecord struct {
Name string `json:"name"`
OldRef string `json:"old_ref"`
NewRef string `json:"new_ref"`
Phase RotationPhase `json:"phase"`
Actor string `json:"actor,omitempty"`
Message string `json:"message,omitempty"`
UpdatedAt time.Time `json:"updated_at"`
}
RotationRecord tracks secret references only — never values.