Skip to content

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

merge: resolve conflicts with main

bernie-g115c83fc252a
diff --cc .claude/worktrees/pam-ai-session-insights-v3
index 0000000000,0000000000..2faf238120
new file mode 160000
--- /dev/null
+++ b/.claude/worktrees/pam-ai-session-insights-v3
@@@ -1,0 -1,0 +1,1 @@@
++Subproject commit 2faf23812015e52a74d92c243b6758ac54e72e83
diff --cc backend/src/ee/routes/v1/pam-session-router.ts
index 58201043d5,3e491cd51a..d894aa3dac
--- a/backend/src/ee/routes/v1/pam-session-router.ts
+++ b/backend/src/ee/routes/v1/pam-session-router.ts
@@@ -54,9 -56,9 +56,9 @@@ export const registerPamSessionRouter
})
}
},
- onRequest: verifyAuth([AuthMode.IDENTITY_ACCESS_TOKEN]),
+ onRequest: verifyAuth([AuthMode.IDENTITY_ACCESS_TOKEN, AuthMode.GATEWAY_ACCESS_TOKEN]),
handler: async (req) => {
- const { credentials, projectId, account, sessionStarted } =
+ const { credentials, policyRules, projectId, account, sessionStarted } =
await server.services.pamAccount.getSessionCredentials(req.params.sessionId, req.permission);
await server.services.auditLog.createAuditLog({
diff --cc backend/src/ee/services/audit-log/audit-log-types.ts
index 1bcdf0e6b8,6e5fbb4ddd..484a85343b
--- a/backend/src/ee/services/audit-log/audit-log-types.ts
+++ b/backend/src/ee/services/audit-log/audit-log-types.ts
@@@ -734,10 -742,10 +743,15 @@@ export enum EventType
SECRET_VALIDATION_RULE_UPDATE = "secret-validation-rule-update",
SECRET_VALIDATION_RULE_DELETE = "secret-validation-rule-delete",
+ // Email Domains
+ CREATE_EMAIL_DOMAIN = "create-email-domain",
+ VERIFY_EMAIL_DOMAIN = "verify-email-domain",
- DELETE_EMAIL_DOMAIN = "delete-email-domain"
++ DELETE_EMAIL_DOMAIN = "delete-email-domain",
++
+ // Gateway Enrollment Tokens
+ GATEWAY_CREATE = "gateway-create",
+ GATEWAY_ENROLLMENT_TOKEN_CREATE = "gateway-enrollment-token-create",
+ GATEWAY_ENROLL = "gateway-enroll"
}
// Maps each actor type to the JSONB key that holds the actor's primary ID in actorMetadata.
@@@ -5782,30 -5861,30 +5879,54 @@@ interface SecretValidationRuleDeleteEve
};
}
+ interface CreateEmailDomainEvent {
+ type: EventType.CREATE_EMAIL_DOMAIN;
+ metadata: {
+ emailDomainId: string;
+ domain: string;
+ };
+ }
+
+ interface VerifyEmailDomainEvent {
+ type: EventType.VERIFY_EMAIL_DOMAIN;
+ metadata: {
+ emailDomainId: string;
+ domain: string;
+ };
+ }
+
+ interface DeleteEmailDomainEvent {
+ type: EventType.DELETE_EMAIL_DOMAIN;
+ metadata: {
+ emailDomainId: string;
+ domain: string;
+ };
+ }
+
+interface GatewayCreateEvent {
+ type: EventType.GATEWAY_CREATE;
+ metadata: {
+ gatewayId: string;
+ name: string;
+ };
+}
+
+interface GatewayEnrollmentTokenCreateEvent {
+ type: EventType.GATEWAY_ENROLLMENT_TOKEN_CREATE;
+ metadata: {
+ tokenId: string;
+ name: string;
+ };
+}
+
+interface GatewayEnrollEvent {
+ type: EventType.GATEWAY_ENROLL;
+ metadata: {
+ gatewayId: string;
+ name: string;
+ };
+}
+
export type Event =
| CreateSubOrganizationEvent
| UpdateSubOrganizationEvent
@@@ -6328,6 -6416,6 +6458,9 @@@
| SecretValidationRuleCreateEvent
| SecretValidationRuleUpdateEvent
| SecretValidationRuleDeleteEvent
+ | CreateEmailDomainEvent
+ | VerifyEmailDomainEvent
- | DeleteEmailDomainEvent;
++ | DeleteEmailDomainEvent
+ | GatewayCreateEvent
+ | GatewayEnrollmentTokenCreateEvent
+ | GatewayEnrollEvent;
diff --cc backend/src/server/plugins/auth/inject-identity.ts
index 907767203e,857f941813..ee7cee196f
--- a/backend/src/server/plugins/auth/inject-identity.ts
+++ b/backend/src/server/plugins/auth/inject-identity.ts
@@@ -15,7 -15,7 +15,8 @@@ import
AuthMode,
AuthModeJwtTokenPayload,
AuthTokenType,
- MfaMethod
++ MfaMethod,
+ TGatewayAccessTokenJwtPayload
} from "@app/services/auth/auth-type";
import { TIdentityAccessTokenJwtPayload } from "@app/services/identity-access-token/identity-access-token-types";
import { getServerCfg } from "@app/services/super-admin/super-admin-service";
diff --cc backend/src/services/auth/auth-type.ts
index 5a64a53052,3c1e2f83ed..c7e6da05a5
--- a/backend/src/services/auth/auth-type.ts
+++ b/backend/src/services/auth/auth-type.ts
@@@ -22,10 -21,17 +21,18 @@@ export enum AuthTokenType
SERVICE_ACCESS_TOKEN = "serviceAccessToken",
SERVICE_REFRESH_TOKEN = "serviceRefreshToken",
IDENTITY_ACCESS_TOKEN = "identityAccessToken",
- SCIM_TOKEN = "scimToken"
+ SCIM_TOKEN = "scimToken",
+ GATEWAY_ACCESS_TOKEN = "gatewayAccessToken"
}
+ // Result state from processProviderCallback — determines what the route handler should do
+ export enum ProviderAuthResult {
+ // User is fully authenticated — set refresh cookie and redirect to app
+ SESSION = "session",
+ // User account is incomplete (new user or unverified alias) — issue signup token
+ SIGNUP_REQUIRED = "signup_required"
+ }
+
export enum AuthMode {
JWT = "jwt",
SERVICE_TOKEN = "serviceToken",