Documentation ¶
Index ¶
Constants ¶
const ( AwsAccessKeyId = "AWS_ACCESS_KEY_ID" AwsSecretAccessKey = "AWS_SECRET_ACCESS_KEY" )
Amazon keys
const ( AzureClientId = "AZURE_CLIENT_ID" AzureClientSecret = "AZURE_CLIENT_SECRET" AzureTenantId = "AZURE_TENANT_ID" AzureSubscriptionId = "AZURE_SUBSCRIPTION_ID" )
Azure keys
const ( Type = "type" ProjectId = "project_id" PrivateKeyId = "private_key_id" PrivateKey = "private_key" ClientEmail = "client_email" ClientId = "client_id" AuthUri = "auth_uri" TokenUri = "token_uri" AuthX509Url = "auth_provider_x509_cert_url" ClientX509Url = "client_x509_cert_url" )
Google keys
const ( RepoName = "RepoName" RepoSecret = "RepoSecret" )
Repo keys
const (
General = "GENERAL_SECRET"
)
Validated secret types
const (
K8SConfig = "K8Sconfig"
)
Kubernetes keys
const RepoSecretType = "repo"
RepoSecretType marks secrets as of type "repo"
Variables ¶
var DefaultRules = map[string][]string{ btypes.Amazon: { AwsAccessKeyId, AwsSecretAccessKey, }, btypes.Azure: { AzureClientId, AzureClientSecret, AzureTenantId, AzureSubscriptionId, }, btypes.Google: { Type, ProjectId, PrivateKeyId, PrivateKey, ClientEmail, ClientId, AuthUri, TokenUri, AuthX509Url, ClientX509Url, }, btypes.Kubernetes: { K8SConfig, }, RepoSecretType: { RepoName, RepoSecret, }, }
DefaultRules key matching for types
var Store *secretStore
Store object that wraps up vault logical store
Functions ¶
Types ¶
type AllowedFilteredSecretTypesResponse ¶
type AllowedFilteredSecretTypesResponse struct {
Keys []string `json:"keys"`
}
AllowedFilteredSecretTypesResponse for API response for AllowedSecretTypes/:type
type AllowedSecretTypesResponse ¶
AllowedSecretTypesResponse for API response for AllowedSecretTypes
type CreateSecretRequest ¶
type CreateSecretRequest struct { Name string `json:"name" binding:"required"` SecretType string `json:"type" binding:"required"` Values map[string]string `json:"values" binding:"required"` }
CreateSecretRequest param for Store.Store
func (*CreateSecretRequest) Validate ¶
func (c *CreateSecretRequest) Validate() error
Validate SecretRequest
type CreateSecretResponse ¶
type CreateSecretResponse struct { Name string `json:"name" binding:"required"` SecretType string `json:"type" binding:"required"` SecretID string `json:"secret_id"` }
CreateSecretResponse API response for AddSecrets
type ListSecretsResponse ¶
type ListSecretsResponse struct {
Secrets []SecretsItemResponse `json:"secrets"`
}
ListSecretsResponse for API response for ListSecrets
type MissmatchError ¶
MissmatchError describe a secret error where the given and expected secret type is not equal
func (MissmatchError) Error ¶
func (m MissmatchError) Error() string
type SecretsItemResponse ¶
type SecretsItemResponse struct { ID string `json:"id"` Name string `json:"name"` SecretType string `json:"type"` Values map[string]string `json:"-"` }
SecretsItemResponse for GetSecret (no API endpoint for this!)
func (*SecretsItemResponse) GetValue ¶
func (s *SecretsItemResponse) GetValue(key string) string
GetValue returns the value under key
func (*SecretsItemResponse) ValidateSecretType ¶
func (s *SecretsItemResponse) ValidateSecretType(validType string) error
ValidateSecretType validates the secret type