Skip to content

Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.

Fix merge conflicts

Tuan Dang77dd768a38d6
diff --cc .infisicalignore
index b80ecaad50,b80ecaad50..a88bdccbdb
--- a/.infisicalignore
+++ b/.infisicalignore
@@@ -14,3 -14,3 +14,11 @@@ docs/self-hosting/guides/automated-boot
frontend/src/pages/secret-manager/SecretDashboardPage/components/SecretListView/SecretDetailSidebar.tsx:generic-api-key:72
k8-operator/config/samples/crd/pushsecret/source-secret-with-templating.yaml:private-key:11
k8-operator/config/samples/crd/pushsecret/push-secret-with-template.yaml:private-key:52
++backend/src/ee/services/secret-rotation-v2/secret-rotation-v2-types.ts:generic-api-key:125
++frontend/src/components/permissions/AccessTree/nodes/RoleNode.tsx:generic-api-key:67
++frontend/src/components/secret-rotations-v2/RotateSecretRotationV2Modal.tsx:generic-api-key:14
++frontend/src/components/secret-rotations-v2/SecretRotationV2StatusBadge.tsx:generic-api-key:11
++frontend/src/components/secret-rotations-v2/ViewSecretRotationV2GeneratedCredentials/ViewSecretRotationV2GeneratedCredentials.tsx:generic-api-key:23
++frontend/src/hooks/api/secretRotationsV2/types/index.ts:generic-api-key:28
++frontend/src/hooks/api/secretRotationsV2/types/index.ts:generic-api-key:65
++frontend/src/pages/secret-manager/SecretDashboardPage/components/SecretRotationListView/SecretRotationItem.tsx:generic-api-key:26
diff --cc backend/src/ee/services/audit-log/audit-log-types.ts
index 884c9b76d1,2ab46b6ad4..996a90555c
--- a/backend/src/ee/services/audit-log/audit-log-types.ts
+++ b/backend/src/ee/services/audit-log/audit-log-types.ts
@@@ -2,8 -2,14 +2,15 @@@ import
TCreateProjectTemplateDTO,
TUpdateProjectTemplateDTO
} from "@app/ee/services/project-template/project-template-types";
+ import { SecretRotation, SecretRotationStatus } from "@app/ee/services/secret-rotation-v2/secret-rotation-v2-enums";
+ import {
+ TCreateSecretRotationV2DTO,
+ TDeleteSecretRotationV2DTO,
+ TSecretRotationV2Raw,
+ TUpdateSecretRotationV2DTO
+ } from "@app/ee/services/secret-rotation-v2/secret-rotation-v2-types";
import { SshCaStatus, SshCertType } from "@app/ee/services/ssh/ssh-certificate-authority-types";
+import { SshCertKeyAlgorithm } from "@app/ee/services/ssh-certificate/ssh-certificate-types";
import { SshCertTemplateStatus } from "@app/ee/services/ssh-certificate-template/ssh-certificate-template-types";
import { SymmetricEncryption } from "@app/lib/crypto/cipher";
import { TProjectPermission } from "@app/lib/types";
diff --cc backend/src/ee/services/permission/project-permission.ts
index 7aef8d7c73,4d3fff12a0..542349360c
--- a/backend/src/ee/services/permission/project-permission.ts
+++ b/backend/src/ee/services/permission/project-permission.ts
@@@ -573,16 -561,16 +593,26 @@@ export const ProjectPermissionV2Schema
"When specified, only matching conditions will be allowed to access given resource."
).optional()
}),
+ z.object({
+ subject: z.literal(ProjectPermissionSub.SshHosts).describe("The entity this permission pertains to."),
+ action: CASL_ACTION_SCHEMA_NATIVE_ENUM(ProjectPermissionSshHostActions).describe(
+ "Describe what action an entity can take."
+ ),
+ inverted: z.boolean().optional().describe("Whether rule allows or forbids."),
+ conditions: SshHostConditionSchema.describe(
+ "When specified, only matching conditions will be allowed to access given resource."
+ ).optional()
+ }),
+ z.object({
+ subject: z.literal(ProjectPermissionSub.SecretRotation).describe("The entity this permission pertains to."),
+ inverted: z.boolean().optional().describe("Whether rule allows or forbids."),
+ action: CASL_ACTION_SCHEMA_NATIVE_ENUM(ProjectPermissionSecretRotationActions).describe(
+ "Describe what action an entity can take."
+ ),
+ conditions: SecretConditionV1Schema.describe(
+ "When specified, only matching conditions will be allowed to access given resource."
+ ).optional()
+ }),
...GeneralPermissionSchema
]);
diff --cc backend/src/services/project/project-service.ts
index 68e123fe79,58e3f9b54e..382093b2ae
--- a/backend/src/services/project/project-service.ts
+++ b/backend/src/services/project/project-service.ts
@@@ -20,11 -20,10 +20,12 @@@ import
import { TProjectTemplateServiceFactory } from "@app/ee/services/project-template/project-template-service";
import { InfisicalProjectTemplate } from "@app/ee/services/project-template/project-template-types";
import { TSshCertificateAuthorityDALFactory } from "@app/ee/services/ssh/ssh-certificate-authority-dal";
+import { TSshCertificateAuthoritySecretDALFactory } from "@app/ee/services/ssh/ssh-certificate-authority-secret-dal";
import { TSshCertificateDALFactory } from "@app/ee/services/ssh-certificate/ssh-certificate-dal";
import { TSshCertificateTemplateDALFactory } from "@app/ee/services/ssh-certificate-template/ssh-certificate-template-dal";
+import { TSshHostDALFactory } from "@app/ee/services/ssh-host/ssh-host-dal";
import { TKeyStoreFactory } from "@app/keystore/keystore";
+ import { getConfig } from "@app/lib/config/env";
import { infisicalSymmetricEncypt } from "@app/lib/crypto/encryption";
import { BadRequestError, ForbiddenRequestError, NotFoundError } from "@app/lib/errors";
import { groupBy } from "@app/lib/fn";
@@@ -59,11 -58,11 +60,12 @@@ import { ROOT_FOLDER_NAME, TSecretFolde
import { TSecretV2BridgeDALFactory } from "../secret-v2-bridge/secret-v2-bridge-dal";
import { TProjectSlackConfigDALFactory } from "../slack/project-slack-config-dal";
import { TSlackIntegrationDALFactory } from "../slack/slack-integration-dal";
+ import { SmtpTemplates, TSmtpService } from "../smtp/smtp-service";
import { TUserDALFactory } from "../user/user-dal";
import { TProjectDALFactory } from "./project-dal";
-import { assignWorkspaceKeysToMembers, createProjectKey } from "./project-fns";
+import { assignWorkspaceKeysToMembers, bootstrapSshProject, createProjectKey } from "./project-fns";
import { TProjectQueueFactory } from "./project-queue";
+import { TProjectSshConfigDALFactory } from "./project-ssh-config-dal";
import {
TCreateProjectDTO,
TDeleteProjectDTO,
@@@ -78,8 -77,9 +80,10 @@@
TListProjectSshCasDTO,
TListProjectSshCertificatesDTO,
TListProjectSshCertificateTemplatesDTO,
+ TListProjectSshHostsDTO,
TLoadProjectKmsBackupDTO,
+ TProjectAccessRequestDTO,
+ TSearchProjectsDTO,
TToggleProjectAutoCapitalizationDTO,
TUpdateAuditLogsRetentionDTO,
TUpdateProjectDTO,
diff --cc backend/src/services/project/project-types.ts
index 906189be28,30519005d8..4195f3dfcf
--- a/backend/src/services/project/project-types.ts
+++ b/backend/src/services/project/project-types.ts
@@@ -1,11 -1,7 +1,11 @@@
import { Knex } from "knex";
- import { ProjectType, TProjectKeys } from "@app/db/schemas";
-import { ProjectType, SortDirection, TProjectKeys } from "@app/db/schemas";
++import { ProjectType, TProjectKeys, SortDirection } from "@app/db/schemas";
+import { TSshCertificateAuthorityDALFactory } from "@app/ee/services/ssh/ssh-certificate-authority-dal";
+import { TSshCertificateAuthoritySecretDALFactory } from "@app/ee/services/ssh/ssh-certificate-authority-secret-dal";
- import { TProjectPermission } from "@app/lib/types";
+import { TKmsServiceFactory } from "@app/services/kms/kms-service";
+import { TProjectSshConfigDALFactory } from "@app/services/project/project-ssh-config-dal";
+ import { OrgServiceActor, TProjectPermission } from "@app/lib/types";
import { ActorAuthMethod, ActorType } from "../auth/auth-type";
@@@ -164,11 -159,22 +164,31 @@@ export type TUpdateProjectSlackConfig
secretRequestChannels: string;
} & TProjectPermission;
+export type TBootstrapSshProjectDTO = {
+ projectId: string;
+ sshCertificateAuthorityDAL: Pick<TSshCertificateAuthorityDALFactory, "transaction" | "create">;
+ sshCertificateAuthoritySecretDAL: Pick<TSshCertificateAuthoritySecretDALFactory, "create">;
+ projectSshConfigDAL: Pick<TProjectSshConfigDALFactory, "create">;
+ kmsService: Pick<TKmsServiceFactory, "createCipherPairWithDataKey">;
+ tx?: Knex;
+};
++
+ export enum SearchProjectSortBy {
+ NAME = "name"
+ }
+
+ export type TSearchProjectsDTO = {
+ permission: OrgServiceActor;
+ name?: string;
+ type?: ProjectType;
+ limit?: number;
+ offset?: number;
+ orderBy?: SearchProjectSortBy;
+ orderDirection?: SortDirection;
+ };
+
+ export type TProjectAccessRequestDTO = {
+ permission: OrgServiceActor;
+ projectId: string;
+ comment?: string;
+ };
diff --cc frontend/src/context/ProjectPermissionContext/types.ts
index ba89e09819,656d9466b8..2a0a3740ff
--- a/frontend/src/context/ProjectPermissionContext/types.ts
+++ b/frontend/src/context/ProjectPermissionContext/types.ts
@@@ -75,13 -75,15 +75,22 @@@ export enum ProjectPermissionGroupActio
GrantPrivileges = "grant-privileges"
}
+export enum ProjectPermissionSshHostActions {
+ Create = "create",
+ Edit = "edit",
+ Delete = "delete",
+ IssueHostCert = "issue-host-cert"
+}
+
+ export enum ProjectPermissionSecretRotationActions {
+ Read = "read",
+ ReadGeneratedCredentials = "read-generated-credentials",
+ Create = "create",
+ Edit = "edit",
+ Delete = "delete",
+ RotateSecrets = "rotate-secrets"
+ }
+
export enum PermissionConditionOperators {
$IN = "$in",
$ALL = "$all",
diff --cc frontend/src/hooks/api/workspace/index.tsx
index 58d60bc1e9,3f5209aca4..c0f5f027d2
--- a/frontend/src/hooks/api/workspace/index.tsx
+++ b/frontend/src/hooks/api/workspace/index.tsx
@@@ -35,8 -36,8 +36,9 @@@ export
useListWorkspaceSshCas,
useListWorkspaceSshCertificates,
useListWorkspaceSshCertificateTemplates,
+ useListWorkspaceSshHosts,
useNameWorkspaceSecrets,
+ useSearchProjects,
useToggleAutoCapitalization,
useUpdateIdentityWorkspaceRole,
useUpdateProject,
diff --cc frontend/src/pages/project/RoleDetailsBySlugPage/components/ProjectRoleModifySection.utils.tsx
index bb42dea0ed,2d77aac839..a53e12ff12
--- a/frontend/src/pages/project/RoleDetailsBySlugPage/components/ProjectRoleModifySection.utils.tsx
+++ b/frontend/src/pages/project/RoleDetailsBySlugPage/components/ProjectRoleModifySection.utils.tsx
@@@ -17,8 -17,8 +17,9 @@@ import
ProjectPermissionKmipActions,
ProjectPermissionMemberActions,
ProjectPermissionSecretActions,
+ ProjectPermissionSecretRotationActions,
ProjectPermissionSecretSyncActions,
+ ProjectPermissionSshHostActions,
TPermissionCondition,
TPermissionConditionOperators
} from "@app/context/ProjectPermissionContext/types";
@@@ -240,8 -241,8 +255,10 @@@ type TConditionalFields
| ProjectPermissionSub.SecretFolders
| ProjectPermissionSub.SecretImports
| ProjectPermissionSub.DynamicSecrets
+ | ProjectPermissionSub.Identity
- | ProjectPermissionSub.SshHosts;
++ | ProjectPermissionSub.SshHosts
+ | ProjectPermissionSub.SecretRotation
+ | ProjectPermissionSub.Identity;
export const isConditionalSubjects = (
subject: ProjectPermissionSub
@@@ -250,8 -251,8 +267,9 @@@
subject === ProjectPermissionSub.DynamicSecrets ||
subject === ProjectPermissionSub.SecretImports ||
subject === ProjectPermissionSub.SecretFolders ||
- subject === ProjectPermissionSub.SecretRotation ||
- subject === ProjectPermissionSub.Identity;
+ subject === ProjectPermissionSub.Identity ||
- subject === ProjectPermissionSub.SshHosts;
++ subject === ProjectPermissionSub.SshHosts ||
++ subject === ProjectPermissionSub.SecretRotation;
const convertCaslConditionToFormOperator = (caslConditions: TPermissionCondition) => {
const formConditions: z.infer<typeof ConditionSchema> = [];