feat(infisical-pg): resolved integration invalid cred error

This commit is contained in:
Akhil Mohan
2024-01-27 12:38:23 +05:30
parent 0d3f09d668
commit aed94ff5bb
7 changed files with 19 additions and 11 deletions
@@ -5,6 +5,7 @@ import { IntegrationAuthsSchema, SecretApprovalPoliciesSchema } from "@app/db/sc
// sometimes the return data must be santizied to avoid leaking important values
// always prefer pick over omit in zod
export const integrationAuthPubSchema = IntegrationAuthsSchema.pick({
id: true,
projectId: true,
integration: true,
teamId: true,
@@ -291,7 +291,15 @@ export const registerProjectRouter = async (server: FastifyZodProvider) => {
}),
response: {
200: z.object({
integrations: IntegrationsSchema.array()
integrations: IntegrationsSchema.merge(
z.object({
environment: z.object({
id: z.string(),
name: z.string(),
slug: z.string()
})
})
).array()
})
}
},
@@ -251,7 +251,7 @@ export const integrationAuthServiceFactory = ({
accessToken = decryptSymmetric128BitHexKeyUTF8({
ciphertext: integrationAuth.accessCiphertext,
iv: integrationAuth.accessIV,
tag: integrationAuth.accessIV,
tag: integrationAuth.accessTag,
key: botKey
});
}
@@ -4,7 +4,7 @@ import { getConfig } from "@app/lib/config/env";
import { request } from "@app/lib/config/request";
import { BadRequestError } from "@app/lib/errors";
import { Integrations,IntegrationUrls } from "./integration-list";
import { Integrations, IntegrationUrls } from "./integration-list";
type ExchangeCodeAzureResponse = {
token_type: string;
@@ -148,7 +148,6 @@ const exchangeCodeHeroku = async ({ code }: { code: string }) => {
})
)
).data;
accessExpiresAt.setSeconds(accessExpiresAt.getSeconds() + res.expires_in);
return {