secretserver

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2025 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const CipherEnvVarName = "SECRET_CIPHER_ALGORITHM"

CipherEnvVarName is the name of the envvar that contains the decryption cipher algorithm.

View Source
const ConcourseConfigEnvVarName = "SECRETS_SERVER_CONCOURSE_CFG_NAME"

ConcourseConfigEnvVarName is the name of the envvar that contains the name of concourse config.

View Source
const ContainerRegistryConfigType = "container_registry"

ContainerRegistryConfigType is the cc secret server container registry config type

View Source
const EndpointEnvVarName = "SECRETS_SERVER_ENDPOINT"

EndpointEnvVarName is the name of the envvar that contains the endpoint of the secret server.

View Source
const SecretKeyEnvVarName = "SECRET_KEY"

SecretKeyEnvVarName is the name of the envar that contains the decryption key.

Variables

View Source
var ErrNoSecretFoundError = errors.New("no secret server configuration found")

Functions

func ECBDecrypt

func ECBDecrypt(block cipher.Block, dst, src []byte) error

ECBDecrypt decrypts ecb data.

Types

type ContainerRegistryCredentials

type ContainerRegistryCredentials struct {
	Username               string    `json:"username"`
	Password               string    `json:"password"`
	Privileges             Privilege `json:"privileges"`
	Host                   string    `json:"host,omitempty"`
	ImageReferencePrefixes []string  `json:"image_reference_prefixes,omitempty"`
}

ContainerRegistryCredentials describes the container registry credentials struct as given by the cc secrets server.

type KeyringBuilder

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

KeyringBuilder is a builder that creates a keyring from a concourse config file.

func New

func New() *KeyringBuilder

New creates a new keyring builder.

func (*KeyringBuilder) Apply

func (kb *KeyringBuilder) Apply(keyring *credentials.GeneralOciKeyring) error

Apply applies the found configuration to the given keyring.

func (*KeyringBuilder) Build

Build creates a oci keyring based on the given configuration. It returns nil if now credentials can be found.

func (*KeyringBuilder) For

func (kb *KeyringBuilder) For(ref string) *KeyringBuilder

For configures the builder to only include the config that one reference.

func (*KeyringBuilder) FromPath

func (kb *KeyringBuilder) FromPath(path string) *KeyringBuilder

FromPath configures local concourse config file.

func (*KeyringBuilder) WithFS

func (kb *KeyringBuilder) WithFS(fs vfs.FileSystem) *KeyringBuilder

WithFS configures the builder to use a different filesystem

func (*KeyringBuilder) WithLog

func (kb *KeyringBuilder) WithLog(log logr.Logger) *KeyringBuilder

WithLog configures a optional logger

func (*KeyringBuilder) WithMinPrivileges

func (kb *KeyringBuilder) WithMinPrivileges(priv Privilege) *KeyringBuilder

WithMinPrivileges configures the builder to only include credentials with a minimal config

type Privilege

type Privilege string
const (
	ReadOnly  Privilege = "readonly"
	ReadWrite Privilege = "readwrite"
)

type SecretServer

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

func NewSecretServer

func NewSecretServer() (*SecretServer, error)

NewSecretServer creates a new secret server instance using given env vars.

func (*SecretServer) Get

func (ss *SecretServer) Get() (*SecretServerConfig, error)

Get returns the secret configuration from the server.

type SecretServerConfig

type SecretServerConfig struct {
	ContainerRegistry map[string]*ContainerRegistryCredentials `json:"container_registry"`
}

SecretServerConfig is the struct that describes the secret server concourse config

Jump to

Keyboard shortcuts

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