secret

package
v0.0.0-...-ada06ba Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AwsAccessKeyId     = "AWS_ACCESS_KEY_ID"
	AwsSecretAccessKey = "AWS_SECRET_ACCESS_KEY"
)

Amazon keys

View Source
const (
	AzureClientId       = "AZURE_CLIENT_ID"
	AzureClientSecret   = "AZURE_CLIENT_SECRET"
	AzureTenantId       = "AZURE_TENANT_ID"
	AzureSubscriptionId = "AZURE_SUBSCRIPTION_ID"
)

Azure keys

View Source
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

View Source
const (
	RepoName   = "RepoName"
	RepoSecret = "RepoSecret"
)

Repo keys

View Source
const (
	General = "GENERAL_SECRET"
)

Validated secret types

View Source
const (
	K8SConfig = "K8Sconfig"
)

Kubernetes keys

View Source
const RepoSecretType = "repo"

RepoSecretType marks secrets as of type "repo"

Variables

DefaultRules key matching for types

View Source
var Store *secretStore

Store object that wraps up vault logical store

Functions

func GenerateSecretID

func GenerateSecretID() string

GenerateSecretID uuid for new secrets

Types

type AllowedFilteredSecretTypesResponse

type AllowedFilteredSecretTypesResponse struct {
	Keys []string `json:"keys"`
}

AllowedFilteredSecretTypesResponse for API response for AllowedSecretTypes/:type

type AllowedSecretTypesResponse

type AllowedSecretTypesResponse struct {
	Allowed map[string][]string `json:"allowed"`
}

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

type MissmatchError struct {
	Err        error
	SecretType string
	ValidType  string
}

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

Jump to

Keyboard shortcuts

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