mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-05 07:26:34 +00:00
misc: moved metadata parsing into github scope
This commit is contained in:
@@ -2,11 +2,12 @@
|
|||||||
import { createAppAuth } from "@octokit/auth-app";
|
import { createAppAuth } from "@octokit/auth-app";
|
||||||
import { Octokit } from "@octokit/rest";
|
import { Octokit } from "@octokit/rest";
|
||||||
|
|
||||||
|
import { TIntegrationAuths } from "@app/db/schemas";
|
||||||
import { getConfig } from "@app/lib/config/env";
|
import { getConfig } from "@app/lib/config/env";
|
||||||
import { request } from "@app/lib/config/request";
|
import { request } from "@app/lib/config/request";
|
||||||
import { NotFoundError } from "@app/lib/errors";
|
import { NotFoundError } from "@app/lib/errors";
|
||||||
|
|
||||||
import { TIntegrationAuthMetadata } from "./integration-auth-schema";
|
import { IntegrationAuthMetadataSchema, TIntegrationAuthMetadata } from "./integration-auth-schema";
|
||||||
import { Integrations, IntegrationUrls } from "./integration-list";
|
import { Integrations, IntegrationUrls } from "./integration-list";
|
||||||
|
|
||||||
// akhilmhdh: check this part later. Copied from old base
|
// akhilmhdh: check this part later. Copied from old base
|
||||||
@@ -1088,18 +1089,18 @@ const getAppsAzureDevOps = async ({ accessToken, orgName }: { accessToken: strin
|
|||||||
|
|
||||||
export const getApps = async ({
|
export const getApps = async ({
|
||||||
integration,
|
integration,
|
||||||
|
integrationAuth,
|
||||||
accessToken,
|
accessToken,
|
||||||
accessId,
|
accessId,
|
||||||
teamId,
|
teamId,
|
||||||
azureDevOpsOrgName,
|
azureDevOpsOrgName,
|
||||||
workspaceSlug,
|
workspaceSlug,
|
||||||
authMetadata,
|
|
||||||
url
|
url
|
||||||
}: {
|
}: {
|
||||||
integration: string;
|
integration: string;
|
||||||
accessToken: string;
|
accessToken: string;
|
||||||
accessId?: string;
|
accessId?: string;
|
||||||
authMetadata: TIntegrationAuthMetadata;
|
integrationAuth: TIntegrationAuths;
|
||||||
teamId?: string | null;
|
teamId?: string | null;
|
||||||
azureDevOpsOrgName?: string | null;
|
azureDevOpsOrgName?: string | null;
|
||||||
workspaceSlug?: string;
|
workspaceSlug?: string;
|
||||||
@@ -1134,7 +1135,7 @@ export const getApps = async ({
|
|||||||
case Integrations.GITHUB:
|
case Integrations.GITHUB:
|
||||||
return getAppsGithub({
|
return getAppsGithub({
|
||||||
accessToken,
|
accessToken,
|
||||||
authMetadata
|
authMetadata: IntegrationAuthMetadataSchema.parse(integrationAuth.metadata)
|
||||||
});
|
});
|
||||||
|
|
||||||
case Integrations.GITLAB:
|
case Integrations.GITLAB:
|
||||||
|
|||||||
@@ -481,7 +481,7 @@ export const integrationAuthServiceFactory = ({
|
|||||||
const { accessToken, accessId } = await getIntegrationAccessToken(integrationAuth, shouldUseSecretV2Bridge, botKey);
|
const { accessToken, accessId } = await getIntegrationAccessToken(integrationAuth, shouldUseSecretV2Bridge, botKey);
|
||||||
const apps = await getApps({
|
const apps = await getApps({
|
||||||
integration: integrationAuth.integration,
|
integration: integrationAuth.integration,
|
||||||
authMetadata: IntegrationAuthMetadataSchema.parse(integrationAuth.metadata),
|
integrationAuth,
|
||||||
accessToken,
|
accessToken,
|
||||||
accessId,
|
accessId,
|
||||||
teamId,
|
teamId,
|
||||||
|
|||||||
Reference in New Issue
Block a user