Documentation ¶
Index ¶
Constants ¶
View Source
const DefaultPipelineAllowList = ".*"
DefaultPipelineAllowList is the regular expression that allows any pipeline to decrypt a secret
View Source
const SecretEnvelopeRegex = `estafette\.secret\(([a-zA-Z0-9.=_-]+)\)`
SecretEnvelopeRegex is the regular expression to match an estafette secret envelope
Variables ¶
View Source
var ( // ErrRestrictedSecret is thrown if a restricted secret for another pipeline is encountered ErrRestrictedSecret = errors.New("This secret is restricted to another pipeline") )
Functions ¶
This section is empty.
Types ¶
type SecretHelper ¶
type SecretHelper interface { Encrypt(unencryptedText, pipelineAllowList string) (encryptedTextPlusNonce string, err error) Decrypt(encryptedTextPlusNonce, pipeline string) (decryptedText, pipelineAllowList string, err error) EncryptEnvelope(unencryptedText, pipelineAllowList string) (encryptedTextInEnvelope string, err error) DecryptEnvelope(encryptedTextInEnvelope, pipeline string) (decryptedText, pipelineAllowList string, err error) DecryptAllEnvelopes(encryptedTextWithEnvelopes, pipeline string) (decryptedText string, err error) ReencryptAllEnvelopes(encryptedTextWithEnvelopes, pipeline string, base64encodedKey bool) (reencryptedText string, key string, err error) GenerateKey(numberOfBytes int, base64encodedKey bool) (key string, err error) GetAllSecretEnvelopes(input string) (envelopes []string, err error) GetAllSecrets(input string) (secrets []string, err error) GetAllSecretValues(input, pipeline string) (values []string, err error) GetInvalidRestrictedSecrets(input, pipeline string) (invalidSecrets []string, err error) }
SecretHelper is the interface for encrypting and decrypting secrets
func NewSecretHelper ¶
func NewSecretHelper(key string, base64encodedKey bool) SecretHelper
NewSecretHelper returns a new SecretHelper
Click to show internal directories.
Click to hide internal directories.