Skip to content

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

chore(gateway): drop the redundant v3 delete route

bernie-gb8e9216b010f
diff --git a/backend/src/ee/routes/v2/gateway-router.ts b/backend/src/ee/routes/v2/gateway-router.ts
index ac0cb8456a..0c96c8d645 100644
--- a/backend/src/ee/routes/v2/gateway-router.ts
+++ b/backend/src/ee/routes/v2/gateway-router.ts
@@ -204,6 +204,16 @@ export const registerGatewayV2Router = async (server: FastifyZodProvider) => {
orgPermission: req.permission,
id: req.params.id
});
+
+ await server.services.auditLog.createAuditLog({
+ ...req.auditLogInfo,
+ orgId: req.permission.orgId,
+ event: {
+ type: EventType.GATEWAY_DELETE,
+ metadata: { gatewayId: gateway.id, name: gateway.name }
+ }
+ });
+
return gateway;
}
});
diff --git a/backend/src/ee/routes/v3/gateway-router.ts b/backend/src/ee/routes/v3/gateway-router.ts
index d7a0f8b1ef..085136eabd 100644
--- a/backend/src/ee/routes/v3/gateway-router.ts
+++ b/backend/src/ee/routes/v3/gateway-router.ts
@@ -34,7 +34,7 @@ import { PostHogEventTypes } from "@app/services/telemetry/telemetry-types";
const loginRateLimit = { windowMs: 60 * 1000, max: 10 };
-const GatewayV2ResourceSchema = GatewaysV2Schema.pick({
+const SanitizedGatewayV2Schema = GatewaysV2Schema.pick({
id: true,
identityId: true,
relayId: true,
@@ -45,9 +45,7 @@ const GatewayV2ResourceSchema = GatewaysV2Schema.pick({
heartbeatTTL: true,
directAddress: true,
directHeartbeat: true
-});
-
-const SanitizedGatewayV2Schema = GatewayV2ResourceSchema.extend({
+}).extend({
canRevoke: z.boolean()
});
@@ -417,38 +415,6 @@ export const registerGatewayV3Router = async (server: FastifyZodProvider) => {
}
});
- // ─── DELETE /:gatewayId ──────────────────────────────────────────────────
- server.route({
- method: "DELETE",
- url: "/:gatewayId",
- config: { rateLimit: writeLimit },
- schema: {
- hide: false,
- operationId: "deleteGateway",
- tags: [ApiDocsTags.GatewaysV3],
- params: z.object({ gatewayId: z.string().trim().uuid().describe(GATEWAYS.DELETE.gatewayId) }),
- response: { 200: GatewayV2ResourceSchema }
- },
- onRequest: verifyAuth([AuthMode.JWT, AuthMode.IDENTITY_ACCESS_TOKEN]),
- handler: async (req) => {
- const gateway = await server.services.gatewayV2.deleteGatewayById({
- orgPermission: req.permission,
- id: req.params.gatewayId
- });
-
- await server.services.auditLog.createAuditLog({
- ...req.auditLogInfo,
- orgId: req.permission.orgId,
- event: {
- type: EventType.GATEWAY_DELETE,
- metadata: { gatewayId: gateway.id, name: gateway.name }
- }
- });
-
- return gateway;
- }
- });
-
// ─── POST /:gatewayId/token-auth/generate-enrollment-token ────────────────
server.route({
method: "POST",
diff --git a/backend/src/lib/api-docs/constants.ts b/backend/src/lib/api-docs/constants.ts
index 236dd8dc75..f44b5d1896 100644
--- a/backend/src/lib/api-docs/constants.ts
+++ b/backend/src/lib/api-docs/constants.ts
@@ -4023,9 +4023,6 @@ export const GATEWAYS = {
authMethod:
"Auth method to configure on the gateway. `aws` carries the AWS allowlists; `gcp` carries the GCP token type and service account/project/zone allowlists; `kubernetes` carries the cluster host and namespace/service account allowlists; `token` is configurationless and requires a separate POST /v3/gateways/:id/token call to mint the bootstrap token."
},
- DELETE: {
- gatewayId: "The ID of the gateway to delete."
- },
UPDATE: {
name: "New name for the gateway. Renaming does not affect the gateway's ID, so resources referencing it keep working.",
authMethod: