Documentation ¶
Index ¶
- func AddPrefixToVKVPath(p, mountPath, apiPrefix string) string
- func CastSecretDataToStringMap(secretData map[string]interface{}) map[string]interface{}
- func GCPBackendLogin(client *Client, gcpBackendConfig *GCPBackendConfig, vaultConfig *Config) (string, error)
- func GetKVConfig(client *api.Client, cfg *SecretConfig) error
- func GetServiceAccountCreds(cfg *GCPBackendConfig) (*jwt.Config, error)
- func GetServiceAccountToken(tokenPath string) ([]byte, error)
- func KubernetesBackendLogin(client *Client, vaultCfg *Config, jwt []byte) (string, error)
- func RetrieveSecret(client *api.Client, cfg *SecretConfig) (map[string]interface{}, error)
- func RetrieveSecrets(client *api.Client, vaultCfg *Config) (map[string]interface{}, error)
- type Client
- type Config
- type GCPBackendConfig
- type SecretConfig
- type SecretConfigJSON
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddPrefixToVKVPath ¶
AddPrefixToVKVPath add data
func CastSecretDataToStringMap ¶
CastSecretDataToStringMap convert the secret data to map[string]interface{}
func GCPBackendLogin ¶
func GCPBackendLogin(client *Client, gcpBackendConfig *GCPBackendConfig, vaultConfig *Config) (string, error)
GCPBackendLogin Authenticate to Vault via GCP Backend
func GetKVConfig ¶
func GetKVConfig(client *api.Client, cfg *SecretConfig) error
GetKVConfig get mount path and is v2
func GetServiceAccountCreds ¶
func GetServiceAccountCreds(cfg *GCPBackendConfig) (*jwt.Config, error)
GetServiceAccountCreds read the service account json
func GetServiceAccountToken ¶
GetServiceAccountToken read Kubernetes service account token
func KubernetesBackendLogin ¶
KubernetesBackendLogin Authenticate to Vault via Kubernetes Backend
func RetrieveSecret ¶
func RetrieveSecret(client *api.Client, cfg *SecretConfig) (map[string]interface{}, error)
RetrieveSecret retrieve secrets from vault
Types ¶
type Client ¶
Client is a Vault client with Kubernetes support
func NewClientWithConfig ¶
func NewClientWithConfig(config *vaultapi.Config, vaultCfg *Config, gcpCfg *GCPBackendConfig) (*Client, error)
NewClientWithConfig create a new vault client
type Config ¶
type Config struct { Role string TokenPath string Backend string KubernetesBackend string SecretsConfigList []SecretConfig }
Config configuration for Vault
type GCPBackendConfig ¶
GCPBackendConfig parmaters for GCP backend login through Vault
type SecretConfig ¶
type SecretConfig struct { Path string // If Path ends with a / or contains * it will treat it as a wildcard path IsKVv2 bool MountPath string Version string // If passed, the value at the version number will be returned UseSecretNamesAsKeys bool }
SecretConfig holds secret config
type SecretConfigJSON ¶
type SecretConfigJSON struct { Path string `json:"path"` Version string `json:"version"` UseSecretNamesAsKeys string `json:"use-secret-names-as-keys"` }
SecretConfigJSON JSON struct for secret config