diff --git a/.infisicalignore b/.infisicalignore index fa3815a6e..b8fafe6db 100644 --- a/.infisicalignore +++ b/.infisicalignore @@ -1 +1 @@ -.github/resources/docker-compose.be-test.yml:generic-api-key:16 \ No newline at end of file +.github/resources/docker-compose.be-test.yml:generic-api-key:16 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/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/secretImpsController.ts b/backend/src/controllers/v1/secretImpsController.ts index 8e11a2c62..70275284b 100644 --- a/backend/src/controllers/v1/secretImpsController.ts +++ b/backend/src/controllers/v1/secretImpsController.ts @@ -16,7 +16,7 @@ import { ProjectPermissionActions, ProjectPermissionSub, getUserProjectPermissions -} from "../../services/ProjectRoleService"; +} from "../../ee/services/ProjectRoleService"; import { ForbiddenError, subject } from "@casl/ability"; export const createSecretImp = 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 2e741b756..bb6ef7d86 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 037373881..72365d7da 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 c5ecb6fad..aa4440a55 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, secretImps as v1SecretImpsRouter, secret as v1SecretRouter, secretsFolder as v1SecretsFolder, 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"; diff --git a/docs/images/email-resend-create-domain.png b/docs/images/email-resend-create-domain.png new file mode 100644 index 000000000..9a469e87a Binary files /dev/null and b/docs/images/email-resend-create-domain.png differ diff --git a/docs/images/email-resend-create-key.png b/docs/images/email-resend-create-key.png new file mode 100644 index 000000000..b0b4265a5 Binary files /dev/null and b/docs/images/email-resend-create-key.png differ diff --git a/docs/images/email-resend-smtp-settings.png b/docs/images/email-resend-smtp-settings.png new file mode 100644 index 000000000..df678259e Binary files /dev/null and b/docs/images/email-resend-smtp-settings.png differ diff --git a/docs/internals/overview.mdx b/docs/internals/overview.mdx index d88abc042..d4ec9a564 100644 --- a/docs/internals/overview.mdx +++ b/docs/internals/overview.mdx @@ -7,4 +7,31 @@ This section covers the internals of Infisical including its technical underpinn Knowledge of this section is recommended but not required to use Infisical. However, if you're operating Infisical, we recommend understanding the internals. - \ No newline at end of file + + +## Learn More + + + + Learn about the fundamental parts of Infisical + + + Find out more about the structure of core user flows in Infisical + + + Read about most common security-related topics and questions + + + Learn best practices for utilizing Infisical sevrice tokens + + diff --git a/docs/self-hosting/configuration/email.mdx b/docs/self-hosting/configuration/email.mdx index 160e4f205..566265a2d 100644 --- a/docs/self-hosting/configuration/email.mdx +++ b/docs/self-hosting/configuration/email.mdx @@ -25,6 +25,36 @@ If you choose to setup email service, you need to configure the following SMTP [ Below you will find details on how to configure common email providers: + +1. Create an account on [Resend](https://resend.com). +2. Add a [Domain](https://resend.com/domains). + +![adding resend domain](../../images/email-resend-create-domain.png) + +3. Create an [API Key](https://resend.com/api-keys). + +![creating resend api key](../../images/email-resend-create-key.png) + +4. Go to the [SMTP page](https://resend.com/settings/smtp) and copy the values. + +![go to resend smtp settings](../../images/email-resend-smtp-settings.png) + +5. With the API Key, you can now set your SMTP environment variables variables: + +``` +SMTP_HOST=smtp.resend.com +SMTP_USERNAME=resend +SMTP_PASSWORD=YOUR_API_KEY +SMTP_PORT=587 +SMTP_SECURE=true +SMTP_FROM_ADDRESS=hey@example.com # your email address being used to send out emails +SMTP_FROM_NAME=Infisical +``` + + Remember that you will need to restart Infisical for this to work properly. + + + 1. Create an account and configure [SendGrid](https://sendgrid.com) to send emails. diff --git a/frontend/src/pages/login/index.tsx b/frontend/src/pages/login/index.tsx index cf1d96d1f..8fd27c429 100644 --- a/frontend/src/pages/login/index.tsx +++ b/frontend/src/pages/login/index.tsx @@ -9,7 +9,7 @@ export default function LoginPage() { const { t } = useTranslation(); return ( -
+
{t("common.head-title", { title: t("login.title") })} diff --git a/frontend/src/styles/globals.css b/frontend/src/styles/globals.css index fe1015485..a895d1b87 100644 --- a/frontend/src/styles/globals.css +++ b/frontend/src/styles/globals.css @@ -1,10 +1,6 @@ @tailwind base; @tailwind components; -html { - @apply overflow-hidden; -} - .rdp-day, .rdp-nav_button { @apply rounded-md hover:text-mineshaft-500; @@ -16,7 +12,7 @@ html { } .rdp-day_today { - @apply bg-primary/50 hover:bg-primary-600 text-mineshaft-500; + @apply bg-primary/50 text-mineshaft-500 hover:bg-primary-600; } @tailwind utilities;