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
chore: include pool and gateway names in pool membership audit logs
bernie-gda4c131af9a2
diff --git a/backend/src/ee/routes/v1/gateway-pool-router.ts b/backend/src/ee/routes/v1/gateway-pool-router.tsindex 0382acf73f..2995f29fc3 100644--- a/backend/src/ee/routes/v1/gateway-pool-router.ts+++ b/backend/src/ee/routes/v1/gateway-pool-router.ts@@ -211,7 +211,7 @@ export const registerGatewayPoolRouter = async (server: FastifyZodProvider) => {config: { rateLimit: writeLimit },onRequest: verifyAuth([AuthMode.JWT, AuthMode.IDENTITY_ACCESS_TOKEN]),handler: async (req) => {- const membership = await server.services.gatewayPool.addGatewayToPool({+ const { membership, poolName, gatewayName } = await server.services.gatewayPool.addGatewayToPool({poolId: req.params.poolId,gatewayId: req.body.gatewayId,...req.permission@@ -224,7 +224,9 @@ export const registerGatewayPoolRouter = async (server: FastifyZodProvider) => {type: EventType.GATEWAY_POOL_ADD_MEMBER,metadata: {poolId: req.params.poolId,- gatewayId: req.body.gatewayId+ poolName,+ gatewayId: req.body.gatewayId,+ gatewayName}}});@@ -255,7 +257,7 @@ export const registerGatewayPoolRouter = async (server: FastifyZodProvider) => {config: { rateLimit: writeLimit },onRequest: verifyAuth([AuthMode.JWT, AuthMode.IDENTITY_ACCESS_TOKEN]),handler: async (req) => {- const membership = await server.services.gatewayPool.removeGatewayFromPool({+ const { membership, poolName, gatewayName } = await server.services.gatewayPool.removeGatewayFromPool({poolId: req.params.poolId,gatewayId: req.params.gatewayId,...req.permission@@ -268,7 +270,9 @@ export const registerGatewayPoolRouter = async (server: FastifyZodProvider) => {type: EventType.GATEWAY_POOL_REMOVE_MEMBER,metadata: {poolId: req.params.poolId,- gatewayId: req.params.gatewayId+ poolName,+ gatewayId: req.params.gatewayId,+ gatewayName}}});diff --git a/backend/src/ee/services/audit-log/audit-log-types.ts b/backend/src/ee/services/audit-log/audit-log-types.tsindex a3ff75f8f7..8dd84ceaba 100644--- a/backend/src/ee/services/audit-log/audit-log-types.ts+++ b/backend/src/ee/services/audit-log/audit-log-types.ts@@ -6164,7 +6164,9 @@ interface GatewayPoolAddMemberEvent {type: EventType.GATEWAY_POOL_ADD_MEMBER;metadata: {poolId: string;+ poolName: string;gatewayId: string;+ gatewayName: string;};}@@ -6172,7 +6174,9 @@ interface GatewayPoolRemoveMemberEvent {type: EventType.GATEWAY_POOL_REMOVE_MEMBER;metadata: {poolId: string;+ poolName: string;gatewayId: string;+ gatewayName: string;};}diff --git a/backend/src/ee/services/gateway-pool/gateway-pool-service.ts b/backend/src/ee/services/gateway-pool/gateway-pool-service.tsindex 51b89064cb..1322014441 100644--- a/backend/src/ee/services/gateway-pool/gateway-pool-service.ts+++ b/backend/src/ee/services/gateway-pool/gateway-pool-service.ts@@ -198,7 +198,7 @@ export const gatewayPoolServiceFactory = ({try {const membership = await gatewayPoolMembershipDAL.create({ gatewayPoolId: poolId, gatewayId });- return membership;+ return { membership, poolName: pool.name, gatewayName: gateway.name };} catch (error) {if (error instanceof DatabaseError &&@@ -219,12 +219,17 @@ export const gatewayPoolServiceFactory = ({throw new NotFoundError({ message: `Gateway pool with ID ${poolId} not found` });}+ const gateway = await gatewayV2DAL.findById(gatewayId);+ if (!gateway || gateway.orgId !== actor.orgId) {+ throw new NotFoundError({ message: `Gateway with ID ${gatewayId} not found` });+ }+const [deleted] = await gatewayPoolMembershipDAL.delete({ gatewayPoolId: poolId, gatewayId });if (!deleted) {throw new NotFoundError({ message: "Gateway is not a member of this pool." });}- return deleted;+ return { membership: deleted, poolName: pool.name, gatewayName: gateway.name };};const pickRandomHealthyGateway = async (poolId: string) => {