secret

package
v5.0.0 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2021 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// SecretPreFix for looking up env vars
	SecretPreFix = "SECRET_"
	// ConnectWorkerSecretPrefix prefix for connect worker secrets
	ConnectWorkerSecretPrefix = "WORKER_CONNECT_SECRET_"
	// EnvVaultRole is the environment var holding the vault role
	EnvVaultRole = "VAULT_ROLE"
	// EnvAzureClientID is the environment var holding the azure client id
	EnvAzureClientID = "AZURE_CLIENT_ID"
	// EnvAzureClientSecret is the environment var holding the azure client secret
	EnvAzureClientSecret = "AZURE_CLIENT_SECRET"
	// EnvAzureClientTenantID is the environment var holding the azure tenant id
	EnvAzureClientTenantID = "AZURE_TENANT_ID"
	// EnvAzureKeyVaultName is the environment var holding the azure key vault name
	EnvAzureKeyVaultName = "AZURE_KEY_VAULT"
	// EnvAzureKeyVaultDNS is the environment var holding the azure key dns
	EnvAzureKeyVaultDNS = "AZURE_KEY_VAULT_DNS"
)

Variables

This section is empty.

Functions

func NewAppGroupCommand

func NewAppGroupCommand() *cobra.Command

NewAppGroupCommand creates `secrets app` command

func NewAzureCommand

func NewAzureCommand(appType string) *cobra.Command

NewAzureCommand get secrets for azure by app type

func NewConnectGroupCommand

func NewConnectGroupCommand() *cobra.Command

NewConnectGroupCommand creates `secrets connect` command

func NewEnvCommand

func NewEnvCommand(appType string) *cobra.Command

NewEnvCommand secrets from environment variables

func NewSecretsGroupCommand

func NewSecretsGroupCommand() *cobra.Command

NewSecretsGroupCommand creates `secrets` command

func NewVaultCommand

func NewVaultCommand(appType string) *cobra.Command

NewVaultCommand creates `secrets connect vault` command

Types

type AzureConfiguration

type AzureConfiguration struct {
	ClientID     string
	ClientSecret string
	TenantID     string
	KeyVaultName string
}

AzureConfiguration holds azure configuration details

type KeyVault

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

KeyVault holds the information for a keyvault instance

type Provider

type Provider string

Provider secret provider type

const (
	// Vault Hashicorp Vault
	Vault Provider = "VAULT"
	// AzureKV Azure KeyVault
	AzureKV Provider = "AZURE_KV"
	// Kubernetes Kubernetes secrets
	Kubernetes Provider = "KUBERNETES"
)

type Secret

type Secret struct {
	EnvKey string
	Key    string
	Value  string
}

Secret holds the mapping of the env var to the secret key

func AzureKeyVaultHandler

func AzureKeyVaultHandler(vaultURL, file string, config AzureConfiguration) ([]Secret, error)

AzureKeyVaultHandler retrieves secret key values from Azure KeyVault based on environment variables

func EnvSecretHandler

func EnvSecretHandler(file string) ([]Secret, error)

EnvSecretHandler retrieves secret key values from environment variables

func VaultConnectExternalHandler

func VaultConnectExternalHandler(role, token, endpoint, file string) ([]Secret, error)

VaultConnectExternalHandler retrieves secret key values from Vault based on environment variables

Jump to

Keyboard shortcuts

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