Skip to content

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

Add descriptions for list cas/certs endpoints

Tuan Dang7cb174b6444e
diff --git a/backend/src/lib/api-docs/constants.ts b/backend/src/lib/api-docs/constants.ts
index c0e59b2b62..5e5e330e11 100644
--- a/backend/src/lib/api-docs/constants.ts
+++ b/backend/src/lib/api-docs/constants.ts
@@ -425,6 +425,21 @@ export const PROJECTS = {
},
LIST_INTEGRATION_AUTHORIZATION: {
workspaceId: "The ID of the project to list integration auths for."
+ },
+ LIST_CAS: {
+ slug: "The slug of the project to list CAs for.",
+ status: "The status of the CA to filter by.",
+ friendlyName: "The friendly name of the CA to filter by.",
+ commonName: "The common name of the CA to filter by.",
+ offset: "The offset to start from. If you enter 10, it will start from the 10th CA.",
+ limit: "The number of CAs to return."
+ },
+ LIST_CERTIFICATES: {
+ slug: "The slug of the project to list certificates for.",
+ friendlyName: "The friendly name of the certificate to filter by.",
+ commonName: "The common name of the certificate to filter by.",
+ offset: "The offset to start from. If you enter 10, it will start from the 10th certificate.",
+ limit: "The number of certificates to return."
}
} as const;
diff --git a/backend/src/server/routes/v2/project-router.ts b/backend/src/server/routes/v2/project-router.ts
index 76286c8337..e592916643 100644
--- a/backend/src/server/routes/v2/project-router.ts
+++ b/backend/src/server/routes/v2/project-router.ts
@@ -317,14 +317,14 @@ export const registerProjectRouter = async (server: FastifyZodProvider) => {
},
schema: {
params: z.object({
- slug: slugSchema.describe("The slug of the project to list CAs.")
+ slug: slugSchema.describe(PROJECTS.LIST_CAS.slug)
}),
querystring: z.object({
- status: z.enum([CaStatus.ACTIVE, CaStatus.PENDING_CERTIFICATE]).optional(),
- friendlyName: z.string().optional(),
- commonName: z.string().optional(),
- offset: z.coerce.number().min(0).max(100).default(0),
- limit: z.coerce.number().min(1).max(100).default(25)
+ status: z.enum([CaStatus.ACTIVE, CaStatus.PENDING_CERTIFICATE]).optional().describe(PROJECTS.LIST_CAS.status),
+ friendlyName: z.string().optional().describe(PROJECTS.LIST_CAS.friendlyName),
+ commonName: z.string().optional().describe(PROJECTS.LIST_CAS.commonName),
+ offset: z.coerce.number().min(0).max(100).default(0).describe(PROJECTS.LIST_CAS.offset),
+ limit: z.coerce.number().min(1).max(100).default(25).describe(PROJECTS.LIST_CAS.limit)
}),
response: {
200: z.object({
@@ -358,13 +358,13 @@ export const registerProjectRouter = async (server: FastifyZodProvider) => {
},
schema: {
params: z.object({
- slug: slugSchema.describe("The slug of the project to list certificates.")
+ slug: slugSchema.describe(PROJECTS.LIST_CERTIFICATES.slug)
}),
querystring: z.object({
- friendlyName: z.string().optional(),
- commonName: z.string().optional(),
- offset: z.coerce.number().min(0).max(100).default(0),
- limit: z.coerce.number().min(1).max(100).default(25)
+ friendlyName: z.string().optional().describe(PROJECTS.LIST_CERTIFICATES.friendlyName),
+ commonName: z.string().optional().describe(PROJECTS.LIST_CERTIFICATES.commonName),
+ offset: z.coerce.number().min(0).max(100).default(0).describe(PROJECTS.LIST_CERTIFICATES.offset),
+ limit: z.coerce.number().min(1).max(100).default(25).describe(PROJECTS.LIST_CERTIFICATES.limit)
}),
response: {
200: z.object({