Skip to content

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

add a check on approval type also on the get by id

adilson94d57e475b31
diff --git a/backend/src/services/approval-policy/approval-policy-service.ts b/backend/src/services/approval-policy/approval-policy-service.ts
index e57a0c1d3b..9e732d0dfd 100644
--- a/backend/src/services/approval-policy/approval-policy-service.ts
+++ b/backend/src/services/approval-policy/approval-policy-service.ts
@@ -773,6 +773,12 @@ export const approvalPolicyServiceFactory = ({
policy.type as ApprovalPolicyType
);
+ if (policy.type === ApprovalPolicyType.SecretAccess) {
+ throw new BadRequestError({
+ message: "This is a secret access policy. Update it from the access approval policies instead."
+ });
+ }
+
const [steps, bypassers] = await Promise.all([
approvalPolicyDAL.findStepsByPolicyId(policyId),
approvalPolicyDAL.findBypassersByPolicyId(policyId)