updated messages

This commit is contained in:
Zai Shi 2025-05-20 17:53:19 -07:00
parent 0fdf9105af
commit dbd91fd4c9
5 changed files with 12 additions and 12 deletions

View File

@ -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 {

View File

@ -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 {

View File

@ -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 {

View File

@ -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 {

View File

@ -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;
}