secretmgr

package
v0.0.90 Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2020 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// KindLocal for using a local Secret in Kubernetes
	KindLocal = "local"

	// KindGoogleSecretManager for using Google Secret Manager
	KindGoogleSecretManager = "gsm"

	// KindFake for a fake secret manager
	KindFake = "fake"

	// KindVault for a vault based secret manager
	KindVault = "vault"

	// BootGitURLSecret the name of the Kubernetes Secret used to store the git clone URL
	/* #nosec */
	BootGitURLSecret = "jx-boot-git-url"

	// BootGitURLSecretKey the key in the Secret to store the git clone URL
	BootGitURLSecretKey = "git-url"

	// LocalSecret the name of the Kubernetes Secret used to load/store the
	// secrets
	/* #nosec */
	LocalSecret = "jx-boot-secrets"

	// LocalSecretKey the key in the local Secret to store the YAML secrets
	LocalSecretKey = "secrets.yaml"

	// DefaultSecretsYaml the default YAML
	DefaultSecretsYaml = `secrets:
  adminUser:
    username: 
    password: 
  hmacToken: 
  pipelineUser:
    username: 
    token: 
    email:
`
)

Variables

View Source
var (
	// KindValues the kind of secret managers we support
	KindValues = []string{KindGoogleSecretManager, KindLocal}
)

Functions

func AddUserTokenToGitURLFromSecretsYAML added in v0.0.87

func AddUserTokenToGitURLFromSecretsYAML(gitURL string, secretsYAML string) (string, error)

AddUserTokenToGitURLFromSecretsYAML adds the user/token to the git URL if the secrets YAML is not empty

func PipelineUserTokenFromSecretsYAML added in v0.0.84

func PipelineUserTokenFromSecretsYAML(data []byte, message string) (string, string, error)

PipelineUserTokenFromSecretsYAML returns the pipeline user and token from the Secrets YAML

func RemoveMapEmptyValues added in v0.0.78

func RemoveMapEmptyValues(m map[string]interface{})

RemoveMapEmptyValues recursively removes all empty string or nil entries

func ToSecretsYAML added in v0.0.78

func ToSecretsYAML(values map[string]interface{}) (string, error)

ToSecretsYAML converts the data to secrets YAML

func UnmarshalSecretsYAML added in v0.0.78

func UnmarshalSecretsYAML(secretsYaml string) (map[string]interface{}, error)

UnmarshalSecretsYAML unmarshals the given Secrets YAML

func VerifyBootSecrets added in v0.0.57

func VerifyBootSecrets(secretsYAML string) error

VerifyBootSecrets verifies the boot secrets

Types

type SecretCallback

type SecretCallback func(secretYaml string) (string, error)

type SecretManager

type SecretManager interface {

	// UpsertSecrets inserts or updates the secrets using some kind of storage
	// with the callback taking the current or default secrets, invoking the callback to modify them
	// then storing them in a cloud secret manager, local kubernetes Secret or vault etc.
	UpsertSecrets(callback SecretCallback, defaultYaml string) error

	// Kind returns the kind of the Secret Manager
	Kind() string

	// String returns the string description of the secrets manager
	String() string
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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