diff --git a/apps/e2e/tests/backend/endpoints/api/v1/integrations/custom/oauth.test.ts b/apps/e2e/tests/backend/endpoints/api/v1/integrations/custom/oauth.test.ts index 0151e0f39..5d931f686 100644 --- a/apps/e2e/tests/backend/endpoints/api/v1/integrations/custom/oauth.test.ts +++ b/apps/e2e/tests/backend/endpoints/api/v1/integrations/custom/oauth.test.ts @@ -268,12 +268,12 @@ it(`should not exchange the authorization code when the client secret is incorre "details": { "message": deindent\` Request validation failed on POST /api/v1/integrations/custom/oauth/token: - - Invalid client_id:client_secret values; did you use the correct values for the Neon integration? + - Invalid client_id:client_secret values; did you use the correct values for the integration? \`, }, "error": deindent\` Request validation failed on POST /api/v1/integrations/custom/oauth/token: - - Invalid client_id:client_secret values; did you use the correct values for the Neon integration? + - Invalid client_id:client_secret values; did you use the correct values for the integration? \`, }, "headers": Headers { diff --git a/apps/e2e/tests/backend/endpoints/api/v1/integrations/custom/projects/provision.test.ts b/apps/e2e/tests/backend/endpoints/api/v1/integrations/custom/projects/provision.test.ts index 58f886965..7045c316a 100644 --- a/apps/e2e/tests/backend/endpoints/api/v1/integrations/custom/projects/provision.test.ts +++ b/apps/e2e/tests/backend/endpoints/api/v1/integrations/custom/projects/provision.test.ts @@ -13,7 +13,7 @@ export async function provisionProject() { }); } -it("should be able to provision a new project if neon client details are correct", async ({ expect }) => { +it("should be able to provision a new project if client details are correct", async ({ expect }) => { const response = await provisionProject(); expect(response).toMatchInlineSnapshot(` NiceResponse { @@ -86,7 +86,7 @@ it("should be able to provision a new project if neon client details are correct `); }); -it("should fail if the neon client details are incorrect", async ({ expect }) => { +it("should fail if the client details are incorrect", async ({ expect }) => { const response = await niceBackendFetch("/api/v1/integrations/custom/projects/provision", { method: "POST", body: { @@ -104,12 +104,12 @@ it("should fail if the neon client details are incorrect", async ({ expect }) => "details": { "message": deindent\` Request validation failed on POST /api/v1/integrations/custom/projects/provision: - - Invalid client_id:client_secret values; did you use the correct values for the Neon integration? + - Invalid client_id:client_secret values; did you use the correct values for the integration? \`, }, "error": deindent\` Request validation failed on POST /api/v1/integrations/custom/projects/provision: - - Invalid client_id:client_secret values; did you use the correct values for the Neon integration? + - Invalid client_id:client_secret values; did you use the correct values for the integration? \`, }, "headers": Headers { diff --git a/apps/e2e/tests/backend/endpoints/api/v1/integrations/neon/oauth.test.ts b/apps/e2e/tests/backend/endpoints/api/v1/integrations/neon/oauth.test.ts index a8d9260eb..69ac14e31 100644 --- a/apps/e2e/tests/backend/endpoints/api/v1/integrations/neon/oauth.test.ts +++ b/apps/e2e/tests/backend/endpoints/api/v1/integrations/neon/oauth.test.ts @@ -268,12 +268,12 @@ it(`should not exchange the authorization code when the client secret is incorre "details": { "message": deindent\` Request validation failed on POST /api/v1/integrations/neon/oauth/token: - - Invalid client_id:client_secret values; did you use the correct values for the Neon integration? + - Invalid client_id:client_secret values; did you use the correct values for the integration? \`, }, "error": deindent\` Request validation failed on POST /api/v1/integrations/neon/oauth/token: - - Invalid client_id:client_secret values; did you use the correct values for the Neon integration? + - Invalid client_id:client_secret values; did you use the correct values for the integration? \`, }, "headers": Headers { diff --git a/apps/e2e/tests/backend/endpoints/api/v1/integrations/neon/projects/provision.test.ts b/apps/e2e/tests/backend/endpoints/api/v1/integrations/neon/projects/provision.test.ts index e2668f178..a34485e51 100644 --- a/apps/e2e/tests/backend/endpoints/api/v1/integrations/neon/projects/provision.test.ts +++ b/apps/e2e/tests/backend/endpoints/api/v1/integrations/neon/projects/provision.test.ts @@ -104,12 +104,12 @@ it("should fail if the neon client details are incorrect", async ({ expect }) => "details": { "message": deindent\` Request validation failed on POST /api/v1/integrations/neon/projects/provision: - - Invalid client_id:client_secret values; did you use the correct values for the Neon integration? + - Invalid client_id:client_secret values; did you use the correct values for the integration? \`, }, "error": deindent\` Request validation failed on POST /api/v1/integrations/neon/projects/provision: - - Invalid client_id:client_secret values; did you use the correct values for the Neon integration? + - Invalid client_id:client_secret values; did you use the correct values for the integration? \`, }, "headers": Headers { diff --git a/packages/stack-shared/src/schema-fields.ts b/packages/stack-shared/src/schema-fields.ts index 5936cc66b..0314b3ca6 100644 --- a/packages/stack-shared/src/schema-fields.ts +++ b/packages/stack-shared/src/schema-fields.ts @@ -480,9 +480,9 @@ export const basicAuthorizationHeaderSchema = yupString().test('is-basic-authori }); // Neon integration -export const neonAuthorizationHeaderSchema = basicAuthorizationHeaderSchema.test('is-neon-authorization-header', 'Invalid client_id:client_secret values; did you use the correct values for the Neon integration?', (value) => { +export const neonAuthorizationHeaderSchema = basicAuthorizationHeaderSchema.test('is-authorization-header', 'Invalid client_id:client_secret values; did you use the correct values for the integration?', (value) => { if (!value) return true; - const [clientId, clientSecret] = decodeBasicAuthorizationHeader(value) ?? throwErr(`Neon authz header invalid? This should've been validated by basicAuthorizationHeaderSchema: ${value}`); + const [clientId, clientSecret] = decodeBasicAuthorizationHeader(value) ?? throwErr(`Authz header invalid? This should've been validated by basicAuthorizationHeaderSchema: ${value}`); for (const neonClientConfig of JSON.parse(process.env.STACK_INTEGRATION_CLIENTS_CONFIG || '[]')) { if (clientId === neonClientConfig.client_id && clientSecret === neonClientConfig.client_secret) return true; }