Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.
TypeScript acmeagentsai-agentscertificate-managementdevsecopsenvironment-variableskubernetesopen-sourcepampkipostgresprivate-caprivileged-access-managementsecret-managementsecret-managersecretssecrets-managementsecuritysecurity-toolsvault
enhancement: check if the revoke grant is not removing a secret grant (endpoint called by PKI)
adilson05b427697abd
diff --git a/backend/src/db/migrations/20260930100809_additional-privileges-grant-id.ts b/backend/src/db/migrations/20260930100809_additional-privileges-grant-id.tsindex 319c49cdda..948d86910e 100644--- a/backend/src/db/migrations/20260930100809_additional-privileges-grant-id.ts+++ b/backend/src/db/migrations/20260930100809_additional-privileges-grant-id.ts@@ -16,11 +16,10 @@ export async function up(knex: Knex): Promise<void> {}export async function down(knex: Knex): Promise<void> {- await knex.raw(`DROP INDEX IF EXISTS "${GRANT_ID_UNIQUE_INDEX}"`);-const hasColumn = await knex.schema.hasColumn(TableName.AdditionalPrivilege, "grantId");if (hasColumn) {await knex.schema.alterTable(TableName.AdditionalPrivilege, (t) => {+ t.dropUnique(["grantId"], GRANT_ID_UNIQUE_INDEX);t.dropForeign("grantId");t.dropColumn("grantId");});diff --git a/backend/src/services/approval-policy/approval-policy-service.ts b/backend/src/services/approval-policy/approval-policy-service.tsindex ec8f9f00e9..cc336b4562 100644--- a/backend/src/services/approval-policy/approval-policy-service.ts+++ b/backend/src/services/approval-policy/approval-policy-service.ts@@ -1875,6 +1875,12 @@ export const approvalPolicyServiceFactory = ({}}+ if (grantPolicyType === ApprovalPolicyType.SecretAccess) {+ throw new BadRequestError({+ message: "This grant is for a secret access request. Revoke it from the access request instead."+ });+ }+if (grant.status !== ApprovalRequestGrantStatus.Active) {throw new BadRequestError({ message: "Grant is not active" });}