secrets

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2026 License: Apache-2.0 Imports: 27 Imported by: 0

Documentation

Overview

Package secrets provides commands for managing scafctl secrets.

Index

Constants

View Source
const (
	// InternalSecretPrefix is the prefix used for internal scafctl secrets (e.g. auth tokens).
	InternalSecretPrefix = "scafctl." //nolint:gosec // Not a credential, just a naming prefix
)

Variables

This section is empty.

Functions

func CommandDelete

func CommandDelete(cliParams *settings.Run, _ *terminal.IOStreams, _ string) *cobra.Command

CommandDelete creates the 'secrets delete' command.

func CommandExists

func CommandExists(cliParams *settings.Run, ioStreams *terminal.IOStreams, _ string) *cobra.Command

CommandExists creates the 'secrets exists' command.

func CommandExport

func CommandExport(cliParams *settings.Run, _ *terminal.IOStreams, _ string) *cobra.Command

CommandExport creates the 'secrets export' command.

func CommandGet

func CommandGet(_ *settings.Run, ioStreams *terminal.IOStreams, _ string) *cobra.Command

CommandGet creates the 'secrets get' command.

func CommandImport

func CommandImport(_ *settings.Run, ioStreams *terminal.IOStreams, _ string) *cobra.Command

CommandImport creates the 'secrets import' command.

func CommandList

func CommandList(cliParams *settings.Run, ioStreams *terminal.IOStreams, _ string) *cobra.Command

CommandList creates the 'secrets list' command.

func CommandRotate

func CommandRotate(cliParams *settings.Run, _ *terminal.IOStreams, _ string) *cobra.Command

CommandRotate creates the 'secrets rotate' command.

func CommandSecrets

func CommandSecrets(cliParams *settings.Run, ioStreams *terminal.IOStreams, path string) *cobra.Command

CommandSecrets creates the 'secrets' command.

func CommandSet

func CommandSet(_ *settings.Run, ioStreams *terminal.IOStreams, _ string) *cobra.Command

CommandSet creates the 'secrets set' command.

func FilterSecrets added in v0.4.0

func FilterSecrets(names []string, includeInternal bool) []string

FilterSecrets filters secret names, optionally including internal secrets (scafctl.*). When includeInternal is false, internal secrets are excluded.

func FilterUserSecrets

func FilterUserSecrets(names []string) []string

FilterUserSecrets filters out internal secrets (scafctl.*) from a list of secret names.

func IsInternalSecret added in v0.4.0

func IsInternalSecret(name string) bool

IsInternalSecret returns true if the secret name belongs to the internal namespace.

func SecretType added in v0.4.0

func SecretType(name string) string

SecretType returns "internal" or "user" based on the secret name prefix.

func ValidateSecretName added in v0.4.0

func ValidateSecretName(name string, includeInternal bool) error

ValidateSecretName validates a secret name, optionally allowing internal secrets. When includeInternal is false, names starting with "scafctl." are rejected.

func ValidateUserSecretName

func ValidateUserSecretName(name string) error

ValidateUserSecretName validates a secret name for user operations. Returns an error if the name is invalid or uses the reserved "scafctl." prefix.

Types

type ExportFormat

type ExportFormat struct {
	Version    string           `json:"version" yaml:"version"`
	ExportedAt string           `json:"exported_at" yaml:"exported_at"`
	Secrets    []ExportedSecret `json:"secrets" yaml:"secrets"`
}

ExportFormat represents the format for exported secrets.

type ExportedSecret

type ExportedSecret struct {
	Name  string `json:"name" yaml:"name"`
	Value string `json:"value" yaml:"value"`
}

ExportedSecret represents a single exported secret.

Jump to

Keyboard shortcuts

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