Skip to content

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

add check on approval policy

adilson817739650a86
diff --git a/backend/src/services/approval-policy/approval-policy-service.ts b/backend/src/services/approval-policy/approval-policy-service.ts
index 5596cc164d..e57a0c1d3b 100644
--- a/backend/src/services/approval-policy/approval-policy-service.ts
+++ b/backend/src/services/approval-policy/approval-policy-service.ts
@@ -812,6 +812,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."
+ });
+ }
+
if (
!resources[policy.type as ApprovalPolicyType]?.isBreakGlassEligible &&
(enforcementLevel === EnforcementLevel.Soft || (bypassers && bypassers.length > 0))
@@ -1693,6 +1699,12 @@ export const approvalPolicyServiceFactory = ({
throw new ForbiddenRequestError({ message: "You are not the requester of this request" });
}
+ if (request.type === ApprovalPolicyType.SecretAccess) {
+ throw new BadRequestError({
+ message: "This is a secret access request. Manage it from the access requests instead."
+ });
+ }
+
const [updatedRequest] = await approvalRequestDAL.update(
{ id: requestId, status: ApprovalRequestStatus.Pending },
{ status: ApprovalRequestStatus.Cancelled }