secrets

package
v1.9.1-beta.2 Latest Latest
Warning

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

Go to latest
Published: Jul 26, 2026 License: MPL-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const EncryptedFileName = "secrets.enc"
View Source
const EnvBackend = "DEVSY_SECRETS_BACKEND"
View Source
const EnvPassphrase = "DEVSY_SECRETS_PASSPHRASE" // #nosec G101 -- env var name, not a credential.
View Source
const IndexFileName = "secrets.yaml"
View Source
const KeyFileName = "secrets.key"

Variables

View Source
var ErrSecretNotFound = errors.New("secret not found")

Functions

func ParseSecretsFile

func ParseSecretsFile(path string) (map[string]string, error)

func ValidateName added in v1.10.0

func ValidateName(name string) error

Types

type Backend added in v1.10.0

type Backend string
const (
	BackendAuto    Backend = "auto"
	BackendKeyring Backend = "keyring"
	BackendFile    Backend = "file"
)

type Kind added in v1.10.0

type Kind string

Kind distinguishes secrets (values in the backend) from env vars (inline).

const (
	KindSecret Kind = "secret"
	KindEnv    Kind = "env"
)

type Redactor added in v1.10.0

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

func NewRedactor added in v1.10.0

func NewRedactor(secretsEnv []string) *Redactor

NewRedactor masks the values (not keys) of KEY=VALUE entries; empty values are ignored.

func (*Redactor) Redact added in v1.10.0

func (r *Redactor) Redact(s string) string

type SecretMeta added in v1.10.0

type SecretMeta struct {
	Name     string    `json:"name"`
	Context  string    `json:"context"`
	Kind     Kind      `json:"kind"`
	Value    string    `json:"value,omitempty"`
	Created  time.Time `json:"created"`
	LastUsed time.Time `json:"lastUsed,omitzero"`

	Orphaned bool `json:"-"`
}

func (SecretMeta) Sensitive added in v1.10.0

func (m SecretMeta) Sensitive() bool

type Store added in v1.10.0

type Store interface {
	Set(context, name, value string, kind Kind) error
	Get(context, name string) (string, error)
	Meta(context, name string) (SecretMeta, error)
	List(context string) ([]SecretMeta, error)
	Delete(context, name string) error
}

func NewStoreForConfig added in v1.10.0

func NewStoreForConfig(devsyConfig *config.Config) (Store, error)

Jump to

Keyboard shortcuts

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