Skip to content

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

improvement(pam): trim approval configuration response to approver steps

bernie-g272c95af5a46
diff --git a/backend/src/ee/routes/v1/pam-routers/pam-approval-configuration-router.ts b/backend/src/ee/routes/v1/pam-routers/pam-approval-configuration-router.ts
index fbb0459bca..c71f8d5e89 100644
--- a/backend/src/ee/routes/v1/pam-routers/pam-approval-configuration-router.ts
+++ b/backend/src/ee/routes/v1/pam-routers/pam-approval-configuration-router.ts
@@ -26,18 +26,9 @@ export const registerPamApprovalConfigurationRouter = async (server: FastifyZodP
}),
response: {
200: z.object({
- policy: z
- .object({
- id: z.string().uuid(),
- name: z.string()
- })
- .nullable(),
steps: z.array(
z.object({
- requiredApprovals: z.number(),
- approvers: z.array(ApproverSchema),
- name: z.string().nullish(),
- notifyApprovers: z.boolean().nullish()
+ approvers: z.array(ApproverSchema)
})
)
})
diff --git a/backend/src/ee/services/pam-access-request/pam-access-request-service.ts b/backend/src/ee/services/pam-access-request/pam-access-request-service.ts
index 4e8cccda6f..6fa12efcda 100644
--- a/backend/src/ee/services/pam-access-request/pam-access-request-service.ts
+++ b/backend/src/ee/services/pam-access-request/pam-access-request-service.ts
@@ -279,11 +279,12 @@ export const pamAccessRequestServiceFactory = ({
const policy = await findFolderPolicy(folderId);
if (!policy) {
- return { policy: null, steps: [] };
+ return { steps: [] };
}
+ // The policy row and step tuning fields are internal; the UI only needs the approver lists.
const steps = await approvalPolicyDAL.findStepsByPolicyId(policy.id);
- return { policy, steps };
+ return { steps: steps.map((s) => ({ approvers: s.approvers })) };
};
const setApprovalConfiguration = async ({ folderId, projectId, steps, ...ctx }: TSetApprovalConfigurationDTO) => {
diff --git a/frontend/src/hooks/api/pam/types/index.ts b/frontend/src/hooks/api/pam/types/index.ts
index 89e8118314..496cbb1d46 100644
--- a/frontend/src/hooks/api/pam/types/index.ts
+++ b/frontend/src/hooks/api/pam/types/index.ts
@@ -502,12 +502,8 @@ export type TPamAccessRequest = {
};
export type TPamApprovalConfig = {
- policy: { id: string; name: string } | null;
steps: {
- requiredApprovals: number;
approvers: { type: PamApproverType; id: string }[];
- name?: string | null;
- notifyApprovers?: boolean | null;
}[];
};