diff --git a/backend/src/controllers/v1/botController.ts b/backend/src/controllers/v1/botController.ts index 2f70f25cf..65251e83a 100644 --- a/backend/src/controllers/v1/botController.ts +++ b/backend/src/controllers/v1/botController.ts @@ -8,7 +8,7 @@ import { ProjectPermissionActions, ProjectPermissionSub, getUserProjectPermissions -} from "../../services/ProjectRoleService"; +} from "../../ee/services/ProjectRoleService"; import { ForbiddenError } from "@casl/ability"; import { BadRequestError } from "../../utils/errors"; diff --git a/backend/src/controllers/v1/index.ts b/backend/src/controllers/v1/index.ts index f3212d32d..422aaa5ec 100644 --- a/backend/src/controllers/v1/index.ts +++ b/backend/src/controllers/v1/index.ts @@ -16,7 +16,6 @@ import * as workspaceController from "./workspaceController"; import * as secretScanningController from "./secretScanningController"; import * as webhookController from "./webhookController"; import * as secretImportController from "./secretImportController"; -import * as roleController from "./roleController"; export { authController, @@ -36,6 +35,5 @@ export { workspaceController, secretScanningController, webhookController, - roleController, secretImportController }; diff --git a/backend/src/controllers/v1/integrationAuthController.ts b/backend/src/controllers/v1/integrationAuthController.ts index c468444a3..a7390abaa 100644 --- a/backend/src/controllers/v1/integrationAuthController.ts +++ b/backend/src/controllers/v1/integrationAuthController.ts @@ -24,7 +24,7 @@ import { ProjectPermissionActions, ProjectPermissionSub, getUserProjectPermissions -} from "../../services/ProjectRoleService"; +} from "../../ee/services/ProjectRoleService"; import { ForbiddenError } from "@casl/ability"; import { getIntegrationAuthAccessHelper } from "../../helpers"; import { ObjectId } from "mongodb"; @@ -155,18 +155,20 @@ export const saveIntegrationToken = async (req: Request, res: Response) => { namespace, algorithm: ALGORITHM_AES_256_GCM, keyEncoding: ENCODING_SCHEME_UTF8, - ...(integration === INTEGRATION_GCP_SECRET_MANAGER ? { - metadata: { - authMethod: "serviceAccount" - } - } : {}) + ...(integration === INTEGRATION_GCP_SECRET_MANAGER + ? { + metadata: { + authMethod: "serviceAccount" + } + } + : {}) }, { new: true, upsert: true } ); - + // encrypt and save integration access details if (refreshToken) { await exchangeRefresh({ @@ -705,14 +707,14 @@ export const getIntegrationAuthNorthflankSecretGroups = async (req: Request, res /** * Return list of build configs for TeamCity project with id [appId] - * @param req - * @param res - * @returns + * @param req + * @param res + * @returns */ export const getIntegrationAuthTeamCityBuildConfigs = async (req: Request, res: Response) => { const { - params: { integrationAuthId,appId }, - } = await validateRequest(reqValidator.GetIntegrationAuthTeamCityBuildConfigsV1 , req); + params: { integrationAuthId, appId } + } = await validateRequest(reqValidator.GetIntegrationAuthTeamCityBuildConfigsV1, req); // TODO(akhilmhdh): remove class -> static function path and makes these into reusable independent functions const { integrationAuth } = await getIntegrationAuthAccessHelper({ @@ -727,7 +729,7 @@ export const getIntegrationAuthTeamCityBuildConfigs = async (req: Request, res: ProjectPermissionActions.Read, ProjectPermissionSub.Integrations ); - + interface TeamCityBuildConfig { id: string; name: string; @@ -736,27 +738,29 @@ export const getIntegrationAuthTeamCityBuildConfigs = async (req: Request, res: href: string; webUrl: string; } - + interface GetTeamCityBuildConfigsRes { count: number; href: string; buildType: TeamCityBuildConfig[]; } - if (appId && appId !== "") { - const { data: { buildType } } = ( - await standardRequest.get(`${req.integrationAuth.url}/app/rest/buildTypes`, { + const { + data: { buildType } + } = await standardRequest.get( + `${req.integrationAuth.url}/app/rest/buildTypes`, + { params: { locator: `project:${appId}` }, headers: { Authorization: `Bearer ${req.accessToken}`, - Accept: "application/json", - }, - }) + Accept: "application/json" + } + } ); - + return res.status(200).send({ buildConfigs: buildType.map((buildConfig) => ({ name: buildConfig.name, @@ -764,11 +768,11 @@ export const getIntegrationAuthTeamCityBuildConfigs = async (req: Request, res: })) }); } - + return res.status(200).send({ buildConfigs: [] }); -} +}; /** * Delete integration authorization with id [integrationAuthId] diff --git a/backend/src/controllers/v1/integrationController.ts b/backend/src/controllers/v1/integrationController.ts index 3adbcb9e2..b847b382c 100644 --- a/backend/src/controllers/v1/integrationController.ts +++ b/backend/src/controllers/v1/integrationController.ts @@ -14,7 +14,7 @@ import { ProjectPermissionActions, ProjectPermissionSub, getUserProjectPermissions -} from "../../services/ProjectRoleService"; +} from "../../ee/services/ProjectRoleService"; import { ForbiddenError } from "@casl/ability"; /** diff --git a/backend/src/controllers/v1/keyController.ts b/backend/src/controllers/v1/keyController.ts index 87afa936d..242cb8f82 100644 --- a/backend/src/controllers/v1/keyController.ts +++ b/backend/src/controllers/v1/keyController.ts @@ -10,7 +10,7 @@ import { ProjectPermissionActions, ProjectPermissionSub, getUserProjectPermissions -} from "../../services/ProjectRoleService"; +} from "../../ee/services/ProjectRoleService"; import { ForbiddenError } from "@casl/ability"; /** diff --git a/backend/src/controllers/v1/membershipController.ts b/backend/src/controllers/v1/membershipController.ts index bc2dc0e8d..7ad570885 100644 --- a/backend/src/controllers/v1/membershipController.ts +++ b/backend/src/controllers/v1/membershipController.ts @@ -13,9 +13,9 @@ import { ProjectPermissionActions, ProjectPermissionSub, getUserProjectPermissions -} from "../../services/ProjectRoleService"; +} from "../../ee/services/ProjectRoleService"; import { ForbiddenError } from "@casl/ability"; -import Role from "../../models/role"; +import Role from "../../ee/models/role"; import { BadRequestError } from "../../utils/errors"; import { InviteUserToWorkspaceV1 } from "../../validation/workspace"; diff --git a/backend/src/controllers/v1/membershipOrgController.ts b/backend/src/controllers/v1/membershipOrgController.ts index 6e32fd662..57ebb79aa 100644 --- a/backend/src/controllers/v1/membershipOrgController.ts +++ b/backend/src/controllers/v1/membershipOrgController.ts @@ -22,7 +22,7 @@ import { OrgPermissionActions, OrgPermissionSubjects, getUserOrgPermissions -} from "../../services/RoleService"; +} from "../../ee/services/RoleService"; import { ForbiddenError } from "@casl/ability"; /** diff --git a/backend/src/controllers/v1/organizationController.ts b/backend/src/controllers/v1/organizationController.ts index 3386c8767..edd57a3b8 100644 --- a/backend/src/controllers/v1/organizationController.ts +++ b/backend/src/controllers/v1/organizationController.ts @@ -17,7 +17,7 @@ import { OrgPermissionActions, OrgPermissionSubjects, getUserOrgPermissions -} from "../../services/RoleService"; +} from "../../ee/services/RoleService"; import { OrganizationNotFoundError } from "../../utils/errors"; import { ForbiddenError } from "@casl/ability"; diff --git a/backend/src/controllers/v1/secretImportController.ts b/backend/src/controllers/v1/secretImportController.ts index b912c0653..24e091113 100644 --- a/backend/src/controllers/v1/secretImportController.ts +++ b/backend/src/controllers/v1/secretImportController.ts @@ -16,7 +16,7 @@ import { ProjectPermissionActions, ProjectPermissionSub, getUserProjectPermissions -} from "../../services/ProjectRoleService"; +} from "../../ee/services/ProjectRoleService"; import { ForbiddenError, subject } from "@casl/ability"; export const createSecretImport = async (req: Request, res: Response) => { diff --git a/backend/src/controllers/v1/secretScanningController.ts b/backend/src/controllers/v1/secretScanningController.ts index df2fe173a..ff1e5f3f0 100644 --- a/backend/src/controllers/v1/secretScanningController.ts +++ b/backend/src/controllers/v1/secretScanningController.ts @@ -4,9 +4,13 @@ import crypto from "crypto"; import { Types } from "mongoose"; import { OrganizationNotFoundError, UnauthorizedRequestError } from "../../utils/errors"; import GitAppOrganizationInstallation from "../../ee/models/gitAppOrganizationInstallation"; -import { scanGithubFullRepoForSecretLeaks } from "../../queues/secret-scanning/githubScanFullRepository" +import { scanGithubFullRepoForSecretLeaks } from "../../queues/secret-scanning/githubScanFullRepository"; import { getSecretScanningGitAppId, getSecretScanningPrivateKey } from "../../config"; -import GitRisks, { STATUS_RESOLVED_FALSE_POSITIVE, STATUS_RESOLVED_NOT_REVOKED, STATUS_RESOLVED_REVOKED } from "../../ee/models/gitRisks"; +import GitRisks, { + STATUS_RESOLVED_FALSE_POSITIVE, + STATUS_RESOLVED_NOT_REVOKED, + STATUS_RESOLVED_REVOKED +} from "../../ee/models/gitRisks"; import { ProbotOctokit } from "probot"; import { Organization } from "../../models"; import { validateRequest } from "../../helpers/validation"; @@ -15,7 +19,7 @@ import { OrgPermissionActions, OrgPermissionSubjects, getUserOrgPermissions -} from "../../services/RoleService"; +} from "../../ee/services/RoleService"; import { ForbiddenError } from "@casl/ability"; export const createInstallationSession = async (req: Request, res: Response) => { @@ -92,15 +96,21 @@ export const linkInstallationToOrganization = async (req: Request, res: Response appId: await getSecretScanningGitAppId(), privateKey: await getSecretScanningPrivateKey(), installationId: installationId.toString() - }, + } }); - const { data: { repositories }}= await octokit.apps.listReposAccessibleToInstallation() + const { + data: { repositories } + } = await octokit.apps.listReposAccessibleToInstallation(); for (const repository of repositories) { - scanGithubFullRepoForSecretLeaks({organizationId: installationSession.organization.toString(), installationId, repository: {id: repository.id, fullName: repository.full_name}}) + scanGithubFullRepoForSecretLeaks({ + organizationId: installationSession.organization.toString(), + installationId, + repository: { id: repository.id, fullName: repository.full_name } + }); } - res.json(installationLink) -} + res.json(installationLink); +}; export const getCurrentOrganizationInstallationStatus = async (req: Request, res: Response) => { const { organizationId } = req.params; diff --git a/backend/src/controllers/v1/secretsFolderController.ts b/backend/src/controllers/v1/secretsFolderController.ts index 5f9595d88..4afb29715 100644 --- a/backend/src/controllers/v1/secretsFolderController.ts +++ b/backend/src/controllers/v1/secretsFolderController.ts @@ -6,7 +6,7 @@ import { EEAuditLogService, EESecretService } from "../../ee/services"; import { isValidScope } from "../../helpers/secrets"; import { validateRequest } from "../../helpers/validation"; import { Secret, ServiceTokenData } from "../../models"; -import {Folder} from "../../models/folder"; +import { Folder } from "../../models/folder"; import { appendFolder, deleteFolderById, @@ -21,7 +21,7 @@ import { ProjectPermissionActions, ProjectPermissionSub, getUserProjectPermissions -} from "../../services/ProjectRoleService"; +} from "../../ee/services/ProjectRoleService"; import { BadRequestError, UnauthorizedRequestError } from "../../utils/errors"; import * as reqValidator from "../../validation/folders"; diff --git a/backend/src/controllers/v1/webhookController.ts b/backend/src/controllers/v1/webhookController.ts index e4cb1b825..73d92e7dc 100644 --- a/backend/src/controllers/v1/webhookController.ts +++ b/backend/src/controllers/v1/webhookController.ts @@ -13,7 +13,7 @@ import { ProjectPermissionActions, ProjectPermissionSub, getUserProjectPermissions -} from "../../services/ProjectRoleService"; +} from "../../ee/services/ProjectRoleService"; import { ForbiddenError } from "@casl/ability"; export const createWebhook = async (req: Request, res: Response) => { diff --git a/backend/src/controllers/v1/workspaceController.ts b/backend/src/controllers/v1/workspaceController.ts index 6c017d6be..cbefc98a7 100644 --- a/backend/src/controllers/v1/workspaceController.ts +++ b/backend/src/controllers/v1/workspaceController.ts @@ -18,7 +18,7 @@ import { OrgPermissionActions, OrgPermissionSubjects, getUserOrgPermissions -} from "../../services/RoleService"; +} from "../../ee/services/RoleService"; import { ForbiddenError } from "@casl/ability"; import { validateRequest } from "../../helpers/validation"; import * as reqValidator from "../../validation"; @@ -26,7 +26,7 @@ import { ProjectPermissionActions, ProjectPermissionSub, getUserProjectPermissions -} from "../../services/ProjectRoleService"; +} from "../../ee/services/ProjectRoleService"; /** * Return public keys of members of workspace with id [workspaceId] diff --git a/backend/src/controllers/v2/environmentController.ts b/backend/src/controllers/v2/environmentController.ts index 1d43630db..a8d7871a1 100644 --- a/backend/src/controllers/v2/environmentController.ts +++ b/backend/src/controllers/v2/environmentController.ts @@ -19,7 +19,7 @@ import { ProjectPermissionActions, ProjectPermissionSub, getUserProjectPermissions -} from "../../services/ProjectRoleService"; +} from "../../ee/services/ProjectRoleService"; import { ForbiddenError } from "@casl/ability"; /** diff --git a/backend/src/controllers/v2/organizationsController.ts b/backend/src/controllers/v2/organizationsController.ts index 2044183af..277a29af8 100644 --- a/backend/src/controllers/v2/organizationsController.ts +++ b/backend/src/controllers/v2/organizationsController.ts @@ -3,7 +3,7 @@ import { Types } from "mongoose"; import { Membership, MembershipOrg, ServiceAccount, Workspace } from "../../models"; import { deleteMembershipOrg } from "../../helpers/membershipOrg"; import { updateSubscriptionOrgQuantity } from "../../helpers/organization"; -import Role from "../../models/role"; +import Role from "../../ee/models/role"; import { BadRequestError } from "../../utils/errors"; import { CUSTOM } from "../../variables"; import * as reqValidator from "../../validation/organization"; @@ -12,7 +12,7 @@ import { OrgPermissionActions, OrgPermissionSubjects, getUserOrgPermissions -} from "../../services/RoleService"; +} from "../../ee/services/RoleService"; import { ForbiddenError } from "@casl/ability"; /** diff --git a/backend/src/controllers/v2/secretsController.ts b/backend/src/controllers/v2/secretsController.ts index 0ecd88cf8..1a01282cc 100644 --- a/backend/src/controllers/v2/secretsController.ts +++ b/backend/src/controllers/v2/secretsController.ts @@ -44,7 +44,7 @@ import { ProjectPermissionActions, ProjectPermissionSub, getUserProjectPermissions -} from "../../services/ProjectRoleService"; +} from "../../ee/services/ProjectRoleService"; import { ForbiddenError, subject } from "@casl/ability"; /** diff --git a/backend/src/controllers/v2/serviceTokenDataController.ts b/backend/src/controllers/v2/serviceTokenDataController.ts index 28168675d..b8f1b8f43 100644 --- a/backend/src/controllers/v2/serviceTokenDataController.ts +++ b/backend/src/controllers/v2/serviceTokenDataController.ts @@ -12,7 +12,7 @@ import { ProjectPermissionActions, ProjectPermissionSub, getUserProjectPermissions -} from "../../services/ProjectRoleService"; +} from "../../ee/services/ProjectRoleService"; import { ForbiddenError } from "@casl/ability"; import { Types } from "mongoose"; diff --git a/backend/src/controllers/v2/tagController.ts b/backend/src/controllers/v2/tagController.ts index 898d89045..668903222 100644 --- a/backend/src/controllers/v2/tagController.ts +++ b/backend/src/controllers/v2/tagController.ts @@ -8,7 +8,7 @@ import { ProjectPermissionActions, ProjectPermissionSub, getUserProjectPermissions -} from "../../services/ProjectRoleService"; +} from "../../ee/services/ProjectRoleService"; import * as reqValidator from "../../validation/tags"; export const createWorkspaceTag = async (req: Request, res: Response) => { diff --git a/backend/src/controllers/v2/workspaceController.ts b/backend/src/controllers/v2/workspaceController.ts index 1905aa292..040c68f31 100644 --- a/backend/src/controllers/v2/workspaceController.ts +++ b/backend/src/controllers/v2/workspaceController.ts @@ -17,7 +17,7 @@ import { ProjectPermissionActions, ProjectPermissionSub, getUserProjectPermissions -} from "../../services/ProjectRoleService"; +} from "../../ee/services/ProjectRoleService"; import { ForbiddenError } from "@casl/ability"; interface V2PushSecret { diff --git a/backend/src/controllers/v3/secretsController.ts b/backend/src/controllers/v3/secretsController.ts index 696f23f75..c984d37b2 100644 --- a/backend/src/controllers/v3/secretsController.ts +++ b/backend/src/controllers/v3/secretsController.ts @@ -15,7 +15,7 @@ import { ProjectPermissionActions, ProjectPermissionSub, getUserProjectPermissions -} from "../../services/ProjectRoleService"; +} from "../../ee/services/ProjectRoleService"; import { ForbiddenError, subject } from "@casl/ability"; import { validateServiceTokenDataClientForWorkspace } from "../../validation"; import { PERMISSION_READ_SECRETS, PERMISSION_WRITE_SECRETS } from "../../variables"; diff --git a/backend/src/controllers/v3/workspacesController.ts b/backend/src/controllers/v3/workspacesController.ts index 8681f3715..8469cdb5e 100644 --- a/backend/src/controllers/v3/workspacesController.ts +++ b/backend/src/controllers/v3/workspacesController.ts @@ -3,7 +3,7 @@ import { Types } from "mongoose"; import { validateRequest } from "../../helpers/validation"; import { Secret } from "../../models"; import { SecretService } from "../../services"; -import { getUserProjectPermissions } from "../../services/ProjectRoleService"; +import { getUserProjectPermissions } from "../../ee/services/ProjectRoleService"; import { UnauthorizedRequestError } from "../../utils/errors"; import * as reqValidator from "../../validation/workspace"; diff --git a/backend/src/ee/controllers/v1/index.ts b/backend/src/ee/controllers/v1/index.ts index 0c63b41c0..b57a07c9d 100644 --- a/backend/src/ee/controllers/v1/index.ts +++ b/backend/src/ee/controllers/v1/index.ts @@ -7,15 +7,17 @@ import * as workspaceController from "./workspaceController"; import * as actionController from "./actionController"; import * as membershipController from "./membershipController"; import * as cloudProductsController from "./cloudProductsController"; +import * as roleController from "./roleController"; export { - secretController, - secretSnapshotController, - organizationsController, - ssoController, - usersController, - workspaceController, - actionController, - membershipController, - cloudProductsController, -} \ No newline at end of file + secretController, + secretSnapshotController, + organizationsController, + ssoController, + usersController, + workspaceController, + actionController, + membershipController, + cloudProductsController, + roleController +}; diff --git a/backend/src/ee/controllers/v1/organizationsController.ts b/backend/src/ee/controllers/v1/organizationsController.ts index 1811a46f3..f64603e3b 100644 --- a/backend/src/ee/controllers/v1/organizationsController.ts +++ b/backend/src/ee/controllers/v1/organizationsController.ts @@ -9,7 +9,7 @@ import { OrgPermissionActions, OrgPermissionSubjects, getUserOrgPermissions -} from "../../../services/RoleService"; +} from "../../services/RoleService"; import { ForbiddenError } from "@casl/ability"; import { Organization } from "../../../models"; import { OrganizationNotFoundError } from "../../../utils/errors"; diff --git a/backend/src/controllers/v1/roleController.ts b/backend/src/ee/controllers/v1/roleController.ts similarity index 97% rename from backend/src/controllers/v1/roleController.ts rename to backend/src/ee/controllers/v1/roleController.ts index 77ff7cadf..2c87b9ff8 100644 --- a/backend/src/controllers/v1/roleController.ts +++ b/backend/src/ee/controllers/v1/roleController.ts @@ -6,7 +6,7 @@ import { GetUserPermission, GetUserProjectPermission, UpdateRoleSchema -} from "../../validation"; +} from "../../validation/role"; import { ProjectPermissionActions, ProjectPermissionSub, @@ -22,9 +22,9 @@ import { getUserOrgPermissions, memberPermissions } from "../../services/RoleService"; -import { BadRequestError } from "../../utils/errors"; +import { BadRequestError } from "../../../utils/errors"; import Role from "../../models/role"; -import { validateRequest } from "../../helpers/validation"; +import { validateRequest } from "../../../helpers/validation"; import { packRules } from "@casl/ability/extra"; export const createRole = async (req: Request, res: Response) => { diff --git a/backend/src/ee/controllers/v1/secretController.ts b/backend/src/ee/controllers/v1/secretController.ts index 58b7e6264..42aa07f3d 100644 --- a/backend/src/ee/controllers/v1/secretController.ts +++ b/backend/src/ee/controllers/v1/secretController.ts @@ -6,7 +6,7 @@ import { ProjectPermissionActions, ProjectPermissionSub, getUserProjectPermissions -} from "../../../services/ProjectRoleService"; +} from "../../services/ProjectRoleService"; import { BadRequestError } from "../../../utils/errors"; import * as reqValidator from "../../../validation"; import { SecretVersion } from "../../models"; diff --git a/backend/src/ee/controllers/v1/secretSnapshotController.ts b/backend/src/ee/controllers/v1/secretSnapshotController.ts index f2500d199..e39555929 100644 --- a/backend/src/ee/controllers/v1/secretSnapshotController.ts +++ b/backend/src/ee/controllers/v1/secretSnapshotController.ts @@ -5,7 +5,7 @@ import { ProjectPermissionActions, ProjectPermissionSub, getUserProjectPermissions -} from "../../../services/ProjectRoleService"; +} from "../../services/ProjectRoleService"; import * as reqValidator from "../../../validation/secretSnapshot"; import { ISecretVersion, SecretSnapshot, TFolderRootVersionSchema } from "../../models"; diff --git a/backend/src/ee/controllers/v1/ssoController.ts b/backend/src/ee/controllers/v1/ssoController.ts index bacc6befc..b7ae793ab 100644 --- a/backend/src/ee/controllers/v1/ssoController.ts +++ b/backend/src/ee/controllers/v1/ssoController.ts @@ -14,7 +14,7 @@ import { OrgPermissionActions, OrgPermissionSubjects, getUserOrgPermissions -} from "../../../services/RoleService"; +} from "../../services/RoleService"; import { ForbiddenError } from "@casl/ability"; /** diff --git a/backend/src/ee/controllers/v1/workspaceController.ts b/backend/src/ee/controllers/v1/workspaceController.ts index 42c68b9fe..14ea8978d 100644 --- a/backend/src/ee/controllers/v1/workspaceController.ts +++ b/backend/src/ee/controllers/v1/workspaceController.ts @@ -39,7 +39,7 @@ import { ProjectPermissionActions, ProjectPermissionSub, getUserProjectPermissions -} from "../../../services/ProjectRoleService"; +} from "../../services/ProjectRoleService"; import { ForbiddenError } from "@casl/ability"; /** diff --git a/backend/src/models/role.ts b/backend/src/ee/models/role.ts similarity index 100% rename from backend/src/models/role.ts rename to backend/src/ee/models/role.ts diff --git a/backend/src/ee/routes/v1/index.ts b/backend/src/ee/routes/v1/index.ts index be4847cef..9b8d1bea3 100644 --- a/backend/src/ee/routes/v1/index.ts +++ b/backend/src/ee/routes/v1/index.ts @@ -7,15 +7,17 @@ import workspace from "./workspace"; import action from "./action"; import cloudProducts from "./cloudProducts"; import secretScanning from "./secretScanning"; +import roles from "./role"; export { - secret, - secretSnapshot, - organizations, - sso, - users, - workspace, - action, - cloudProducts, - secretScanning -} \ No newline at end of file + secret, + secretSnapshot, + organizations, + sso, + users, + workspace, + action, + cloudProducts, + secretScanning, + roles +}; diff --git a/backend/src/routes/v1/role.ts b/backend/src/ee/routes/v1/role.ts similarity index 90% rename from backend/src/routes/v1/role.ts rename to backend/src/ee/routes/v1/role.ts index 042113954..0794b6b19 100644 --- a/backend/src/routes/v1/role.ts +++ b/backend/src/ee/routes/v1/role.ts @@ -1,7 +1,7 @@ import express from "express"; import { roleController } from "../../controllers/v1"; -import { requireAuth } from "../../middleware"; -import { AuthMode } from "../../variables"; +import { requireAuth } from "../../../middleware"; +import { AuthMode } from "../../../variables"; const router = express.Router(); diff --git a/backend/src/services/ProjectRoleService.ts b/backend/src/ee/services/ProjectRoleService.ts similarity index 98% rename from backend/src/services/ProjectRoleService.ts rename to backend/src/ee/services/ProjectRoleService.ts index 10dbd2302..c7d1e7494 100644 --- a/backend/src/services/ProjectRoleService.ts +++ b/backend/src/ee/services/ProjectRoleService.ts @@ -6,9 +6,9 @@ import { buildMongoQueryMatcher, createMongoAbility } from "@casl/ability"; -import { Membership } from "../models"; +import { Membership } from "../../models"; import { IRole } from "../models/role"; -import { BadRequestError, UnauthorizedRequestError } from "../utils/errors"; +import { BadRequestError, UnauthorizedRequestError } from "../../utils/errors"; import { FieldCondition, FieldInstruction, JsInterpreter } from "@ucast/mongo2js"; import picomatch from "picomatch"; diff --git a/backend/src/services/RoleService.ts b/backend/src/ee/services/RoleService.ts similarity index 96% rename from backend/src/services/RoleService.ts rename to backend/src/ee/services/RoleService.ts index bc5ef7453..df5ebf29a 100644 --- a/backend/src/services/RoleService.ts +++ b/backend/src/ee/services/RoleService.ts @@ -1,8 +1,8 @@ import { AbilityBuilder, MongoAbility, RawRuleOf, createMongoAbility } from "@casl/ability"; -import { MembershipOrg } from "../models"; +import { MembershipOrg } from "../../models"; import { IRole } from "../models/role"; -import { BadRequestError, UnauthorizedRequestError } from "../utils/errors"; -import { ACCEPTED } from "../variables"; +import { BadRequestError, UnauthorizedRequestError } from "../../utils/errors"; +import { ACCEPTED } from "../../variables"; import { conditionsMatcher } from "./ProjectRoleService"; export enum OrgPermissionActions { diff --git a/backend/src/validation/role.ts b/backend/src/ee/validation/role.ts similarity index 100% rename from backend/src/validation/role.ts rename to backend/src/ee/validation/role.ts diff --git a/backend/src/index.ts b/backend/src/index.ts index 7a5723b04..0ac06fc8f 100644 --- a/backend/src/index.ts +++ b/backend/src/index.ts @@ -24,6 +24,7 @@ import { secretSnapshot as eeSecretSnapshotRouter, users as eeUsersRouter, workspace as eeWorkspaceRouter, + roles as v1RoleRouter, secretScanning as v1SecretScanningRouter } from "./ee/routes/v1"; import { @@ -37,7 +38,6 @@ import { membership as v1MembershipRouter, organization as v1OrganizationRouter, password as v1PasswordRouter, - role as v1RoleRouter, secretImport as v1SecretImportRouter, secret as v1SecretRouter, secretsFolder as v1SecretsFolder, diff --git a/backend/src/routes/v1/index.ts b/backend/src/routes/v1/index.ts index 5edab6a18..08298a1c6 100644 --- a/backend/src/routes/v1/index.ts +++ b/backend/src/routes/v1/index.ts @@ -17,7 +17,6 @@ import integrationAuth from "./integrationAuth"; import secretsFolder from "./secretsFolder"; import webhooks from "./webhook"; import secretImport from "./secretImport"; -import role from "./role"; export { signup, @@ -38,6 +37,5 @@ export { integrationAuth, secretsFolder, webhooks, - secretImport, - role + secretImport }; diff --git a/backend/src/validation/index.ts b/backend/src/validation/index.ts index c3ed7696c..409b563c6 100644 --- a/backend/src/validation/index.ts +++ b/backend/src/validation/index.ts @@ -1,5 +1,4 @@ export * from "./user"; -export * from "./role"; export * from "./workspace"; export * from "./bot"; export * from "./integration";