Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrNotSupportedSecret = errors.New("secret type is required")
ErrNotSupportedSecret an error which is occurred if the type of secreter is missing
var ErrSecretKeyMissing = errors.New("secret key is required")
ErrSecretKeyMissing an error which is occurred if the type of secret key for encrytpion is missing
var ErrVaultHostMissing = errors.New("vault host is required")
ErrVaultHostMissing an error which is occurred if the vault is enabled and the Vault host is missing
var ErrVaultTokenMissing = errors.New("vault token is required")
ErrVaultTokenMissing an error which is occurred if the vault is enabled and the Vault token is missing
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { SecretType SecretType SecretKey string VaultConfig VaultConfig }
Config config for secreter
type Options ¶
type Options struct { // Used only for vault Key string // Plaintext used for encrypt Plaintext string // CipherText used for decrypt CipherText string }
Options for encrypt/decrypt
type SecretType ¶
type SecretType int
SecretType the type of the encryption secrets will be stored
const ( // LocalSecret encryption with base64 LocalSecret SecretType = iota // VaultSecret secrets with hashicorp Vault VaultSecret // DebugSecret secrets just plain DebugSecret )
func (SecretType) String ¶
func (s SecretType) String() string
type Secreter ¶
type Secreter interface { Encrypt(opts Options) (string, error) Decrypt(opts Options) (string, error) Type() SecretType }
Secreter contract for secret providers
type VaultConfig ¶
VaultConfig it is used in order to be able to interact with transit engine of vault. Token is the one which is needed in order to interact with Vault API