1
0
mirror of https://github.com/SAP/jenkins-library.git synced 2025-01-18 05:18:24 +02:00

fix: register base64 encoded secret (#3973)

fixes #3908
This commit is contained in:
Oliver Nocon 2022-08-16 17:52:20 +02:00 committed by GitHub
parent 3da753930c
commit 85b277c7c6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -283,6 +283,8 @@ func populateCredentialsAsEnvs(config *StepConfig, secret map[string]string, key
envVariable := vaultCredentialEnvPrefix + convertEnvVar(secretKey)
log.Entry().Debugf("Exposing general purpose credential '%v' as '%v'", key, envVariable)
os.Setenv(envVariable, secretValue)
log.RegisterSecret(piperutils.EncodeString(secretValue))
envVariable = vaultCredentialEnvPrefix + convertEnvVar(secretKey) + "_BASE64"
log.Entry().Debugf("Exposing general purpose base64 encoded credential '%v' as '%v'", key, envVariable)
os.Setenv(envVariable, piperutils.EncodeString(secretValue))
@ -301,6 +303,8 @@ func populateCredentialsAsEnvs(config *StepConfig, secret map[string]string, key
envVariable := vaultCredentialEnvPrefixDefault + convertEnvVar(secretKey)
log.Entry().Debugf("Exposing general purpose credential '%v' as '%v'", key, envVariable)
os.Setenv(envVariable, secretValue)
log.RegisterSecret(piperutils.EncodeString(secretValue))
envVariable = vaultCredentialEnvPrefixDefault + convertEnvVar(secretKey) + "_BASE64"
log.Entry().Debugf("Exposing general purpose base64 encoded credential '%v' as '%v'", key, envVariable)
os.Setenv(envVariable, piperutils.EncodeString(secretValue))