From babd070b58981372e5cc501ce517a6c95157728a Mon Sep 17 00:00:00 2001 From: = Date: Tue, 23 Sep 2025 02:07:35 +0530 Subject: [PATCH] feat: resolved project slug short on get urls and improved error message for oidc auth --- backend/src/server/routes/v1/project-router.ts | 2 +- .../src/server/routes/v2/deprecated-project-router.ts | 10 +++++----- .../IdentitySection/IdentityOidcAuthForm.tsx | 9 ++++++++- 3 files changed, 14 insertions(+), 7 deletions(-) diff --git a/backend/src/server/routes/v1/project-router.ts b/backend/src/server/routes/v1/project-router.ts index be8b46dd5..c1f4140e5 100644 --- a/backend/src/server/routes/v1/project-router.ts +++ b/backend/src/server/routes/v1/project-router.ts @@ -316,7 +316,7 @@ export const registerProjectRouter = async (server: FastifyZodProvider) => { } ], params: z.object({ - slug: slugSchema({ max: 36 }).describe("The slug of the project to get.") + slug: slugSchema({ max: 64 }).describe("The slug of the project to get.") }), response: { 200: projectWithEnv diff --git a/backend/src/server/routes/v2/deprecated-project-router.ts b/backend/src/server/routes/v2/deprecated-project-router.ts index 7c1045855..55493681a 100644 --- a/backend/src/server/routes/v2/deprecated-project-router.ts +++ b/backend/src/server/routes/v2/deprecated-project-router.ts @@ -180,7 +180,7 @@ export const registerDeprecatedProjectRouter = async (server: FastifyZodProvider } ], params: z.object({ - slug: slugSchema({ min: 5, max: 36 }).describe("The slug of the project to delete.") + slug: slugSchema({ min: 5, max: 64 }).describe("The slug of the project to delete.") }), response: { 200: SanitizedProjectSchema @@ -233,7 +233,7 @@ export const registerDeprecatedProjectRouter = async (server: FastifyZodProvider } ], params: z.object({ - slug: slugSchema({ max: 36 }).describe("The slug of the project to get.") + slug: slugSchema({ max: 64 }).describe("The slug of the project to get.") }), response: { 200: projectWithEnv @@ -266,7 +266,7 @@ export const registerDeprecatedProjectRouter = async (server: FastifyZodProvider }, schema: { params: z.object({ - slug: slugSchema({ min: 5, max: 36 }).describe("The slug of the project to update.") + slug: slugSchema({ min: 5, max: 64 }).describe("The slug of the project to update.") }), body: z.object({ name: z.string().trim().optional().describe(PROJECTS.UPDATE.name), @@ -322,7 +322,7 @@ export const registerDeprecatedProjectRouter = async (server: FastifyZodProvider hide: false, tags: [ApiDocsTags.PkiCertificateAuthorities], params: z.object({ - slug: slugSchema({ min: 5, max: 36 }).describe(PROJECTS.LIST_CAS.slug) + slug: slugSchema({ min: 5, max: 64 }).describe(PROJECTS.LIST_CAS.slug) }), querystring: z.object({ status: z.enum([CaStatus.ACTIVE, CaStatus.PENDING_CERTIFICATE]).optional().describe(PROJECTS.LIST_CAS.status), @@ -365,7 +365,7 @@ export const registerDeprecatedProjectRouter = async (server: FastifyZodProvider hide: false, tags: [ApiDocsTags.PkiCertificates], params: z.object({ - slug: slugSchema({ min: 5, max: 36 }).describe(PROJECTS.LIST_CERTIFICATES.slug) + slug: slugSchema({ min: 5, max: 64 }).describe(PROJECTS.LIST_CERTIFICATES.slug) }), querystring: z.object({ friendlyName: z.string().optional().describe(PROJECTS.LIST_CERTIFICATES.friendlyName), diff --git a/frontend/src/pages/organization/AccessManagementPage/components/OrgIdentityTab/components/IdentitySection/IdentityOidcAuthForm.tsx b/frontend/src/pages/organization/AccessManagementPage/components/OrgIdentityTab/components/IdentitySection/IdentityOidcAuthForm.tsx index c0a91a7f7..1d4ac95af 100644 --- a/frontend/src/pages/organization/AccessManagementPage/components/OrgIdentityTab/components/IdentitySection/IdentityOidcAuthForm.tsx +++ b/frontend/src/pages/organization/AccessManagementPage/components/OrgIdentityTab/components/IdentitySection/IdentityOidcAuthForm.tsx @@ -42,7 +42,14 @@ const schema = z.object({ message: "Access Token Max TTL cannot be greater than 315360000" }), accessTokenNumUsesLimit: z.string(), - oidcDiscoveryUrl: z.string().url().min(1), + oidcDiscoveryUrl: z + .string() + .url() + .min(1) + .refine( + (el) => !el.endsWith("/.well-known/openid-configuration"), + "Please remove /.well-known/openid-configuration." + ), caCert: z.string().trim().default(""), boundIssuer: z.string().min(1), boundAudiences: z.string().optional().default(""),