Skip to content

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

checkpoint

Daniel Hougaarddc672cb405ab
diff --git a/backend/src/services/app-connection/azure-entra-id/azure-entra-id-connection-fns.ts b/backend/src/services/app-connection/azure-entra-id/azure-entra-id-connection-fns.ts
index 1b6445b0cf..e1e467c80e 100644
--- a/backend/src/services/app-connection/azure-entra-id/azure-entra-id-connection-fns.ts
+++ b/backend/src/services/app-connection/azure-entra-id/azure-entra-id-connection-fns.ts
@@ -95,6 +95,28 @@ export const getAzureEntraIdConnectionListItem = () => {
};
};
+export const graphApiRequest = async <T>(
+ url: string,
+ headers: Record<string, string>,
+ description: string
+): Promise<T> => {
+ try {
+ const { data } = await request.get<T>(url, { headers });
+ return data;
+ } catch (err: unknown) {
+ if (err instanceof AxiosError) {
+ throw new BadRequestError({
+ message: `Failed to ${description}: ${
+ (err.response?.data as { error?: { message?: string } })?.error?.message || err.message
+ }`
+ });
+ }
+ throw new BadRequestError({
+ message: `Failed to ${description}`
+ });
+ }
+};
+
export const validateAzureEntraIdConnectionCredentials = async (config: TAzureEntraIdConnectionConfig) => {
const { credentials: inputCredentials, method } = config;
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 3d6affcb1a..598439ca51 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
@@ -1,13 +1,12 @@
import RE2 from "re2";
-import { request } from "@app/lib/config/request";
import { OrgServiceActor } from "@app/lib/types";
import { TAppConnectionDALFactory } from "@app/services/app-connection/app-connection-dal";
import { AppConnection } from "@app/services/app-connection/app-connection-enums";
import { TAppConnection } from "@app/services/app-connection/app-connection-types";
import { TKmsServiceFactory } from "@app/services/kms/kms-service";
-import { getAzureEntraIdConnectionAccessToken } from "./azure-entra-id-connection-fns";
+import { getAzureEntraIdConnectionAccessToken, graphApiRequest } from "./azure-entra-id-connection-fns";
type TGetAppConnectionFunc = (
app: AppConnection,
@@ -64,17 +63,21 @@ export const azureEntraIdConnectionService = (
}
}
- const { data }: { data: TAzureServicePrincipalsResponse } = await request.get(url, { headers });
+ const data = await graphApiRequest<TAzureServicePrincipalsResponse>(
+ url,
+ headers,
+ "list service principals from Microsoft Graph"
+ );
// Filter to only those with SCIM synchronization jobs
const scimServicePrincipals: { id: string; displayName: string; appId: string }[] = [];
- for (const sp of data.value) {
+ const checkScimServicePrincipal = async (sp: TAzureServicePrincipal) => {
try {
- // eslint-disable-next-line no-await-in-loop
- const { data: jobsData } = await request.get<TAzureSyncJobsResponse>(
+ const jobsData = await graphApiRequest<TAzureSyncJobsResponse>(
`https://graph.microsoft.com/v1.0/servicePrincipals/${sp.id}/synchronization/jobs`,
- { headers }
+ headers,
+ `fetch synchronization jobs for service principal '${sp.displayName}'`
);
const hasScimJob = jobsData.value.some((job) => job.templateId?.toLowerCase().includes("scim"));
@@ -89,7 +92,9 @@ export const azureEntraIdConnectionService = (
} catch {
// SP doesn't have synchronization configured, skip
}
- }
+ };
+
+ await Promise.all(data.value.map(checkScimServicePrincipal));
return scimServicePrincipals;
};
diff --git a/docs/api-reference/endpoints/secret-syncs/azure-entra-id-scim/import-secrets.mdx b/docs/api-reference/endpoints/secret-syncs/azure-entra-id-scim/import-secrets.mdx
deleted file mode 100644
index 2d86a7f453..0000000000
--- a/docs/api-reference/endpoints/secret-syncs/azure-entra-id-scim/import-secrets.mdx
+++ /dev/null
@@ -1,4 +0,0 @@
----
-title: "Import Secrets"
-openapi: "POST /api/v1/secret-syncs/azure-entra-id-scim/{syncId}/import-secrets"
----
diff --git a/docs/api-reference/endpoints/secret-syncs/azure-entra-id-scim/remove-secrets.mdx b/docs/api-reference/endpoints/secret-syncs/azure-entra-id-scim/remove-secrets.mdx
deleted file mode 100644
index 82efab88d7..0000000000
--- a/docs/api-reference/endpoints/secret-syncs/azure-entra-id-scim/remove-secrets.mdx
+++ /dev/null
@@ -1,4 +0,0 @@
----
-title: "Remove Secrets"
-openapi: "POST /api/v1/secret-syncs/azure-entra-id-scim/{syncId}/remove-secrets"
----
diff --git a/frontend/src/components/secret-syncs/forms/AzureEntraIdScimSyncSourceFields.tsx b/frontend/src/components/secret-syncs/forms/AzureEntraIdScimSyncSourceFields.tsx
index 5fe18ad4b8..7f68072d07 100644
--- a/frontend/src/components/secret-syncs/forms/AzureEntraIdScimSyncSourceFields.tsx
+++ b/frontend/src/components/secret-syncs/forms/AzureEntraIdScimSyncSourceFields.tsx
@@ -112,6 +112,7 @@ export const AzureEntraIdScimSyncSourceFields = () => {
control={control}
render={({ field: { value, onChange }, fieldState: { error } }) => (
<FormControl
+ isRequired
isError={Boolean(error)}
errorText={error?.message}
label="Secret"
diff --git a/frontend/src/components/secret-syncs/forms/schemas/azure-entra-id-scim-sync-destination-schema.ts b/frontend/src/components/secret-syncs/forms/schemas/azure-entra-id-scim-sync-destination-schema.ts
index 98f1f67668..7b5310c280 100644
--- a/frontend/src/components/secret-syncs/forms/schemas/azure-entra-id-scim-sync-destination-schema.ts
+++ b/frontend/src/components/secret-syncs/forms/schemas/azure-entra-id-scim-sync-destination-schema.ts
@@ -5,7 +5,7 @@ import { SecretSync } from "@app/hooks/api/secretSyncs";
export const AzureEntraIdScimSyncDestinationSchema = BaseSecretSyncSchema(
z.object({
- secretKey: z.string().optional()
+ secretKey: z.string().trim().min(1, "Secret key is required")
})
).merge(
z.object({