|
|
|
@ -28,6 +28,7 @@ import {
|
|
|
|
|
} from "../../ee/services/ProjectRoleService";
|
|
|
|
|
import { ForbiddenError } from "@casl/ability";
|
|
|
|
|
import { getIntegrationAuthAccessHelper } from "../../helpers";
|
|
|
|
|
import { ObjectId } from "mongodb";
|
|
|
|
|
|
|
|
|
|
/***
|
|
|
|
|
* Return integration authorization with id [integrationAuthId]
|
|
|
|
@ -221,7 +222,7 @@ export const getIntegrationAuthApps = async (req: Request, res: Response) => {
|
|
|
|
|
|
|
|
|
|
// TODO(akhilmhdh): remove class -> static function path and makes these into reusable independent functions
|
|
|
|
|
const { integrationAuth, accessToken, accessId } = await getIntegrationAuthAccessHelper({
|
|
|
|
|
integrationAuthId: new Types.ObjectId(integrationAuthId)
|
|
|
|
|
integrationAuthId: new ObjectId(integrationAuthId)
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
const { permission } = await getUserProjectPermissions(
|
|
|
|
@ -259,7 +260,7 @@ export const getIntegrationAuthTeams = async (req: Request, res: Response) => {
|
|
|
|
|
|
|
|
|
|
// TODO(akhilmhdh): remove class -> static function path and makes these into reusable independent functions
|
|
|
|
|
const { integrationAuth, accessToken } = await getIntegrationAuthAccessHelper({
|
|
|
|
|
integrationAuthId: new Types.ObjectId(integrationAuthId)
|
|
|
|
|
integrationAuthId: new ObjectId(integrationAuthId)
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
const { permission } = await getUserProjectPermissions(
|
|
|
|
@ -295,7 +296,7 @@ export const getIntegrationAuthVercelBranches = async (req: Request, res: Respon
|
|
|
|
|
|
|
|
|
|
// TODO(akhilmhdh): remove class -> static function path and makes these into reusable independent functions
|
|
|
|
|
const { integrationAuth, accessToken } = await getIntegrationAuthAccessHelper({
|
|
|
|
|
integrationAuthId: new Types.ObjectId(integrationAuthId)
|
|
|
|
|
integrationAuthId: new ObjectId(integrationAuthId)
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
const { permission } = await getUserProjectPermissions(
|
|
|
|
@ -356,7 +357,7 @@ export const getIntegrationAuthQoveryOrgs = async (req: Request, res: Response)
|
|
|
|
|
|
|
|
|
|
// TODO(akhilmhdh): remove class -> static function path and makes these into reusable independent functions
|
|
|
|
|
const { integrationAuth, accessToken } = await getIntegrationAuthAccessHelper({
|
|
|
|
|
integrationAuthId: new Types.ObjectId(integrationAuthId)
|
|
|
|
|
integrationAuthId: new ObjectId(integrationAuthId)
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
const { permission } = await getUserProjectPermissions(
|
|
|
|
@ -408,7 +409,7 @@ export const getIntegrationAuthQoveryProjects = async (req: Request, res: Respon
|
|
|
|
|
|
|
|
|
|
// TODO(akhilmhdh): remove class -> static function path and makes these into reusable independent functions
|
|
|
|
|
const { integrationAuth, accessToken } = await getIntegrationAuthAccessHelper({
|
|
|
|
|
integrationAuthId: new Types.ObjectId(integrationAuthId)
|
|
|
|
|
integrationAuthId: new ObjectId(integrationAuthId)
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
const { permission } = await getUserProjectPermissions(
|
|
|
|
@ -469,7 +470,7 @@ export const getIntegrationAuthQoveryEnvironments = async (req: Request, res: Re
|
|
|
|
|
|
|
|
|
|
// TODO(akhilmhdh): remove class -> static function path and makes these into reusable independent functions
|
|
|
|
|
const { integrationAuth, accessToken } = await getIntegrationAuthAccessHelper({
|
|
|
|
|
integrationAuthId: new Types.ObjectId(integrationAuthId)
|
|
|
|
|
integrationAuthId: new ObjectId(integrationAuthId)
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
const { permission } = await getUserProjectPermissions(
|
|
|
|
@ -530,7 +531,7 @@ export const getIntegrationAuthQoveryApps = async (req: Request, res: Response)
|
|
|
|
|
|
|
|
|
|
// TODO(akhilmhdh): remove class -> static function path and makes these into reusable independent functions
|
|
|
|
|
const { integrationAuth, accessToken } = await getIntegrationAuthAccessHelper({
|
|
|
|
|
integrationAuthId: new Types.ObjectId(integrationAuthId)
|
|
|
|
|
integrationAuthId: new ObjectId(integrationAuthId)
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
const { permission } = await getUserProjectPermissions(
|
|
|
|
@ -591,7 +592,7 @@ export const getIntegrationAuthQoveryContainers = async (req: Request, res: Resp
|
|
|
|
|
|
|
|
|
|
// TODO(akhilmhdh): remove class -> static function path and makes these into reusable independent functions
|
|
|
|
|
const { integrationAuth, accessToken } = await getIntegrationAuthAccessHelper({
|
|
|
|
|
integrationAuthId: new Types.ObjectId(integrationAuthId)
|
|
|
|
|
integrationAuthId: new ObjectId(integrationAuthId)
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
const { permission } = await getUserProjectPermissions(
|
|
|
|
@ -652,7 +653,7 @@ export const getIntegrationAuthQoveryJobs = async (req: Request, res: Response)
|
|
|
|
|
|
|
|
|
|
// TODO(akhilmhdh): remove class -> static function path and makes these into reusable independent functions
|
|
|
|
|
const { integrationAuth, accessToken } = await getIntegrationAuthAccessHelper({
|
|
|
|
|
integrationAuthId: new Types.ObjectId(integrationAuthId)
|
|
|
|
|
integrationAuthId: new ObjectId(integrationAuthId)
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
const { permission } = await getUserProjectPermissions(
|
|
|
|
@ -714,7 +715,7 @@ export const getIntegrationAuthRailwayEnvironments = async (req: Request, res: R
|
|
|
|
|
|
|
|
|
|
// TODO(akhilmhdh): remove class -> static function path and makes these into reusable independent functions
|
|
|
|
|
const { integrationAuth, accessToken } = await getIntegrationAuthAccessHelper({
|
|
|
|
|
integrationAuthId: new Types.ObjectId(integrationAuthId)
|
|
|
|
|
integrationAuthId: new ObjectId(integrationAuthId)
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
const { permission } = await getUserProjectPermissions(
|
|
|
|
@ -807,7 +808,7 @@ export const getIntegrationAuthRailwayServices = async (req: Request, res: Respo
|
|
|
|
|
|
|
|
|
|
// TODO(akhilmhdh): remove class -> static function path and makes these into reusable independent functions
|
|
|
|
|
const { integrationAuth, accessToken } = await getIntegrationAuthAccessHelper({
|
|
|
|
|
integrationAuthId: new Types.ObjectId(integrationAuthId)
|
|
|
|
|
integrationAuthId: new ObjectId(integrationAuthId)
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
const { permission } = await getUserProjectPermissions(
|
|
|
|
@ -931,7 +932,7 @@ export const getIntegrationAuthBitBucketWorkspaces = async (req: Request, res: R
|
|
|
|
|
|
|
|
|
|
// TODO(akhilmhdh): remove class -> static function path and makes these into reusable independent functions
|
|
|
|
|
const { integrationAuth, accessToken } = await getIntegrationAuthAccessHelper({
|
|
|
|
|
integrationAuthId: new Types.ObjectId(integrationAuthId)
|
|
|
|
|
integrationAuthId: new ObjectId(integrationAuthId)
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
const { permission } = await getUserProjectPermissions(
|
|
|
|
@ -987,7 +988,7 @@ export const getIntegrationAuthNorthflankSecretGroups = async (req: Request, res
|
|
|
|
|
|
|
|
|
|
// TODO(akhilmhdh): remove class -> static function path and makes these into reusable independent functions
|
|
|
|
|
const { integrationAuth, accessToken } = await getIntegrationAuthAccessHelper({
|
|
|
|
|
integrationAuthId: new Types.ObjectId(integrationAuthId)
|
|
|
|
|
integrationAuthId: new ObjectId(integrationAuthId)
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
const { permission } = await getUserProjectPermissions(
|
|
|
|
@ -1075,7 +1076,7 @@ export const getIntegrationAuthTeamCityBuildConfigs = async (req: Request, res:
|
|
|
|
|
|
|
|
|
|
// TODO(akhilmhdh): remove class -> static function path and makes these into reusable independent functions
|
|
|
|
|
const { integrationAuth, accessToken } = await getIntegrationAuthAccessHelper({
|
|
|
|
|
integrationAuthId: new Types.ObjectId(integrationAuthId)
|
|
|
|
|
integrationAuthId: new ObjectId(integrationAuthId)
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
const { permission } = await getUserProjectPermissions(
|
|
|
|
@ -1144,7 +1145,7 @@ export const deleteIntegrationAuth = async (req: Request, res: Response) => {
|
|
|
|
|
|
|
|
|
|
// TODO(akhilmhdh): remove class -> static function path and makes these into reusable independent functions
|
|
|
|
|
const { integrationAuth, accessToken } = await getIntegrationAuthAccessHelper({
|
|
|
|
|
integrationAuthId: new Types.ObjectId(integrationAuthId)
|
|
|
|
|
integrationAuthId: new ObjectId(integrationAuthId)
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
const { permission } = await getUserProjectPermissions(
|
|
|
|
|