mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-08 08:27:53 +00:00
fix: correct secret reference value replacement to support special characters
This commit is contained in:
@@ -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
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user