Skip to content

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

accept groups with empty users

adilson912f3673fd6d
diff --git a/backend/src/db/migrations/utils/secret-approval-migration-scenarios.test.ts b/backend/src/db/migrations/utils/secret-approval-migration-scenarios.test.ts
index 89479780f8..1038720cc2 100644
--- a/backend/src/db/migrations/utils/secret-approval-migration-scenarios.test.ts
+++ b/backend/src/db/migrations/utils/secret-approval-migration-scenarios.test.ts
@@ -301,6 +301,14 @@ describe("secret approval migration scenarios that migrate", () => {
expect(rows.requests[0]).toMatchObject({ requesterName: "[email protected]", requesterEmail: "" });
});
+
+ test("a policy whose only approver group has no members migrates with that group as its approver", () => {
+ const { failures, rows } = run(scenario({ approvers: [groupApprover("g1")] }));
+
+ expect(failures).toEqual([]);
+ expect(rows.policySteps).toMatchObject([{ policyId: "pol-1", stepNumber: 1, requiredApprovals: 1 }]);
+ expect(rows.policyStepApprovers).toEqual([{ policyStepId: rows.policySteps[0].id, userId: null, groupId: "g1" }]);
+ });
});
describe("secret approval migration scenarios that fail the checks", () => {