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
pam: allow account credentials to be fetched more than once
x03220539aa338ce51e
diff --git a/backend/src/ee/services/pam-account/pam-account-service.ts b/backend/src/ee/services/pam-account/pam-account-service.tsindex 8c93fbfaf2..21389f6c0a 100644--- a/backend/src/ee/services/pam-account/pam-account-service.ts+++ b/backend/src/ee/services/pam-account/pam-account-service.ts@@ -668,11 +668,6 @@ export const pamAccountServiceFactory = ({throw new BadRequestError({ message: "Session has ended or expired" });}- // Verify that the session has not already had credentials fetched- if (session.status !== PamSessionStatus.Starting) {- throw new BadRequestError({ message: "Session has already been started" });- }-const account = await pamAccountDAL.findById(session.accountId);if (!account) throw new NotFoundError({ message: `Account with ID '${session.accountId}' not found` });@@ -690,10 +685,12 @@ export const pamAccountServiceFactory = ({const decryptedResource = await decryptResource(resource, session.projectId, kmsService);// Mark session as started- await pamSessionDAL.updateById(sessionId, {- status: PamSessionStatus.Active,- startedAt: new Date()- });+ if (session.status === PamSessionStatus.Starting) {+ await pamSessionDAL.updateById(sessionId, {+ status: PamSessionStatus.Active,+ startedAt: new Date()+ });+ }return {credentials: {