mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-20 01:38:05 +00:00
* feat: support env groups in render sync * fix: update doc * Update backend/src/services/app-connection/render/render-connection-service.ts Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com> * fix: pr changes * fix: lint and type check * fix: changes * fix: remove secrets * fix: MAX iterations in render sync * fix: render sync review fields * fix: pr changes * fix: lint * fix: changes --------- Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
81 lines
2.2 KiB
TypeScript
81 lines
2.2 KiB
TypeScript
import z from "zod";
|
|
|
|
import { readLimit } from "@app/server/config/rateLimiter";
|
|
import { verifyAuth } from "@app/server/plugins/auth/verify-auth";
|
|
import { AppConnection } from "@app/services/app-connection/app-connection-enums";
|
|
import {
|
|
CreateRenderConnectionSchema,
|
|
SanitizedRenderConnectionSchema,
|
|
UpdateRenderConnectionSchema
|
|
} from "@app/services/app-connection/render/render-connection-schema";
|
|
import { AuthMode } from "@app/services/auth/auth-type";
|
|
|
|
import { registerAppConnectionEndpoints } from "./app-connection-endpoints";
|
|
|
|
export const registerRenderConnectionRouter = async (server: FastifyZodProvider) => {
|
|
registerAppConnectionEndpoints({
|
|
app: AppConnection.Render,
|
|
server,
|
|
sanitizedResponseSchema: SanitizedRenderConnectionSchema,
|
|
createSchema: CreateRenderConnectionSchema,
|
|
updateSchema: UpdateRenderConnectionSchema
|
|
});
|
|
|
|
// The below endpoints are not exposed and for Infisical App use
|
|
server.route({
|
|
method: "GET",
|
|
url: `/:connectionId/services`,
|
|
config: {
|
|
rateLimit: readLimit
|
|
},
|
|
schema: {
|
|
params: z.object({
|
|
connectionId: z.string().uuid()
|
|
}),
|
|
response: {
|
|
200: z
|
|
.object({
|
|
id: z.string(),
|
|
name: z.string()
|
|
})
|
|
.array()
|
|
}
|
|
},
|
|
onRequest: verifyAuth([AuthMode.JWT]),
|
|
handler: async (req) => {
|
|
const { connectionId } = req.params;
|
|
const services = await server.services.appConnection.render.listServices(connectionId, req.permission);
|
|
|
|
return services;
|
|
}
|
|
});
|
|
|
|
server.route({
|
|
method: "GET",
|
|
url: `/:connectionId/environment-groups`,
|
|
config: {
|
|
rateLimit: readLimit
|
|
},
|
|
schema: {
|
|
params: z.object({
|
|
connectionId: z.string().uuid()
|
|
}),
|
|
response: {
|
|
200: z
|
|
.object({
|
|
id: z.string(),
|
|
name: z.string()
|
|
})
|
|
.array()
|
|
}
|
|
},
|
|
onRequest: verifyAuth([AuthMode.JWT]),
|
|
handler: async (req) => {
|
|
const { connectionId } = req.params;
|
|
const groups = await server.services.appConnection.render.listEnvironmentGroups(connectionId, req.permission);
|
|
|
|
return groups;
|
|
}
|
|
});
|
|
};
|