Skip to content

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

feat(gateways): emit gateway-connect instead of reusing gateway-enroll

bernie-g5acf7199e6eb
diff --git a/backend/src/ee/routes/v2/gateway-router.ts b/backend/src/ee/routes/v2/gateway-router.ts
index dfc1f08245..709100f218 100644
--- a/backend/src/ee/routes/v2/gateway-router.ts
+++ b/backend/src/ee/routes/v2/gateway-router.ts
@@ -78,7 +78,7 @@ export const registerGatewayV2Router = async (server: FastifyZodProvider) => {
...req.auditLogInfo,
orgId: req.permission.orgId,
event: {
- type: EventType.GATEWAY_ENROLL,
+ type: EventType.GATEWAY_CONNECT,
metadata: {
gatewayId: registered.gatewayId,
name: registered.gatewayName,
diff --git a/backend/src/ee/routes/v3/gateway-router.ts b/backend/src/ee/routes/v3/gateway-router.ts
index c36c48b410..f818753edb 100644
--- a/backend/src/ee/routes/v3/gateway-router.ts
+++ b/backend/src/ee/routes/v3/gateway-router.ts
@@ -758,7 +758,7 @@ export const registerGatewayV3Router = async (server: FastifyZodProvider) => {
...req.auditLogInfo,
orgId: req.permission.orgId,
event: {
- type: EventType.GATEWAY_ENROLL,
+ type: EventType.GATEWAY_CONNECT,
metadata: {
gatewayId: connected.gatewayId,
name: connected.gatewayName,
diff --git a/backend/src/ee/services/audit-log/audit-log-types.ts b/backend/src/ee/services/audit-log/audit-log-types.ts
index 39de56fc50..e2ac8dfe29 100644
--- a/backend/src/ee/services/audit-log/audit-log-types.ts
+++ b/backend/src/ee/services/audit-log/audit-log-types.ts
@@ -868,6 +868,7 @@ export enum EventType {
GATEWAY_CREATE = "gateway-create",
GATEWAY_ENROLLMENT_TOKEN_CREATE = "gateway-enrollment-token-create",
GATEWAY_ENROLL = "gateway-enroll",
+ GATEWAY_CONNECT = "gateway-connect",
// Resource Auth Methods
RESOURCE_AUTH_METHOD_LOGIN = "resource-auth-method-login",
@@ -6989,6 +6990,14 @@ interface GatewayEnrollmentTokenCreateEvent {
interface GatewayEnrollEvent {
type: EventType.GATEWAY_ENROLL;
+ metadata: {
+ gatewayId: string;
+ name: string;
+ };
+}
+
+interface GatewayConnectEvent {
+ type: EventType.GATEWAY_CONNECT;
metadata: {
gatewayId: string;
name: string;
@@ -7917,6 +7926,7 @@ export type Event =
| GatewayCreateEvent
| GatewayEnrollmentTokenCreateEvent
| GatewayEnrollEvent
+ | GatewayConnectEvent
| ResourceAuthMethodLoginEvent
| ResourceAuthMethodLoginFailedEvent
| ResourceAuthMethodUpdateEvent
diff --git a/frontend/src/hooks/api/auditLogs/constants.tsx b/frontend/src/hooks/api/auditLogs/constants.tsx
index 70175ada10..b78d6ec2d5 100644
--- a/frontend/src/hooks/api/auditLogs/constants.tsx
+++ b/frontend/src/hooks/api/auditLogs/constants.tsx
@@ -434,6 +434,7 @@ export const eventToNameMap: { [K in EventType]: string } = {
[EventType.EXTERNAL_MIGRATION_DELETE]: "Delete External Migration",
[EventType.GATEWAY_CREATE]: "Create gateway",
[EventType.GATEWAY_ENROLL]: "Enroll gateway (legacy)",
+ [EventType.GATEWAY_CONNECT]: "Gateway connect",
[EventType.GATEWAY_ENROLLMENT_TOKEN_CREATE]: "Generate gateway enrollment token",
[EventType.RESOURCE_AUTH_METHOD_LOGIN]: "Resource login",
[EventType.RESOURCE_AUTH_METHOD_LOGIN_FAILED]: "Resource login failed",
diff --git a/frontend/src/hooks/api/auditLogs/enums.tsx b/frontend/src/hooks/api/auditLogs/enums.tsx
index c6aebbdce1..a8166ef022 100644
--- a/frontend/src/hooks/api/auditLogs/enums.tsx
+++ b/frontend/src/hooks/api/auditLogs/enums.tsx
@@ -429,6 +429,7 @@ export enum EventType {
// Gateway
GATEWAY_CREATE = "gateway-create",
GATEWAY_ENROLL = "gateway-enroll",
+ GATEWAY_CONNECT = "gateway-connect",
GATEWAY_ENROLLMENT_TOKEN_CREATE = "gateway-enrollment-token-create",
RESOURCE_AUTH_METHOD_LOGIN = "resource-auth-method-login",
RESOURCE_AUTH_METHOD_LOGIN_FAILED = "resource-auth-method-login-failed",