Skip to content

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

refactor: move gateway pools router from v2 to v1

bernie-g8808a1409837
diff --git a/backend/src/ee/routes/v2/gateway-pool-router.ts b/backend/src/ee/routes/v1/gateway-pool-router.ts
similarity index 100%
rename from backend/src/ee/routes/v2/gateway-pool-router.ts
rename to backend/src/ee/routes/v1/gateway-pool-router.ts
diff --git a/backend/src/ee/routes/v1/index.ts b/backend/src/ee/routes/v1/index.ts
index d11c2afda0..7ef91cddff 100644
--- a/backend/src/ee/routes/v1/index.ts
+++ b/backend/src/ee/routes/v1/index.ts
@@ -17,6 +17,7 @@ import { registerDynamicSecretRouter } from "./dynamic-secret-router";
import { registerEmailDomainRouter } from "./email-domain-router";
import { registerExternalKmsRouter } from "./external-kms-router";
import { EXTERNAL_KMS_REGISTER_ROUTER_MAP } from "./external-kms-routers";
+import { registerGatewayPoolRouter } from "./gateway-pool-router";
import { registerGatewayRouter } from "./gateway-router";
import { registerGithubOrgSyncRouter } from "./github-org-sync-router";
import { registerGroupRouter } from "./group-router";
@@ -115,6 +116,7 @@ export const registerV1EERoutes = async (server: FastifyZodProvider) => {
);
await server.register(registerGatewayRouter, { prefix: "/gateways" });
+ await server.register(registerGatewayPoolRouter, { prefix: "/gateway-pools" });
await server.register(registerRelayRouter, { prefix: "/relays" });
await server.register(registerGithubOrgSyncRouter, { prefix: "/github-org-sync-config" });
diff --git a/backend/src/ee/routes/v2/index.ts b/backend/src/ee/routes/v2/index.ts
index 01a306e576..0119f3ec4a 100644
--- a/backend/src/ee/routes/v2/index.ts
+++ b/backend/src/ee/routes/v2/index.ts
@@ -8,7 +8,6 @@ import {
} from "@app/ee/routes/v2/secret-scanning-v2-routers";
import { registerDeprecatedProjectRoleRouter } from "./deprecated-project-role-router";
-import { registerGatewayPoolRouter } from "./gateway-pool-router";
import { registerGatewayV2Router } from "./gateway-router";
import { registerIdentityProjectAdditionalPrivilegeRouter } from "./identity-project-additional-privilege-router";
import { registerSecretApprovalPolicyRouter } from "./secret-approval-policy-router";
@@ -29,8 +28,6 @@ export const registerV2EERoutes = async (server: FastifyZodProvider) => {
await server.register(registerGatewayV2Router, { prefix: "/gateways" });
- await server.register(registerGatewayPoolRouter, { prefix: "/gateway-pools" });
-
await server.register(registerSecretApprovalPolicyRouter, { prefix: "/secret-approvals" });
await server.register(
diff --git a/frontend/src/hooks/api/gateway-pools/mutations.tsx b/frontend/src/hooks/api/gateway-pools/mutations.tsx
index 57f4e40f1b..a8bca6c2a6 100644
--- a/frontend/src/hooks/api/gateway-pools/mutations.tsx
+++ b/frontend/src/hooks/api/gateway-pools/mutations.tsx
@@ -17,7 +17,7 @@ export const useCreateGatewayPool = () => {
const queryClient = useQueryClient();
return useMutation({
mutationFn: async (dto: TCreateGatewayPoolDTO) => {
- const { data } = await apiRequest.post<TGatewayPool>("/api/v2/gateway-pools", dto);
+ const { data } = await apiRequest.post<TGatewayPool>("/api/v1/gateway-pools", dto);
return data;
},
onSuccess: () => {
@@ -30,7 +30,7 @@ export const useUpdateGatewayPool = () => {
const queryClient = useQueryClient();
return useMutation({
mutationFn: async ({ poolId, ...dto }: TUpdateGatewayPoolDTO) => {
- const { data } = await apiRequest.patch<TGatewayPool>(`/api/v2/gateway-pools/${poolId}`, dto);
+ const { data } = await apiRequest.patch<TGatewayPool>(`/api/v1/gateway-pools/${poolId}`, dto);
return data;
},
onSuccess: () => {
@@ -43,7 +43,7 @@ export const useDeleteGatewayPool = () => {
const queryClient = useQueryClient();
return useMutation({
mutationFn: async (poolId: string) => {
- const { data } = await apiRequest.delete<TGatewayPool>(`/api/v2/gateway-pools/${poolId}`);
+ const { data } = await apiRequest.delete<TGatewayPool>(`/api/v1/gateway-pools/${poolId}`);
return data;
},
onSuccess: () => {
@@ -57,7 +57,7 @@ export const useAddGatewayToPool = () => {
return useMutation({
mutationFn: async ({ poolId, gatewayId }: TAddGatewayToPoolDTO) => {
const { data } = await apiRequest.post<TGatewayPoolMembership>(
- `/api/v2/gateway-pools/${poolId}/memberships`,
+ `/api/v1/gateway-pools/${poolId}/memberships`,
{ gatewayId }
);
return data;
@@ -74,7 +74,7 @@ export const useRemoveGatewayFromPool = () => {
return useMutation({
mutationFn: async ({ poolId, gatewayId }: TRemoveGatewayFromPoolDTO) => {
const { data } = await apiRequest.delete<TGatewayPoolMembership>(
- `/api/v2/gateway-pools/${poolId}/memberships/${gatewayId}`
+ `/api/v1/gateway-pools/${poolId}/memberships/${gatewayId}`
);
return data;
},
diff --git a/frontend/src/hooks/api/gateway-pools/queries.tsx b/frontend/src/hooks/api/gateway-pools/queries.tsx
index 52e649f6a8..38d6c331d8 100644
--- a/frontend/src/hooks/api/gateway-pools/queries.tsx
+++ b/frontend/src/hooks/api/gateway-pools/queries.tsx
@@ -10,7 +10,7 @@ export const gatewayPoolsQueryKeys = {
list: () => ({
queryKey: gatewayPoolsQueryKeys.listKey(),
queryFn: async () => {
- const { data } = await apiRequest.get<TGatewayPool[]>("/api/v2/gateway-pools");
+ const { data } = await apiRequest.get<TGatewayPool[]>("/api/v1/gateway-pools");
return data;
}
}),
@@ -19,7 +19,7 @@ export const gatewayPoolsQueryKeys = {
queryKey: gatewayPoolsQueryKeys.detailKey(poolId),
queryFn: async () => {
const { data } = await apiRequest.get<TGatewayPoolWithMembers>(
- `/api/v2/gateway-pools/${poolId}`
+ `/api/v1/gateway-pools/${poolId}`
);
return data;
},
@@ -43,7 +43,7 @@ export const useGetGatewayPoolConnectedResources = (poolId: string) => {
queryKey: [...gatewayPoolsQueryKeys.allKey(), "connected-resources", poolId],
queryFn: async () => {
const { data } = await apiRequest.get<TGatewayPoolConnectedResources>(
- `/api/v2/gateway-pools/${poolId}/resources`
+ `/api/v1/gateway-pools/${poolId}/resources`
);
return data;
},