fix: correct secret reference value replacement to support special characters

This commit is contained in:
Scott Wilson
2024-11-11 13:46:39 -08:00
parent 8cfcbaa12c
commit 14810de054
@@ -444,6 +444,7 @@ export const expandSecretReferencesFactory = ({
// eslint-disable-next-line no-continue // eslint-disable-next-line no-continue
if (depth > MAX_SECRET_REFERENCE_DEPTH) continue; if (depth > MAX_SECRET_REFERENCE_DEPTH) continue;
const refs = value?.match(INTERPOLATION_SYNTAX_REG); const refs = value?.match(INTERPOLATION_SYNTAX_REG);
console.log("refs", refs);
if (refs) { if (refs) {
for (const interpolationSyntax of refs) { for (const interpolationSyntax of refs) {
@@ -518,7 +519,10 @@ export const expandSecretReferencesFactory = ({
} }
if (referencedSecretValue) { if (referencedSecretValue) {
expandedValue = expandedValue.replaceAll(interpolationSyntax, referencedSecretValue); expandedValue = expandedValue.replaceAll(
interpolationSyntax,
() => referencedSecretValue // prevents special characters from triggering replacement patterns
);
} }
} }
} }