Skip to content

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

fix: support enrollment-flow gateways in PAM session checks

bernie-g6b35765bfba8
diff --git a/backend/src/ee/services/pam-session/pam-session-schemas.ts b/backend/src/ee/services/pam-session/pam-session-schemas.ts
index 8174aafb7a..c2e397494f 100644
--- a/backend/src/ee/services/pam-session/pam-session-schemas.ts
+++ b/backend/src/ee/services/pam-session/pam-session-schemas.ts
@@ -60,6 +60,7 @@ export const SanitizedSessionSchema = PamSessionsSchema.omit({
}).extend({
logs: z.array(z.union([PamSessionCommandLogSchema, HttpEventSchema, TerminalEventSchema])),
gatewayIdentityId: z.string().nullable().optional(),
+ gatewayId: z.string().nullable().optional(),
aiInsights: AiInsightsSchema
});
diff --git a/backend/src/ee/services/pam-session/pam-session-service.ts b/backend/src/ee/services/pam-session/pam-session-service.ts
index f553293700..8cbf5e78a1 100644
--- a/backend/src/ee/services/pam-session/pam-session-service.ts
+++ b/backend/src/ee/services/pam-session/pam-session-service.ts
@@ -57,13 +57,14 @@ export const pamSessionServiceFactory = ({
status: string;
expiresAt: Date | null;
gatewayIdentityId?: string | null;
+ gatewayId?: string | null;
projectId?: string | null;
}
>(
session: T
): Promise<T> => {
// Skip gateway-based sessions - they have their own lifecycle managed by the gateway
- if (session.gatewayIdentityId) {
+ if (session.gatewayIdentityId || session.gatewayId) {
return session;
}
diff --git a/frontend/src/hooks/api/pam/types/index.ts b/frontend/src/hooks/api/pam/types/index.ts
index 70968d91fc..e1b9948435 100644
--- a/frontend/src/hooks/api/pam/types/index.ts
+++ b/frontend/src/hooks/api/pam/types/index.ts
@@ -128,6 +128,7 @@ export type TPamSession = {
updatedAt: string;
logs: TPamSessionLog[];
gatewayIdentityId?: string | null;
+ gatewayId?: string | null;
aiInsightsStatus?: string | null;
aiInsightsError?: string | null;
aiInsights?: TPamSessionAiInsights | null;
diff --git a/frontend/src/pages/pam/PamSessionsByIDPage/PamSessionByIDPage.tsx b/frontend/src/pages/pam/PamSessionsByIDPage/PamSessionByIDPage.tsx
index f5506848d8..9022d70e24 100644
--- a/frontend/src/pages/pam/PamSessionsByIDPage/PamSessionByIDPage.tsx
+++ b/frontend/src/pages/pam/PamSessionsByIDPage/PamSessionByIDPage.tsx
@@ -59,7 +59,7 @@ const Page = () => {
const isActive =
session?.status === PamSessionStatus.Active || session?.status === PamSessionStatus.Starting;
- const isGatewaySession = !!session?.gatewayIdentityId;
+ const isGatewaySession = !!session?.gatewayIdentityId || !!session?.gatewayId;
return (
<div className="mx-auto flex flex-col justify-between bg-bunker-800 text-white">
{session && (
diff --git a/frontend/src/pages/pam/PamSessionsPage/components/PamSessionRow.tsx b/frontend/src/pages/pam/PamSessionsPage/components/PamSessionRow.tsx
index 8004fa0fa1..f66377a9c5 100644
--- a/frontend/src/pages/pam/PamSessionsPage/components/PamSessionRow.tsx
+++ b/frontend/src/pages/pam/PamSessionsPage/components/PamSessionRow.tsx
@@ -66,11 +66,12 @@ export const PamSessionRow = ({ session, search, filteredLogs }: Props) => {
actorEmail,
createdAt,
endedAt,
- gatewayIdentityId
+ gatewayIdentityId,
+ gatewayId
} = session;
const isActive = status === PamSessionStatus.Active || status === PamSessionStatus.Starting;
- const isGatewaySession = !!gatewayIdentityId;
+ const isGatewaySession = !!gatewayIdentityId || !!gatewayId;
const { image, name: resourceTypeName } = PAM_RESOURCE_TYPE_MAP[resourceType];