decrypter

package
v0.0.0-...-0666c2b Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// AWSKMSSecretPrefix is the secret prefix for secrets which can be
	// descrypted by the awsKMS decrypter.
	AWSKMSSecretPrefix = "aws:kms:"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Decrypter

type Decrypter interface {
	Decrypt(secret string) (string, error)
}

Decrypter is an interface describing any type of secret decrypter which given an ecrypted secret can return the decrypted plaintext value.

func NewAWSKMSDescrypter

func NewAWSKMSDescrypter(sess *session.Session) Decrypter

NewAWSKMSDescrypter initializes a new awsKMS based Decrypter.

type SecretDecrypter

type SecretDecrypter map[string]Decrypter

SecretDecrypter is a map of decrypters.

func (SecretDecrypter) Decrypt

func (s SecretDecrypter) Decrypt(secret string) (string, error)

Decrypt tries to find the right decrypter for the secret based on the secret prefix e.g. 'aws:kms:'. If the decrypter is found it will attempt to decrypt the secret and return it in plaintext.

Jump to

Keyboard shortcuts

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