Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.
TypeScript acmeagentsai-agentscertificate-managementdevsecopsenvironment-variableskubernetesopen-sourcepampkipostgresprivate-caprivileged-access-managementsecret-managementsecret-managersecretssecrets-managementsecuritysecurity-toolsvault
updated texts and comments
Maidul Islamc6352cc97092
diff --git a/backend/src/services/secret/secret-fns.ts b/backend/src/services/secret/secret-fns.tsindex 32860e38cb..007f8cb9e1 100644--- a/backend/src/services/secret/secret-fns.ts+++ b/backend/src/services/secret/secret-fns.ts@@ -396,13 +396,34 @@ export const decryptSecretRaw = (};};-export const getAllNestedSecretReferences = (value: string) => {- const references = Array.from(value.matchAll(INTERPOLATION_SYNTAX_REG), (m) => m[1]);+/**+ * Grabs and processes nested secret references from a string+ *+ * This function looks for patterns that match the interpolation syntax in the input string.+ * It filters out references that include nested paths, splits them into environment and+ * secret path parts, and then returns an array of objects with the environment and the+ * joined secret path.+ *+ * @param {string} maybeSecretReference - The string that has the potential secret references.+ * @returns {Array<{ environment: string, secretPath: string }>} - An array of objects+ * with the environment and joined secret path.+ *+ * @example+ * const value = "Hello ${dev.someFolder.OtherFolder.SECRET_NAME} and ${prod.anotherFolder.SECRET_NAME}";+ * const result = getAllNestedSecretReferences(value);+ * // result will be:+ * // [+ * // { environment: 'dev', secretPath: '/someFolder/OtherFolder' },+ * // { environment: 'prod', secretPath: '/anotherFolder' }+ * // ]+ */+export const getAllNestedSecretReferences = (maybeSecretReference: string) => {+ const references = Array.from(maybeSecretReference.matchAll(INTERPOLATION_SYNTAX_REG), (m) => m[1]);return references.filter((el) => el.includes(".")).map((el) => {- const [environment, ...secretPath] = el.split(".");- return { environment, secretPath: path.join("/", ...secretPath.slice(0, -1)) };+ const [environment, ...secretPathList] = el.split(".");+ return { environment, secretPath: path.join("/", ...secretPathList.slice(0, -1)) };});};diff --git a/backend/src/services/secret/secret-service.ts b/backend/src/services/secret/secret-service.tsindex 37baa5ad4c..aa5867c4a3 100644--- a/backend/src/services/secret/secret-service.ts+++ b/backend/src/services/secret/secret-service.ts@@ -1562,10 +1562,12 @@ export const secretServiceFactory = ({actorOrgId);- if (!hasRole(ProjectMembershipRole.Admin)) throw new BadRequestError({ message: "Only admins are allowed" });+ if (!hasRole(ProjectMembershipRole.Admin))+ throw new BadRequestError({ message: "Only admins are allowed to take this action" });const botKey = await projectBotService.getBotKey(projectId);- if (!botKey) throw new BadRequestError({ message: "Kindly upgrade your project", name: "bot_not_found_error" });+ if (!botKey)+ throw new BadRequestError({ message: "Please upgrade your project first", name: "bot_not_found_error" });await secretDAL.transaction(async (tx) => {const secrets = await secretDAL.findAllProjectSecretValues(projectId, tx);@@ -1584,7 +1586,7 @@ export const secretServiceFactory = ({);});- return { message: "Successfully backfilled secret references." };+ return { message: "Successfully backfilled secret references" };};return {diff --git a/frontend/src/views/Settings/ProjectSettingsPage/components/BackfillSecretReferenceSection/BackfillSecretReferenceSection.tsx b/frontend/src/views/Settings/ProjectSettingsPage/components/BackfillSecretReferenceSection/BackfillSecretReferenceSection.tsxindex 6aca7e36e7..84faa0d1f1 100644--- a/frontend/src/views/Settings/ProjectSettingsPage/components/BackfillSecretReferenceSection/BackfillSecretReferenceSection.tsx+++ b/frontend/src/views/Settings/ProjectSettingsPage/components/BackfillSecretReferenceSection/BackfillSecretReferenceSection.tsx@@ -25,11 +25,10 @@ export const BackfillSecretReferenceSecretion = () => {return (<div className="mb-6 rounded-lg border border-mineshaft-600 bg-mineshaft-900 p-4"><div className="flex w-full items-center justify-between">- <p className="text-xl font-semibold">Resync Secret References</p>+ <p className="text-xl font-semibold">Sync Secret References</p></div><p className="mb-4 mt-2 max-w-2xl text-sm text-gray-400">- Trigger this to reindex all your inline secret references to map integration- synchronization.+ This will index all secret references, enabling integrations to be triggered when their values change going forward.</p><Buttonvariant="outline_bg"