Skip to content

Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.

fix: addressed nits

Daniel Hougaard1221c426d9d7
diff --git a/backend/src/services/app-connection/azure-entra-id/azure-entra-id-connection-service.ts b/backend/src/services/app-connection/azure-entra-id/azure-entra-id-connection-service.ts
index b9e15720fd..3d6affcb1a 100644
--- a/backend/src/services/app-connection/azure-entra-id/azure-entra-id-connection-service.ts
+++ b/backend/src/services/app-connection/azure-entra-id/azure-entra-id-connection-service.ts
@@ -57,7 +57,8 @@ export const azureEntraIdConnectionService = (
let url = `https://graph.microsoft.com/v1.0/servicePrincipals?$top=${SCIM_SERVICE_PRINCIPALS_LIMIT}&$select=id,displayName,appId`;
if (search) {
- const sanitizedSearch = search.replace(new RE2(/[^a-zA-Z0-9 -]/g), "");
+ const re2Pattern = new RE2(/[^a-zA-Z0-9 -]/g);
+ const sanitizedSearch = re2Pattern.replace(search, "");
if (sanitizedSearch) {
url += `&$filter=startswith(displayName,'${sanitizedSearch}')`;
}
diff --git a/backend/src/services/secret-sync/azure-entra-id-scim/azure-entra-id-scim-sync-fns.ts b/backend/src/services/secret-sync/azure-entra-id-scim/azure-entra-id-scim-sync-fns.ts
index 8b5d6e546c..1c89fca908 100644
--- a/backend/src/services/secret-sync/azure-entra-id-scim/azure-entra-id-scim-sync-fns.ts
+++ b/backend/src/services/secret-sync/azure-entra-id-scim/azure-entra-id-scim-sync-fns.ts
@@ -26,10 +26,18 @@ export const AzureEntraIdScimSyncFns = {
const { servicePrincipalId } = secretSync.destinationConfig;
const { secretId } = secretSync.syncOptions;
+ if (!secretId) {
+ throw new SecretSyncError({
+ error: new Error("No secret is configured for this SCIM token sync. Please reconfigure syncOptions.secretKey."),
+ shouldRetry: false
+ });
+ }
+
const secretEntry = Object.entries(secretMap).find(([, s]) => s.id === secretId);
if (!secretEntry) {
throw new SecretSyncError({
- error: new Error(`Secret with ID "${secretId}" not found in source`)
+ error: new Error(`Secret with ID "${secretId}" not found in source`),
+ shouldRetry: false
});
}
const [, secret] = secretEntry;
@@ -79,7 +87,7 @@ export const azureEntraIdScimPreSaveTransformSyncOptions: TPreSaveTransformSyncO
message: `Secret with key "${secretKey as string}" not found in the specified source folder`
});
}
- return { ...rest, secretId: secret.id };
+ return { ...existingSyncOptions, ...rest, secretId: secret.id };
}
// If no new secretKey provided, preserve the existing secretId and validate it still exists in the (possibly new) folder
@@ -92,7 +100,7 @@ export const azureEntraIdScimPreSaveTransformSyncOptions: TPreSaveTransformSyncO
"The previously configured secret no longer exists in the source folder. Please re-specify syncOptions.secretKey."
});
}
- return { ...syncOptions, secretId: existingSecretId };
+ return { ...existingSyncOptions, ...syncOptions, secretId: existingSecretId };
}
return syncOptions;