Skip to content

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

Add ssh project default cas

Tuan Dangc2f2a038add9
diff --git a/backend/src/@types/knex.d.ts b/backend/src/@types/knex.d.ts
index 5ad27a6059..277f6f0747 100644
--- a/backend/src/@types/knex.d.ts
+++ b/backend/src/@types/knex.d.ts
@@ -226,6 +226,9 @@ import {
TProjectSplitBackfillIds,
TProjectSplitBackfillIdsInsert,
TProjectSplitBackfillIdsUpdate,
+ TProjectSshConfigs,
+ TProjectSshConfigsInsert,
+ TProjectSshConfigsUpdate,
TProjectsUpdate,
TProjectTemplates,
TProjectTemplatesInsert,
@@ -356,12 +359,12 @@ import {
TSshCertificateTemplates,
TSshCertificateTemplatesInsert,
TSshCertificateTemplatesUpdate,
- TSshHosts,
- TSshHostsInsert,
- TSshHostsUpdate,
TSshHostLoginMappings,
TSshHostLoginMappingsInsert,
TSshHostLoginMappingsUpdate,
+ TSshHosts,
+ TSshHostsInsert,
+ TSshHostsUpdate,
TSuperAdmin,
TSuperAdminInsert,
TSuperAdminUpdate,
@@ -560,6 +563,11 @@ declare module "knex/types/tables" {
[TableName.SuperAdmin]: KnexOriginal.CompositeTableType<TSuperAdmin, TSuperAdminInsert, TSuperAdminUpdate>;
[TableName.ApiKey]: KnexOriginal.CompositeTableType<TApiKeys, TApiKeysInsert, TApiKeysUpdate>;
[TableName.Project]: KnexOriginal.CompositeTableType<TProjects, TProjectsInsert, TProjectsUpdate>;
+ [TableName.ProjectSshConfig]: KnexOriginal.CompositeTableType<
+ TProjectSshConfigs,
+ TProjectSshConfigsInsert,
+ TProjectSshConfigsUpdate
+ >;
[TableName.ProjectMembership]: KnexOriginal.CompositeTableType<
TProjectMemberships,
TProjectMembershipsInsert,
diff --git a/backend/src/db/migrations/20250405185753_ssh-mgmt-v2.ts b/backend/src/db/migrations/20250405185753_ssh-mgmt-v2.ts
index 14616da8d2..9f49f9f917 100644
--- a/backend/src/db/migrations/20250405185753_ssh-mgmt-v2.ts
+++ b/backend/src/db/migrations/20250405185753_ssh-mgmt-v2.ts
@@ -13,6 +13,10 @@ export async function up(knex: Knex): Promise<void> {
t.string("hostname").notNullable();
t.string("userCertTtl").notNullable();
t.string("hostCertTtl").notNullable();
+ t.uuid("userSshCaId").notNullable();
+ t.foreign("userSshCaId").references("id").inTable(TableName.SshCertificateAuthority).onDelete("CASCADE");
+ t.uuid("hostSshCaId").notNullable();
+ t.foreign("hostSshCaId").references("id").inTable(TableName.SshCertificateAuthority).onDelete("CASCADE");
});
await createOnUpdateTrigger(knex, TableName.SshHost);
}
@@ -28,9 +32,27 @@ export async function up(knex: Knex): Promise<void> {
});
await createOnUpdateTrigger(knex, TableName.SshHostLoginMapping);
}
+
+ if (!(await knex.schema.hasTable(TableName.ProjectSshConfig))) {
+ // new table to store configuration for projects of type SSH (i.e. Infisical SSH)
+ await knex.schema.createTable(TableName.ProjectSshConfig, (t) => {
+ t.uuid("id", { primaryKey: true }).defaultTo(knex.fn.uuid());
+ t.timestamps(true, true, true);
+ t.string("projectId").notNullable();
+ t.foreign("projectId").references("id").inTable(TableName.Project).onDelete("CASCADE");
+ t.uuid("defaultUserSshCaId");
+ t.foreign("defaultUserSshCaId").references("id").inTable(TableName.SshCertificateAuthority).onDelete("CASCADE");
+ t.uuid("defaultHostSshCaId");
+ t.foreign("defaultHostSshCaId").references("id").inTable(TableName.SshCertificateAuthority).onDelete("CASCADE");
+ });
+ await createOnUpdateTrigger(knex, TableName.ProjectSshConfig);
+ }
}
export async function down(knex: Knex): Promise<void> {
+ await knex.schema.dropTableIfExists(TableName.ProjectSshConfig);
+ await dropOnUpdateTrigger(knex, TableName.ProjectSshConfig);
+
await knex.schema.dropTableIfExists(TableName.SshHostLoginMapping);
await dropOnUpdateTrigger(knex, TableName.SshHostLoginMapping);
diff --git a/backend/src/db/schemas/access-approval-policies-approvers.ts b/backend/src/db/schemas/access-approval-policies-approvers.ts
index db61e60c5a..1ecd805138 100644
--- a/backend/src/db/schemas/access-approval-policies-approvers.ts
+++ b/backend/src/db/schemas/access-approval-policies-approvers.ts
@@ -5,8 +5,6 @@
import { z } from "zod";
-
-
import { TImmutableDBKeys } from "./models";
export const AccessApprovalPoliciesApproversSchema = z.object({
@@ -19,5 +17,10 @@ export const AccessApprovalPoliciesApproversSchema = z.object({
});
export type TAccessApprovalPoliciesApprovers = z.infer<typeof AccessApprovalPoliciesApproversSchema>;
-export type TAccessApprovalPoliciesApproversInsert = Omit<z.input<typeof AccessApprovalPoliciesApproversSchema>, TImmutableDBKeys>;
-export type TAccessApprovalPoliciesApproversUpdate = Partial<Omit<z.input<typeof AccessApprovalPoliciesApproversSchema>, TImmutableDBKeys>>;
+export type TAccessApprovalPoliciesApproversInsert = Omit<
+ z.input<typeof AccessApprovalPoliciesApproversSchema>,
+ TImmutableDBKeys
+>;
+export type TAccessApprovalPoliciesApproversUpdate = Partial<
+ Omit<z.input<typeof AccessApprovalPoliciesApproversSchema>, TImmutableDBKeys>
+>;
diff --git a/backend/src/db/schemas/access-approval-policies.ts b/backend/src/db/schemas/access-approval-policies.ts
index 9f207e2d40..19a98675fe 100644
--- a/backend/src/db/schemas/access-approval-policies.ts
+++ b/backend/src/db/schemas/access-approval-policies.ts
@@ -5,8 +5,6 @@
import { z } from "zod";
-
-
import { TImmutableDBKeys } from "./models";
export const AccessApprovalPoliciesSchema = z.object({
@@ -17,11 +15,13 @@ export const AccessApprovalPoliciesSchema = z.object({
envId: z.string().uuid(),
createdAt: z.date(),
updatedAt: z.date(),
- enforcementLevel: z.string().default('hard'),
+ enforcementLevel: z.string().default("hard"),
deletedAt: z.date().nullable().optional(),
allowedSelfApprovals: z.boolean().default(true)
});
export type TAccessApprovalPolicies = z.infer<typeof AccessApprovalPoliciesSchema>;
export type TAccessApprovalPoliciesInsert = Omit<z.input<typeof AccessApprovalPoliciesSchema>, TImmutableDBKeys>;
-export type TAccessApprovalPoliciesUpdate = Partial<Omit<z.input<typeof AccessApprovalPoliciesSchema>, TImmutableDBKeys>>;
+export type TAccessApprovalPoliciesUpdate = Partial<
+ Omit<z.input<typeof AccessApprovalPoliciesSchema>, TImmutableDBKeys>
+>;
diff --git a/backend/src/db/schemas/access-approval-requests-reviewers.ts b/backend/src/db/schemas/access-approval-requests-reviewers.ts
index cf87545c5a..a209df2061 100644
--- a/backend/src/db/schemas/access-approval-requests-reviewers.ts
+++ b/backend/src/db/schemas/access-approval-requests-reviewers.ts
@@ -5,8 +5,6 @@
import { z } from "zod";
-
-
import { TImmutableDBKeys } from "./models";
export const AccessApprovalRequestsReviewersSchema = z.object({
@@ -20,5 +18,10 @@ export const AccessApprovalRequestsReviewersSchema = z.object({
});
export type TAccessApprovalRequestsReviewers = z.infer<typeof AccessApprovalRequestsReviewersSchema>;
-export type TAccessApprovalRequestsReviewersInsert = Omit<z.input<typeof AccessApprovalRequestsReviewersSchema>, TImmutableDBKeys>;
-export type TAccessApprovalRequestsReviewersUpdate = Partial<Omit<z.input<typeof AccessApprovalRequestsReviewersSchema>, TImmutableDBKeys>>;
+export type TAccessApprovalRequestsReviewersInsert = Omit<
+ z.input<typeof AccessApprovalRequestsReviewersSchema>,
+ TImmutableDBKeys
+>;
+export type TAccessApprovalRequestsReviewersUpdate = Partial<
+ Omit<z.input<typeof AccessApprovalRequestsReviewersSchema>, TImmutableDBKeys>
+>;
diff --git a/backend/src/db/schemas/access-approval-requests.ts b/backend/src/db/schemas/access-approval-requests.ts
index 12d8644bf5..0b20202f5a 100644
--- a/backend/src/db/schemas/access-approval-requests.ts
+++ b/backend/src/db/schemas/access-approval-requests.ts
@@ -5,8 +5,6 @@
import { z } from "zod";
-
-
import { TImmutableDBKeys } from "./models";
export const AccessApprovalRequestsSchema = z.object({
@@ -24,4 +22,6 @@ export const AccessApprovalRequestsSchema = z.object({
export type TAccessApprovalRequests = z.infer<typeof AccessApprovalRequestsSchema>;
export type TAccessApprovalRequestsInsert = Omit<z.input<typeof AccessApprovalRequestsSchema>, TImmutableDBKeys>;
-export type TAccessApprovalRequestsUpdate = Partial<Omit<z.input<typeof AccessApprovalRequestsSchema>, TImmutableDBKeys>>;
+export type TAccessApprovalRequestsUpdate = Partial<
+ Omit<z.input<typeof AccessApprovalRequestsSchema>, TImmutableDBKeys>
+>;
diff --git a/backend/src/db/schemas/api-keys.ts b/backend/src/db/schemas/api-keys.ts
index 1db00d26ad..cf836fd888 100644
--- a/backend/src/db/schemas/api-keys.ts
+++ b/backend/src/db/schemas/api-keys.ts
@@ -5,8 +5,6 @@
import { z } from "zod";
-
-
import { TImmutableDBKeys } from "./models";
export const ApiKeysSchema = z.object({
diff --git a/backend/src/db/schemas/audit-log-streams.ts b/backend/src/db/schemas/audit-log-streams.ts
index 582401c07a..901dd8d272 100644
--- a/backend/src/db/schemas/audit-log-streams.ts
+++ b/backend/src/db/schemas/audit-log-streams.ts
@@ -5,8 +5,6 @@
import { z } from "zod";
-
-
import { TImmutableDBKeys } from "./models";
export const AuditLogStreamsSchema = z.object({
diff --git a/backend/src/db/schemas/audit-logs.ts b/backend/src/db/schemas/audit-logs.ts
index 4301d94fd2..d1c239724c 100644
--- a/backend/src/db/schemas/audit-logs.ts
+++ b/backend/src/db/schemas/audit-logs.ts
@@ -5,8 +5,6 @@
import { z } from "zod";
-
-
import { TImmutableDBKeys } from "./models";
export const AuditLogsSchema = z.object({
diff --git a/backend/src/db/schemas/auth-token-sessions.ts b/backend/src/db/schemas/auth-token-sessions.ts
index 3f87f9832f..3a9376c835 100644
--- a/backend/src/db/schemas/auth-token-sessions.ts
+++ b/backend/src/db/schemas/auth-token-sessions.ts
@@ -5,8 +5,6 @@
import { z } from "zod";
-
-
import { TImmutableDBKeys } from "./models";
export const AuthTokenSessionsSchema = z.object({
diff --git a/backend/src/db/schemas/auth-tokens.ts b/backend/src/db/schemas/auth-tokens.ts
index 507cfb9427..dd8563b856 100644
--- a/backend/src/db/schemas/auth-tokens.ts
+++ b/backend/src/db/schemas/auth-tokens.ts
@@ -5,8 +5,6 @@
import { z } from "zod";
-
-
import { TImmutableDBKeys } from "./models";
export const AuthTokensSchema = z.object({
diff --git a/backend/src/db/schemas/backup-private-key.ts b/backend/src/db/schemas/backup-private-key.ts
index 93a24315d8..5a2148aa1d 100644
--- a/backend/src/db/schemas/backup-private-key.ts
+++ b/backend/src/db/schemas/backup-private-key.ts
@@ -5,8 +5,6 @@
import { z } from "zod";
-
-
import { TImmutableDBKeys } from "./models";
export const BackupPrivateKeySchema = z.object({
diff --git a/backend/src/db/schemas/certificate-authorities.ts b/backend/src/db/schemas/certificate-authorities.ts
index 070405f61e..ffe0f7c44c 100644
--- a/backend/src/db/schemas/certificate-authorities.ts
+++ b/backend/src/db/schemas/certificate-authorities.ts
@@ -5,8 +5,6 @@
import { z } from "zod";
-
-
import { TImmutableDBKeys } from "./models";
export const CertificateAuthoritiesSchema = z.object({
@@ -36,4 +34,6 @@ export const CertificateAuthoritiesSchema = z.object({
export type TCertificateAuthorities = z.infer<typeof CertificateAuthoritiesSchema>;
export type TCertificateAuthoritiesInsert = Omit<z.input<typeof CertificateAuthoritiesSchema>, TImmutableDBKeys>;
-export type TCertificateAuthoritiesUpdate = Partial<Omit<z.input<typeof CertificateAuthoritiesSchema>, TImmutableDBKeys>>;
+export type TCertificateAuthoritiesUpdate = Partial<
+ Omit<z.input<typeof CertificateAuthoritiesSchema>, TImmutableDBKeys>
+>;
diff --git a/backend/src/db/schemas/certificate-authority-certs.ts b/backend/src/db/schemas/certificate-authority-certs.ts
index b18fc4f202..7074ce409b 100644
--- a/backend/src/db/schemas/certificate-authority-certs.ts
+++ b/backend/src/db/schemas/certificate-authority-certs.ts
@@ -22,4 +22,6 @@ export const CertificateAuthorityCertsSchema = z.object({
export type TCertificateAuthorityCerts = z.infer<typeof CertificateAuthorityCertsSchema>;
export type TCertificateAuthorityCertsInsert = Omit<z.input<typeof CertificateAuthorityCertsSchema>, TImmutableDBKeys>;
-export type TCertificateAuthorityCertsUpdate = Partial<Omit<z.input<typeof CertificateAuthorityCertsSchema>, TImmutableDBKeys>>;
+export type TCertificateAuthorityCertsUpdate = Partial<
+ Omit<z.input<typeof CertificateAuthorityCertsSchema>, TImmutableDBKeys>
+>;
diff --git a/backend/src/db/schemas/certificate-authority-crl.ts b/backend/src/db/schemas/certificate-authority-crl.ts
index b57e944357..3d63be5d8e 100644
--- a/backend/src/db/schemas/certificate-authority-crl.ts
+++ b/backend/src/db/schemas/certificate-authority-crl.ts
@@ -20,4 +20,6 @@ export const CertificateAuthorityCrlSchema = z.object({
export type TCertificateAuthorityCrl = z.infer<typeof CertificateAuthorityCrlSchema>;
export type TCertificateAuthorityCrlInsert = Omit<z.input<typeof CertificateAuthorityCrlSchema>, TImmutableDBKeys>;
-export type TCertificateAuthorityCrlUpdate = Partial<Omit<z.input<typeof CertificateAuthorityCrlSchema>, TImmutableDBKeys>>;
+export type TCertificateAuthorityCrlUpdate = Partial<
+ Omit<z.input<typeof CertificateAuthorityCrlSchema>, TImmutableDBKeys>
+>;
diff --git a/backend/src/db/schemas/certificate-authority-secret.ts b/backend/src/db/schemas/certificate-authority-secret.ts
index d3128d5bf5..36ab1c5060 100644
--- a/backend/src/db/schemas/certificate-authority-secret.ts
+++ b/backend/src/db/schemas/certificate-authority-secret.ts
@@ -18,5 +18,10 @@ export const CertificateAuthoritySecretSchema = z.object({
});
export type TCertificateAuthoritySecret = z.infer<typeof CertificateAuthoritySecretSchema>;
-export type TCertificateAuthoritySecretInsert = Omit<z.input<typeof CertificateAuthoritySecretSchema>, TImmutableDBKeys>;
-export type TCertificateAuthoritySecretUpdate = Partial<Omit<z.input<typeof CertificateAuthoritySecretSchema>, TImmutableDBKeys>>;
+export type TCertificateAuthoritySecretInsert = Omit<
+ z.input<typeof CertificateAuthoritySecretSchema>,
+ TImmutableDBKeys
+>;
+export type TCertificateAuthoritySecretUpdate = Partial<
+ Omit<z.input<typeof CertificateAuthoritySecretSchema>, TImmutableDBKeys>
+>;
diff --git a/backend/src/db/schemas/certificate-template-est-configs.ts b/backend/src/db/schemas/certificate-template-est-configs.ts
index 8dc2ec8b9f..262f22b069 100644
--- a/backend/src/db/schemas/certificate-template-est-configs.ts
+++ b/backend/src/db/schemas/certificate-template-est-configs.ts
@@ -21,5 +21,10 @@ export const CertificateTemplateEstConfigsSchema = z.object({
});
export type TCertificateTemplateEstConfigs = z.infer<typeof CertificateTemplateEstConfigsSchema>;
-export type TCertificateTemplateEstConfigsInsert = Omit<z.input<typeof CertificateTemplateEstConfigsSchema>, TImmutableDBKeys>;
-export type TCertificateTemplateEstConfigsUpdate = Partial<Omit<z.input<typeof CertificateTemplateEstConfigsSchema>, TImmutableDBKeys>>;
+export type TCertificateTemplateEstConfigsInsert = Omit<
+ z.input<typeof CertificateTemplateEstConfigsSchema>,
+ TImmutableDBKeys
+>;
+export type TCertificateTemplateEstConfigsUpdate = Partial<
+ Omit<z.input<typeof CertificateTemplateEstConfigsSchema>, TImmutableDBKeys>
+>;
diff --git a/backend/src/db/schemas/certificate-templates.ts b/backend/src/db/schemas/certificate-templates.ts
index 793315d052..c332d7cf7b 100644
--- a/backend/src/db/schemas/certificate-templates.ts
+++ b/backend/src/db/schemas/certificate-templates.ts
@@ -5,8 +5,6 @@
import { z } from "zod";
-
-
import { TImmutableDBKeys } from "./models";
export const CertificateTemplatesSchema = z.object({
diff --git a/backend/src/db/schemas/certificates.ts b/backend/src/db/schemas/certificates.ts
index 6f7f94ed0f..bde35002f8 100644
--- a/backend/src/db/schemas/certificates.ts
+++ b/backend/src/db/schemas/certificates.ts
@@ -5,8 +5,6 @@
import { z } from "zod";
-
-
import { TImmutableDBKeys } from "./models";
export const CertificatesSchema = z.object({
@@ -22,7 +20,7 @@ export const CertificatesSchema = z.object({
notAfter: z.date(),
revokedAt: z.date().nullable().optional(),
revocationReason: z.number().nullable().optional(),
- altNames: z.string().default('').nullable().optional(),
+ altNames: z.string().default("").nullable().optional(),
caCertId: z.string().uuid(),
certificateTemplateId: z.string().uuid().nullable().optional(),
keyUsages: z.string().array().nullable().optional(),
diff --git a/backend/src/db/schemas/dynamic-secret-leases.ts b/backend/src/db/schemas/dynamic-secret-leases.ts
index 31ccdb32be..8c16bcb55d 100644
--- a/backend/src/db/schemas/dynamic-secret-leases.ts
+++ b/backend/src/db/schemas/dynamic-secret-leases.ts
@@ -5,8 +5,6 @@
import { z } from "zod";
-
-
import { TImmutableDBKeys } from "./models";
export const DynamicSecretLeasesSchema = z.object({
diff --git a/backend/src/db/schemas/dynamic-secrets.ts b/backend/src/db/schemas/dynamic-secrets.ts
index fac36af7f0..913a6d4755 100644
--- a/backend/src/db/schemas/dynamic-secrets.ts
+++ b/backend/src/db/schemas/dynamic-secrets.ts
@@ -19,8 +19,8 @@ export const DynamicSecretsSchema = z.object({
inputIV: z.string().nullable().optional(),
inputCiphertext: z.string().nullable().optional(),
inputTag: z.string().nullable().optional(),
- algorithm: z.string().default('aes-256-gcm'),
- keyEncoding: z.string().default('utf8'),
+ algorithm: z.string().default("aes-256-gcm"),
+ keyEncoding: z.string().default("utf8"),
folderId: z.string().uuid(),
status: z.string().nullable().optional(),
statusDetails: z.string().nullable().optional(),
diff --git a/backend/src/db/schemas/external-group-org-role-mappings.ts b/backend/src/db/schemas/external-group-org-role-mappings.ts
index 6b38c6421b..f7e6eab25d 100644
--- a/backend/src/db/schemas/external-group-org-role-mappings.ts
+++ b/backend/src/db/schemas/external-group-org-role-mappings.ts
@@ -5,8 +5,6 @@
import { z } from "zod";
-
-
import { TImmutableDBKeys } from "./models";
export const ExternalGroupOrgRoleMappingsSchema = z.object({
@@ -20,5 +18,10 @@ export const ExternalGroupOrgRoleMappingsSchema = z.object({
});
export type TExternalGroupOrgRoleMappings = z.infer<typeof ExternalGroupOrgRoleMappingsSchema>;
-export type TExternalGroupOrgRoleMappingsInsert = Omit<z.input<typeof ExternalGroupOrgRoleMappingsSchema>, TImmutableDBKeys>;
-export type TExternalGroupOrgRoleMappingsUpdate = Partial<Omit<z.input<typeof ExternalGroupOrgRoleMappingsSchema>, TImmutableDBKeys>>;
+export type TExternalGroupOrgRoleMappingsInsert = Omit<
+ z.input<typeof ExternalGroupOrgRoleMappingsSchema>,
+ TImmutableDBKeys
+>;
+export type TExternalGroupOrgRoleMappingsUpdate = Partial<
+ Omit<z.input<typeof ExternalGroupOrgRoleMappingsSchema>, TImmutableDBKeys>
+>;
diff --git a/backend/src/db/schemas/git-app-install-sessions.ts b/backend/src/db/schemas/git-app-install-sessions.ts
index 7100f1108f..986ae9d8e8 100644
--- a/backend/src/db/schemas/git-app-install-sessions.ts
+++ b/backend/src/db/schemas/git-app-install-sessions.ts
@@ -5,8 +5,6 @@
import { z } from "zod";
-
-
import { TImmutableDBKeys } from "./models";
export const GitAppInstallSessionsSchema = z.object({
diff --git a/backend/src/db/schemas/git-app-org.ts b/backend/src/db/schemas/git-app-org.ts
index ffc45eb80a..627df6b4cb 100644
--- a/backend/src/db/schemas/git-app-org.ts
+++ b/backend/src/db/schemas/git-app-org.ts
@@ -5,8 +5,6 @@
import { z } from "zod";
-
-
import { TImmutableDBKeys } from "./models";
export const GitAppOrgSchema = z.object({
diff --git a/backend/src/db/schemas/group-project-membership-roles.ts b/backend/src/db/schemas/group-project-membership-roles.ts
index b2c3f57f16..d837ca8e7e 100644
--- a/backend/src/db/schemas/group-project-membership-roles.ts
+++ b/backend/src/db/schemas/group-project-membership-roles.ts
@@ -5,8 +5,6 @@
import { z } from "zod";
-
-
import { TImmutableDBKeys } from "./models";
export const GroupProjectMembershipRolesSchema = z.object({
@@ -24,5 +22,10 @@ export const GroupProjectMembershipRolesSchema = z.object({
});
export type TGroupProjectMembershipRoles = z.infer<typeof GroupProjectMembershipRolesSchema>;
-export type TGroupProjectMembershipRolesInsert = Omit<z.input<typeof GroupProjectMembershipRolesSchema>, TImmutableDBKeys>;
-export type TGroupProjectMembershipRolesUpdate = Partial<Omit<z.input<typeof GroupProjectMembershipRolesSchema>, TImmutableDBKeys>>;
+export type TGroupProjectMembershipRolesInsert = Omit<
+ z.input<typeof GroupProjectMembershipRolesSchema>,
+ TImmutableDBKeys
+>;
+export type TGroupProjectMembershipRolesUpdate = Partial<
+ Omit<z.input<typeof GroupProjectMembershipRolesSchema>, TImmutableDBKeys>
+>;
diff --git a/backend/src/db/schemas/group-project-memberships.ts b/backend/src/db/schemas/group-project-memberships.ts
index cc5f0f2ff1..7787a3574a 100644
--- a/backend/src/db/schemas/group-project-memberships.ts
+++ b/backend/src/db/schemas/group-project-memberships.ts
@@ -5,8 +5,6 @@
import { z } from "zod";
-
-
import { TImmutableDBKeys } from "./models";
export const GroupProjectMembershipsSchema = z.object({
@@ -19,4 +17,6 @@ export const GroupProjectMembershipsSchema = z.object({
export type TGroupProjectMemberships = z.infer<typeof GroupProjectMembershipsSchema>;
export type TGroupProjectMembershipsInsert = Omit<z.input<typeof GroupProjectMembershipsSchema>, TImmutableDBKeys>;
-export type TGroupProjectMembershipsUpdate = Partial<Omit<z.input<typeof GroupProjectMembershipsSchema>, TImmutableDBKeys>>;
+export type TGroupProjectMembershipsUpdate = Partial<
+ Omit<z.input<typeof GroupProjectMembershipsSchema>, TImmutableDBKeys>
+>;
diff --git a/backend/src/db/schemas/groups.ts b/backend/src/db/schemas/groups.ts
index cf1bfbd6df..9733d253e3 100644
--- a/backend/src/db/schemas/groups.ts
+++ b/backend/src/db/schemas/groups.ts
@@ -5,8 +5,6 @@
import { z } from "zod";
-
-
import { TImmutableDBKeys } from "./models";
export const GroupsSchema = z.object({
diff --git a/backend/src/db/schemas/identities.ts b/backend/src/db/schemas/identities.ts
index bf51f13ac0..adf3a6ef27 100644
--- a/backend/src/db/schemas/identities.ts
+++ b/backend/src/db/schemas/identities.ts
@@ -5,8 +5,6 @@
import { z } from "zod";
-
-
import { TImmutableDBKeys } from "./models";
export const IdentitiesSchema = z.object({
diff --git a/backend/src/db/schemas/identity-access-tokens.ts b/backend/src/db/schemas/identity-access-tokens.ts
index c6642903a6..bbff1b88cf 100644
--- a/backend/src/db/schemas/identity-access-tokens.ts
+++ b/backend/src/db/schemas/identity-access-tokens.ts
@@ -5,8 +5,6 @@
import { z } from "zod";
-
-
import { TImmutableDBKeys } from "./models";
export const IdentityAccessTokensSchema = z.object({
diff --git a/backend/src/db/schemas/identity-aws-auths.ts b/backend/src/db/schemas/identity-aws-auths.ts
index 98dfe745ad..f4444b00ff 100644
--- a/backend/src/db/schemas/identity-aws-auths.ts
+++ b/backend/src/db/schemas/identity-aws-auths.ts
@@ -5,8 +5,6 @@
import { z } from "zod";
-
-
import { TImmutableDBKeys } from "./models";
export const IdentityAwsAuthsSchema = z.object({
diff --git a/backend/src/db/schemas/identity-azure-auths.ts b/backend/src/db/schemas/identity-azure-auths.ts
index b595c6c0b8..856f7b8f10 100644
--- a/backend/src/db/schemas/identity-azure-auths.ts
+++ b/backend/src/db/schemas/identity-azure-auths.ts
@@ -5,8 +5,6 @@
import { z } from "zod";
-
-
import { TImmutableDBKeys } from "./models";
export const IdentityAzureAuthsSchema = z.object({
diff --git a/backend/src/db/schemas/identity-gcp-auths.ts b/backend/src/db/schemas/identity-gcp-auths.ts
index 2ff644bdbb..208058f602 100644
--- a/backend/src/db/schemas/identity-gcp-auths.ts
+++ b/backend/src/db/schemas/identity-gcp-auths.ts
@@ -5,8 +5,6 @@
import { z } from "zod";
-
-
import { TImmutableDBKeys } from "./models";
export const IdentityGcpAuthsSchema = z.object({
diff --git a/backend/src/db/schemas/identity-kubernetes-auths.ts b/backend/src/db/schemas/identity-kubernetes-auths.ts
index 57efbd2b5c..448cec386f 100644
--- a/backend/src/db/schemas/identity-kubernetes-auths.ts
+++ b/backend/src/db/schemas/identity-kubernetes-auths.ts
@@ -34,4 +34,6 @@ export const IdentityKubernetesAuthsSchema = z.object({
export type TIdentityKubernetesAuths = z.infer<typeof IdentityKubernetesAuthsSchema>;
export type TIdentityKubernetesAuthsInsert = Omit<z.input<typeof IdentityKubernetesAuthsSchema>, TImmutableDBKeys>;
-export type TIdentityKubernetesAuthsUpdate = Partial<Omit<z.input<typeof IdentityKubernetesAuthsSchema>, TImmutableDBKeys>>;
+export type TIdentityKubernetesAuthsUpdate = Partial<
+ Omit<z.input<typeof IdentityKubernetesAuthsSchema>, TImmutableDBKeys>
+>;
diff --git a/backend/src/db/schemas/identity-metadata.ts b/backend/src/db/schemas/identity-metadata.ts
index 2584677be2..de1cec104e 100644
--- a/backend/src/db/schemas/identity-metadata.ts
+++ b/backend/src/db/schemas/identity-metadata.ts
@@ -5,8 +5,6 @@
import { z } from "zod";
-
-
import { TImmutableDBKeys } from "./models";
export const IdentityMetadataSchema = z.object({
diff --git a/backend/src/db/schemas/identity-org-memberships.ts b/backend/src/db/schemas/identity-org-memberships.ts
index 71c6c49dde..2f29c52e43 100644
--- a/backend/src/db/schemas/identity-org-memberships.ts
+++ b/backend/src/db/schemas/identity-org-memberships.ts
@@ -5,8 +5,6 @@
import { z } from "zod";
-
-
import { TImmutableDBKeys } from "./models";
export const IdentityOrgMembershipsSchema = z.object({
@@ -21,4 +19,6 @@ export const IdentityOrgMembershipsSchema = z.object({
export type TIdentityOrgMemberships = z.infer<typeof IdentityOrgMembershipsSchema>;
export type TIdentityOrgMembershipsInsert = Omit<z.input<typeof IdentityOrgMembershipsSchema>, TImmutableDBKeys>;
-export type TIdentityOrgMembershipsUpdate = Partial<Omit<z.input<typeof IdentityOrgMembershipsSchema>, TImmutableDBKeys>>;
+export type TIdentityOrgMembershipsUpdate = Partial<
+ Omit<z.input<typeof IdentityOrgMembershipsSchema>, TImmutableDBKeys>
+>;
diff --git a/backend/src/db/schemas/identity-project-additional-privilege.ts b/backend/src/db/schemas/identity-project-additional-privilege.ts
index 564fabfec1..7a9dbe19eb 100644
--- a/backend/src/db/schemas/identity-project-additional-privilege.ts
+++ b/backend/src/db/schemas/identity-project-additional-privilege.ts
@@ -5,8 +5,6 @@
import { z } from "zod";
-
-
import { TImmutableDBKeys } from "./models";
export const IdentityProjectAdditionalPrivilegeSchema = z.object({
@@ -24,5 +22,10 @@ export const IdentityProjectAdditionalPrivilegeSchema = z.object({
});
export type TIdentityProjectAdditionalPrivilege = z.infer<typeof IdentityProjectAdditionalPrivilegeSchema>;
-export type TIdentityProjectAdditionalPrivilegeInsert = Omit<z.input<typeof IdentityProjectAdditionalPrivilegeSchema>, TImmutableDBKeys>;
-export type TIdentityProjectAdditionalPrivilegeUpdate = Partial<Omit<z.input<typeof IdentityProjectAdditionalPrivilegeSchema>, TImmutableDBKeys>>;
+export type TIdentityProjectAdditionalPrivilegeInsert = Omit<
+ z.input<typeof IdentityProjectAdditionalPrivilegeSchema>,
+ TImmutableDBKeys
+>;
+export type TIdentityProjectAdditionalPrivilegeUpdate = Partial<
+ Omit<z.input<typeof IdentityProjectAdditionalPrivilegeSchema>, TImmutableDBKeys>
+>;
diff --git a/backend/src/db/schemas/identity-project-membership-role.ts b/backend/src/db/schemas/identity-project-membership-role.ts
index 50ae2602ef..90a0a35388 100644
--- a/backend/src/db/schemas/identity-project-membership-role.ts
+++ b/backend/src/db/schemas/identity-project-membership-role.ts
@@ -5,8 +5,6 @@
import { z } from "zod";
-
-
import { TImmutableDBKeys } from "./models";
export const IdentityProjectMembershipRoleSchema = z.object({
@@ -24,5 +22,10 @@ export const IdentityProjectMembershipRoleSchema = z.object({
});
export type TIdentityProjectMembershipRole = z.infer<typeof IdentityProjectMembershipRoleSchema>;
-export type TIdentityProjectMembershipRoleInsert = Omit<z.input<typeof IdentityProjectMembershipRoleSchema>, TImmutableDBKeys>;
-export type TIdentityProjectMembershipRoleUpdate = Partial<Omit<z.input<typeof IdentityProjectMembershipRoleSchema>, TImmutableDBKeys>>;
+export type TIdentityProjectMembershipRoleInsert = Omit<
+ z.input<typeof IdentityProjectMembershipRoleSchema>,
+ TImmutableDBKeys
+>;
+export type TIdentityProjectMembershipRoleUpdate = Partial<
+ Omit<z.input<typeof IdentityProjectMembershipRoleSchema>, TImmutableDBKeys>
+>;
diff --git a/backend/src/db/schemas/identity-project-memberships.ts b/backend/src/db/schemas/identity-project-memberships.ts
index 26e2de10ff..2f17c36d86 100644
--- a/backend/src/db/schemas/identity-project-memberships.ts
+++ b/backend/src/db/schemas/identity-project-memberships.ts
@@ -5,8 +5,6 @@
import { z } from "zod";
-
-
import { TImmutableDBKeys } from "./models";
export const IdentityProjectMembershipsSchema = z.object({
@@ -18,5 +16,10 @@ export const IdentityProjectMembershipsSchema = z.object({
});
export type TIdentityProjectMemberships = z.infer<typeof IdentityProjectMembershipsSchema>;
-export type TIdentityProjectMembershipsInsert = Omit<z.input<typeof IdentityProjectMembershipsSchema>, TImmutableDBKeys>;
-export type TIdentityProjectMembershipsUpdate = Partial<Omit<z.input<typeof IdentityProjectMembershipsSchema>, TImmutableDBKeys>>;
+export type TIdentityProjectMembershipsInsert = Omit<
+ z.input<typeof IdentityProjectMembershipsSchema>,
+ TImmutableDBKeys
+>;
+export type TIdentityProjectMembershipsUpdate = Partial<
+ Omit<z.input<typeof IdentityProjectMembershipsSchema>, TImmutableDBKeys>
+>;
diff --git a/backend/src/db/schemas/identity-token-auths.ts b/backend/src/db/schemas/identity-token-auths.ts
index 2ff183ae7c..0f3c8c9ff6 100644
--- a/backend/src/db/schemas/identity-token-auths.ts
+++ b/backend/src/db/schemas/identity-token-auths.ts
@@ -5,8 +5,6 @@
import { z } from "zod";
-
-
import { TImmutableDBKeys } from "./models";
export const IdentityTokenAuthsSchema = z.object({
diff --git a/backend/src/db/schemas/identity-ua-client-secrets.ts b/backend/src/db/schemas/identity-ua-client-secrets.ts
index 61eb8e57a5..bd549ca5b1 100644
--- a/backend/src/db/schemas/identity-ua-client-secrets.ts
+++ b/backend/src/db/schemas/identity-ua-client-secrets.ts
@@ -5,8 +5,6 @@
import { z } from "zod";
-
-
import { TImmutableDBKeys } from "./models";
export const IdentityUaClientSecretsSchema = z.object({
@@ -26,4 +24,6 @@ export const IdentityUaClientSecretsSchema = z.object({
export type TIdentityUaClientSecrets = z.infer<typeof IdentityUaClientSecretsSchema>;
export type TIdentityUaClientSecretsInsert = Omit<z.input<typeof IdentityUaClientSecretsSchema>, TImmutableDBKeys>;
-export type TIdentityUaClientSecretsUpdate = Partial<Omit<z.input<typeof IdentityUaClientSecretsSchema>, TImmutableDBKeys>>;
+export type TIdentityUaClientSecretsUpdate = Partial<
+ Omit<z.input<typeof IdentityUaClientSecretsSchema>, TImmutableDBKeys>
+>;
diff --git a/backend/src/db/schemas/identity-universal-auths.ts b/backend/src/db/schemas/identity-universal-auths.ts
index 5be5c675bb..eeec2f666a 100644
--- a/backend/src/db/schemas/identity-universal-auths.ts
+++ b/backend/src/db/schemas/identity-universal-auths.ts
@@ -5,8 +5,6 @@
import { z } from "zod";
-
-
import { TImmutableDBKeys } from "./models";
export const IdentityUniversalAuthsSchema = z.object({
@@ -24,4 +22,6 @@ export const IdentityUniversalAuthsSchema = z.object({
export type TIdentityUniversalAuths = z.infer<typeof IdentityUniversalAuthsSchema>;
export type TIdentityUniversalAuthsInsert = Omit<z.input<typeof IdentityUniversalAuthsSchema>, TImmutableDBKeys>;
-export type TIdentityUniversalAuthsUpdate = Partial<Omit<z.input<typeof IdentityUniversalAuthsSchema>, TImmutableDBKeys>>;
+export type TIdentityUniversalAuthsUpdate = Partial<
+ Omit<z.input<typeof IdentityUniversalAuthsSchema>, TImmutableDBKeys>
+>;
diff --git a/backend/src/db/schemas/incident-contacts.ts b/backend/src/db/schemas/incident-contacts.ts
index b6d86d9302..23c8503b08 100644
--- a/backend/src/db/schemas/incident-contacts.ts
+++ b/backend/src/db/schemas/incident-contacts.ts
@@ -5,8 +5,6 @@
import { z } from "zod";
-
-
import { TImmutableDBKeys } from "./models";
export const IncidentContactsSchema = z.object({
diff --git a/backend/src/db/schemas/index.ts b/backend/src/db/schemas/index.ts
index 9de470da34..f2bd2dd938 100644
--- a/backend/src/db/schemas/index.ts
+++ b/backend/src/db/schemas/index.ts
@@ -73,6 +73,7 @@ export * from "./project-memberships";
export * from "./project-roles";
export * from "./project-slack-configs";
export * from "./project-split-backfill-ids";
+export * from "./project-ssh-configs";
export * from "./project-templates";
export * from "./project-user-additional-privilege";
export * from "./project-user-membership-roles";
diff --git a/backend/src/db/schemas/integrations.ts b/backend/src/db/schemas/integrations.ts
index 975fe7a13e..47cf9e627f 100644
--- a/backend/src/db/schemas/integrations.ts
+++ b/backend/src/db/schemas/integrations.ts
@@ -5,8 +5,6 @@
import { z } from "zod";
-
-
import { TImmutableDBKeys } from "./models";
export const IntegrationsSchema = z.object({
@@ -27,7 +25,7 @@ export const IntegrationsSchema = z.object({
metadata: z.unknown().nullable().optional(),
integrationAuthId: z.string().uuid(),
envId: z.string().uuid(),
- secretPath: z.string().default('/'),
+ secretPath: z.string().default("/"),
createdAt: z.date(),
updatedAt: z.date(),
lastUsed: z.date().nullable().optional(),
diff --git a/backend/src/db/schemas/kmip-client-certificates.ts b/backend/src/db/schemas/kmip-client-certificates.ts
index cf46358d14..a42d94a982 100644
--- a/backend/src/db/schemas/kmip-client-certificates.ts
+++ b/backend/src/db/schemas/kmip-client-certificates.ts
@@ -5,8 +5,6 @@
import { z } from "zod";
-
-
import { TImmutableDBKeys } from "./models";
export const KmipClientCertificatesSchema = z.object({
@@ -20,4 +18,6 @@ export const KmipClientCertificatesSchema = z.object({
export type TKmipClientCertificates = z.infer<typeof KmipClientCertificatesSchema>;
export type TKmipClientCertificatesInsert = Omit<z.input<typeof KmipClientCertificatesSchema>, TImmutableDBKeys>;
-export type TKmipClientCertificatesUpdate = Partial<Omit<z.input<typeof KmipClientCertificatesSchema>, TImmutableDBKeys>>;
+export type TKmipClientCertificatesUpdate = Partial<
+ Omit<z.input<typeof KmipClientCertificatesSchema>, TImmutableDBKeys>
+>;
diff --git a/backend/src/db/schemas/kmip-clients.ts b/backend/src/db/schemas/kmip-clients.ts
index 5c9f27ca2c..eb8f31bfb0 100644
--- a/backend/src/db/schemas/kmip-clients.ts
+++ b/backend/src/db/schemas/kmip-clients.ts
@@ -5,8 +5,6 @@
import { z } from "zod";
-
-
import { TImmutableDBKeys } from "./models";
export const KmipClientsSchema = z.object({
diff --git a/backend/src/db/schemas/kmip-org-server-certificates.ts b/backend/src/db/schemas/kmip-org-server-certificates.ts
index 6abf849edb..66e5dcbd64 100644
--- a/backend/src/db/schemas/kmip-org-server-certificates.ts
+++ b/backend/src/db/schemas/kmip-org-server-certificates.ts
@@ -24,4 +24,6 @@ export const KmipOrgServerCertificatesSchema = z.object({
export type TKmipOrgServerCertificates = z.infer<typeof KmipOrgServerCertificatesSchema>;
export type TKmipOrgServerCertificatesInsert = Omit<z.input<typeof KmipOrgServerCertificatesSchema>, TImmutableDBKeys>;
-export type TKmipOrgServerCertificatesUpdate = Partial<Omit<z.input<typeof KmipOrgServerCertificatesSchema>, TImmutableDBKeys>>;
+export type TKmipOrgServerCertificatesUpdate = Partial<
+ Omit<z.input<typeof KmipOrgServerCertificatesSchema>, TImmutableDBKeys>
+>;
diff --git a/backend/src/db/schemas/kms-keys.ts b/backend/src/db/schemas/kms-keys.ts
index 65e4f25eb8..b56fab7bf6 100644
--- a/backend/src/db/schemas/kms-keys.ts
+++ b/backend/src/db/schemas/kms-keys.ts
@@ -5,8 +5,6 @@
import { z } from "zod";
-
-
import { TImmutableDBKeys } from "./models";
export const KmsKeysSchema = z.object({
diff --git a/backend/src/db/schemas/kms-root-config.ts b/backend/src/db/schemas/kms-root-config.ts
index cd4552a1c3..c9c1ebda57 100644
--- a/backend/src/db/schemas/kms-root-config.ts
+++ b/backend/src/db/schemas/kms-root-config.ts
@@ -12,7 +12,7 @@ import { TImmutableDBKeys } from "./models";
export const KmsRootConfigSchema = z.object({
id: z.string().uuid(),
encryptedRootKey: zodBuffer,
- encryptionStrategy: z.string().default('SOFTWARE').nullable().optional(),
+ encryptionStrategy: z.string().default("SOFTWARE").nullable().optional(),
createdAt: z.date(),
updatedAt: z.date()
});
diff --git a/backend/src/db/schemas/ldap-configs.ts b/backend/src/db/schemas/ldap-configs.ts
index 90fc5c288b..778e7be6e4 100644
--- a/backend/src/db/schemas/ldap-configs.ts
+++ b/backend/src/db/schemas/ldap-configs.ts
@@ -26,10 +26,10 @@ export const LdapConfigsSchema = z.object({
caCertTag: z.string().nullable().optional(),
createdAt: z.date(),
updatedAt: z.date(),
- groupSearchBase: z.string().default(''),
- groupSearchFilter: z.string().default(''),
- searchFilter: z.string().default(''),
- uniqueUserAttribute: z.string().default(''),
+ groupSearchBase: z.string().default(""),
+ groupSearchFilter: z.string().default(""),
+ searchFilter: z.string().default(""),
+ uniqueUserAttribute: z.string().default(""),
encryptedLdapBindDN: zodBuffer,
encryptedLdapBindPass: zodBuffer,
encryptedLdapCaCertificate: zodBuffer.nullable().optional()
diff --git a/backend/src/db/schemas/ldap-group-maps.ts b/backend/src/db/schemas/ldap-group-maps.ts
index ad4c933838..d51d151b83 100644
--- a/backend/src/db/schemas/ldap-group-maps.ts
+++ b/backend/src/db/schemas/ldap-group-maps.ts
@@ -5,8 +5,6 @@
import { z } from "zod";
-
-
import { TImmutableDBKeys } from "./models";
export const LdapGroupMapsSchema = z.object({
diff --git a/backend/src/db/schemas/models.ts b/backend/src/db/schemas/models.ts
index 67055d3314..6b56a60ae7 100644
--- a/backend/src/db/schemas/models.ts
+++ b/backend/src/db/schemas/models.ts
@@ -40,6 +40,7 @@ export enum TableName {
SuperAdmin = "super_admin",
RateLimit = "rate_limit",
ApiKey = "api_keys",
+ ProjectSshConfig = "project_ssh_configs",
Project = "projects",
ProjectBot = "project_bots",
Environment = "project_environments",
diff --git a/backend/src/db/schemas/org-bots.ts b/backend/src/db/schemas/org-bots.ts
index 42d278c7ea..77be907ecd 100644
--- a/backend/src/db/schemas/org-bots.ts
+++ b/backend/src/db/schemas/org-bots.ts
@@ -5,8 +5,6 @@
import { z } from "zod";
-
-
import { TImmutableDBKeys } from "./models";
export const OrgBotsSchema = z.object({
diff --git a/backend/src/db/schemas/org-memberships.ts b/backend/src/db/schemas/org-memberships.ts
index d200c6fb2f..e77b6e9c92 100644
--- a/backend/src/db/schemas/org-memberships.ts
+++ b/backend/src/db/schemas/org-memberships.ts
@@ -5,14 +5,12 @@
import { z } from "zod";
-
-
import { TImmutableDBKeys } from "./models";
export const OrgMembershipsSchema = z.object({
id: z.string().uuid(),
role: z.string(),
- status: z.string().default('invited'),
+ status: z.string().default("invited"),
inviteEmail: z.string().nullable().optional(),
createdAt: z.date(),
updatedAt: z.date(),
diff --git a/backend/src/db/schemas/org-roles.ts b/backend/src/db/schemas/org-roles.ts
index 848ee104d4..ca01c65741 100644
--- a/backend/src/db/schemas/org-roles.ts
+++ b/backend/src/db/schemas/org-roles.ts
@@ -5,8 +5,6 @@
import { z } from "zod";
-
-
import { TImmutableDBKeys } from "./models";
export const OrgRolesSchema = z.object({
diff --git a/backend/src/db/schemas/organizations.ts b/backend/src/db/schemas/organizations.ts
index b01a404e0b..a18e258c7b 100644
--- a/backend/src/db/schemas/organizations.ts
+++ b/backend/src/db/schemas/organizations.ts
@@ -20,7 +20,7 @@ export const OrganizationsSchema = z.object({
scimEnabled: z.boolean().default(false).nullable().optional(),
kmsDefaultKeyId: z.string().uuid().nullable().optional(),
kmsEncryptedDataKey: zodBuffer.nullable().optional(),
- defaultMembershipRole: z.string().default('member'),
+ defaultMembershipRole: z.string().default("member"),
enforceMfa: z.boolean().default(false),
selectedMfaMethod: z.string().nullable().optional(),
allowSecretSharingOutsideOrganization: z.boolean().default(true).nullable().optional(),
diff --git a/backend/src/db/schemas/pki-alerts.ts b/backend/src/db/schemas/pki-alerts.ts
index 325a17974e..7bc9d2d7ca 100644
--- a/backend/src/db/schemas/pki-alerts.ts
+++ b/backend/src/db/schemas/pki-alerts.ts
@@ -5,8 +5,6 @@
import { z } from "zod";
-
-
import { TImmutableDBKeys } from "./models";
export const PkiAlertsSchema = z.object({
diff --git a/backend/src/db/schemas/pki-collection-items.ts b/backend/src/db/schemas/pki-collection-items.ts
index 27a69ebb29..f04f5a1ee0 100644
--- a/backend/src/db/schemas/pki-collection-items.ts
+++ b/backend/src/db/schemas/pki-collection-items.ts
@@ -5,8 +5,6 @@
import { z } from "zod";
-
-
import { TImmutableDBKeys } from "./models";
export const PkiCollectionItemsSchema = z.object({
diff --git a/backend/src/db/schemas/pki-collections.ts b/backend/src/db/schemas/pki-collections.ts
index f565d698fb..0f9a5675fb 100644
--- a/backend/src/db/schemas/pki-collections.ts
+++ b/backend/src/db/schemas/pki-collections.ts
@@ -5,8 +5,6 @@
import { z } from "zod";
-
-
import { TImmutableDBKeys } from "./models";
export const PkiCollectionsSchema = z.object({
diff --git a/backend/src/db/schemas/project-bots.ts b/backend/src/db/schemas/project-bots.ts
index ff58696f71..1fa59eb781 100644
--- a/backend/src/db/schemas/project-bots.ts
+++ b/backend/src/db/schemas/project-bots.ts
@@ -5,8 +5,6 @@
import { z } from "zod";
-
-
import { TImmutableDBKeys } from "./models";
export const ProjectBotsSchema = z.object({
diff --git a/backend/src/db/schemas/project-environments.ts b/backend/src/db/schemas/project-environments.ts
index 823fe67dab..76556b7e94 100644
--- a/backend/src/db/schemas/project-environments.ts
+++ b/backend/src/db/schemas/project-environments.ts
@@ -5,8 +5,6 @@
import { z } from "zod";
-
-
import { TImmutableDBKeys } from "./models";
export const ProjectEnvironmentsSchema = z.object({
diff --git a/backend/src/db/schemas/project-gateways.ts b/backend/src/db/schemas/project-gateways.ts
index d86d067c5f..f4b572661e 100644
--- a/backend/src/db/schemas/project-gateways.ts
+++ b/backend/src/db/schemas/project-gateways.ts
@@ -5,8 +5,6 @@
import { z } from "zod";
-
-
import { TImmutableDBKeys } from "./models";
export const ProjectGatewaysSchema = z.object({
diff --git a/backend/src/db/schemas/project-keys.ts b/backend/src/db/schemas/project-keys.ts
index ce958f82e3..924918b120 100644
--- a/backend/src/db/schemas/project-keys.ts
+++ b/backend/src/db/schemas/project-keys.ts
@@ -5,8 +5,6 @@
import { z } from "zod";
-
-
import { TImmutableDBKeys } from "./models";
export const ProjectKeysSchema = z.object({
diff --git a/backend/src/db/schemas/project-memberships.ts b/backend/src/db/schemas/project-memberships.ts
index 21e12029c2..e522d62806 100644
--- a/backend/src/db/schemas/project-memberships.ts
+++ b/backend/src/db/schemas/project-memberships.ts
@@ -5,8 +5,6 @@
import { z } from "zod";
-
-
import { TImmutableDBKeys } from "./models";
export const ProjectMembershipsSchema = z.object({
diff --git a/backend/src/db/schemas/project-roles.ts b/backend/src/db/schemas/project-roles.ts
index 5f9fc0610d..37eb58fcb0 100644
--- a/backend/src/db/schemas/project-roles.ts
+++ b/backend/src/db/schemas/project-roles.ts
@@ -5,8 +5,6 @@
import { z } from "zod";
-
-
import { TImmutableDBKeys } from "./models";
export const ProjectRolesSchema = z.object({
diff --git a/backend/src/db/schemas/project-slack-configs.ts b/backend/src/db/schemas/project-slack-configs.ts
index 9ec1ee3676..0a46e5aae7 100644
--- a/backend/src/db/schemas/project-slack-configs.ts
+++ b/backend/src/db/schemas/project-slack-configs.ts
@@ -5,8 +5,6 @@
import { z } from "zod";
-
-
import { TImmutableDBKeys } from "./models";
export const ProjectSlackConfigsSchema = z.object({
@@ -14,9 +12,9 @@ export const ProjectSlackConfigsSchema = z.object({
projectId: z.string(),
slackIntegrationId: z.string().uuid(),
isAccessRequestNotificationEnabled: z.boolean().default(false),
- accessRequestChannels: z.string().default(''),
+ accessRequestChannels: z.string().default(""),
isSecretRequestNotificationEnabled: z.boolean().default(false),
- secretRequestChannels: z.string().default(''),
+ secretRequestChannels: z.string().default(""),
createdAt: z.date(),
updatedAt: z.date()
});
diff --git a/backend/src/db/schemas/project-split-backfill-ids.ts b/backend/src/db/schemas/project-split-backfill-ids.ts
index d674dd590e..182d850493 100644
--- a/backend/src/db/schemas/project-split-backfill-ids.ts
+++ b/backend/src/db/schemas/project-split-backfill-ids.ts
@@ -5,8 +5,6 @@
import { z } from "zod";
-
-
import { TImmutableDBKeys } from "./models";
export const ProjectSplitBackfillIdsSchema = z.object({
@@ -18,4 +16,6 @@ export const ProjectSplitBackfillIdsSchema = z.object({
export type TProjectSplitBackfillIds = z.infer<typeof ProjectSplitBackfillIdsSchema>;
export type TProjectSplitBackfillIdsInsert = Omit<z.input<typeof ProjectSplitBackfillIdsSchema>, TImmutableDBKeys>;
-export type TProjectSplitBackfillIdsUpdate = Partial<Omit<z.input<typeof ProjectSplitBackfillIdsSchema>, TImmutableDBKeys>>;
+export type TProjectSplitBackfillIdsUpdate = Partial<
+ Omit<z.input<typeof ProjectSplitBackfillIdsSchema>, TImmutableDBKeys>
+>;
diff --git a/backend/src/db/schemas/project-ssh-configs.ts b/backend/src/db/schemas/project-ssh-configs.ts
new file mode 100644
index 0000000000..d0be89ee3d
--- /dev/null
+++ b/backend/src/db/schemas/project-ssh-configs.ts
@@ -0,0 +1,21 @@
+// Code generated by automation script, DO NOT EDIT.
+// Automated by pulling database and generating zod schema
+// To update. Just run npm run generate:schema
+// Written by akhilmhdh.
+
+import { z } from "zod";
+
+import { TImmutableDBKeys } from "./models";
+
+export const ProjectSshConfigsSchema = z.object({
+ id: z.string().uuid(),
+ createdAt: z.date(),
+ updatedAt: z.date(),
+ projectId: z.string(),
+ defaultUserSshCaId: z.string().uuid().nullable().optional(),
+ defaultHostSshCaId: z.string().uuid().nullable().optional()
+});
+
+export type TProjectSshConfigs = z.infer<typeof ProjectSshConfigsSchema>;
+export type TProjectSshConfigsInsert = Omit<z.input<typeof ProjectSshConfigsSchema>, TImmutableDBKeys>;
+export type TProjectSshConfigsUpdate = Partial<Omit<z.input<typeof ProjectSshConfigsSchema>, TImmutableDBKeys>>;
diff --git a/backend/src/db/schemas/project-templates.ts b/backend/src/db/schemas/project-templates.ts
index 981dc581e7..68f37d256d 100644
--- a/backend/src/db/schemas/project-templates.ts
+++ b/backend/src/db/schemas/project-templates.ts
@@ -5,8 +5,6 @@
import { z } from "zod";
-
-
import { TImmutableDBKeys } from "./models";
export const ProjectTemplatesSchema = z.object({
diff --git a/backend/src/db/schemas/project-user-additional-privilege.ts b/backend/src/db/schemas/project-user-additional-privilege.ts
index 8eb581670e..e657fc9454 100644
--- a/backend/src/db/schemas/project-user-additional-privilege.ts
+++ b/backend/src/db/schemas/project-user-additional-privilege.ts
@@ -5,8 +5,6 @@
import { z } from "zod";
-
-
import { TImmutableDBKeys } from "./models";
export const ProjectUserAdditionalPrivilegeSchema = z.object({
@@ -26,5 +24,10 @@ export const ProjectUserAdditionalPrivilegeSchema = z.object({
});
export type TProjectUserAdditionalPrivilege = z.infer<typeof ProjectUserAdditionalPrivilegeSchema>;
-export type TProjectUserAdditionalPrivilegeInsert = Omit<z.input<typeof ProjectUserAdditionalPrivilegeSchema>, TImmutableDBKeys>;
-export type TProjectUserAdditionalPrivilegeUpdate = Partial<Omit<z.input<typeof ProjectUserAdditionalPrivilegeSchema>, TImmutableDBKeys>>;
+export type TProjectUserAdditionalPrivilegeInsert = Omit<
+ z.input<typeof ProjectUserAdditionalPrivilegeSchema>,
+ TImmutableDBKeys
+>;
+export type TProjectUserAdditionalPrivilegeUpdate = Partial<
+ Omit<z.input<typeof ProjectUserAdditionalPrivilegeSchema>, TImmutableDBKeys>
+>;
diff --git a/backend/src/db/schemas/project-user-membership-roles.ts b/backend/src/db/schemas/project-user-membership-roles.ts
index e0f40505a4..bc7b672084 100644
--- a/backend/src/db/schemas/project-user-membership-roles.ts
+++ b/backend/src/db/schemas/project-user-membership-roles.ts
@@ -5,8 +5,6 @@
import { z } from "zod";
-
-
import { TImmutableDBKeys } from "./models";
export const ProjectUserMembershipRolesSchema = z.object({
@@ -24,5 +22,10 @@ export const ProjectUserMembershipRolesSchema = z.object({
});
export type TProjectUserMembershipRoles = z.infer<typeof ProjectUserMembershipRolesSchema>;
-export type TProjectUserMembershipRolesInsert = Omit<z.input<typeof ProjectUserMembershipRolesSchema>, TImmutableDBKeys>;
-export type TProjectUserMembershipRolesUpdate = Partial<Omit<z.input<typeof ProjectUserMembershipRolesSchema>, TImmutableDBKeys>>;
+export type TProjectUserMembershipRolesInsert = Omit<
+ z.input<typeof ProjectUserMembershipRolesSchema>,
+ TImmutableDBKeys
+>;
+export type TProjectUserMembershipRolesUpdate = Partial<
+ Omit<z.input<typeof ProjectUserMembershipRolesSchema>, TImmutableDBKeys>
+>;
diff --git a/backend/src/db/schemas/rate-limit.ts b/backend/src/db/schemas/rate-limit.ts
index 1cea9b556c..233f6cdbc4 100644
--- a/backend/src/db/schemas/rate-limit.ts
+++ b/backend/src/db/schemas/rate-limit.ts
@@ -5,8 +5,6 @@
import { z } from "zod";
-
-
import { TImmutableDBKeys } from "./models";
export const RateLimitSchema = z.object({
diff --git a/backend/src/db/schemas/resource-metadata.ts b/backend/src/db/schemas/resource-metadata.ts
index 748bdd0e6a..f496b29db6 100644
--- a/backend/src/db/schemas/resource-metadata.ts
+++ b/backend/src/db/schemas/resource-metadata.ts
@@ -5,8 +5,6 @@
import { z } from "zod";
-
-
import { TImmutableDBKeys } from "./models";
export const ResourceMetadataSchema = z.object({
diff --git a/backend/src/db/schemas/scim-tokens.ts b/backend/src/db/schemas/scim-tokens.ts
index 3de5057d0a..ab6e10d27b 100644
--- a/backend/src/db/schemas/scim-tokens.ts
+++ b/backend/src/db/schemas/scim-tokens.ts
@@ -5,8 +5,6 @@
import { z } from "zod";
-
-
import { TImmutableDBKeys } from "./models";
export const ScimTokensSchema = z.object({
diff --git a/backend/src/db/schemas/secret-approval-policies-approvers.ts b/backend/src/db/schemas/secret-approval-policies-approvers.ts
index 578da0df06..f9aebf0194 100644
--- a/backend/src/db/schemas/secret-approval-policies-approvers.ts
+++ b/backend/src/db/schemas/secret-approval-policies-approvers.ts
@@ -5,8 +5,6 @@
import { z } from "zod";
-
-
import { TImmutableDBKeys } from "./models";
export const SecretApprovalPoliciesApproversSchema = z.object({
@@ -19,5 +17,10 @@ export const SecretApprovalPoliciesApproversSchema = z.object({
});
export type TSecretApprovalPoliciesApprovers = z.infer<typeof SecretApprovalPoliciesApproversSchema>;
-export type TSecretApprovalPoliciesApproversInsert = Omit<z.input<typeof SecretApprovalPoliciesApproversSchema>, TImmutableDBKeys>;
-export type TSecretApprovalPoliciesApproversUpdate = Partial<Omit<z.input<typeof SecretApprovalPoliciesApproversSchema>, TImmutableDBKeys>>;
+export type TSecretApprovalPoliciesApproversInsert = Omit<
+ z.input<typeof SecretApprovalPoliciesApproversSchema>,
+ TImmutableDBKeys
+>;
+export type TSecretApprovalPoliciesApproversUpdate = Partial<
+ Omit<z.input<typeof SecretApprovalPoliciesApproversSchema>, TImmutableDBKeys>
+>;
diff --git a/backend/src/db/schemas/secret-approval-policies.ts b/backend/src/db/schemas/secret-approval-policies.ts
index 72a0caaa2a..8b91744565 100644
--- a/backend/src/db/schemas/secret-approval-policies.ts
+++ b/backend/src/db/schemas/secret-approval-policies.ts
@@ -5,8 +5,6 @@
import { z } from "zod";
-
-
import { TImmutableDBKeys } from "./models";
export const SecretApprovalPoliciesSchema = z.object({
@@ -17,11 +15,13 @@ export const SecretApprovalPoliciesSchema = z.object({
envId: z.string().uuid(),
createdAt: z.date(),
updatedAt: z.date(),
- enforcementLevel: z.string().default('hard'),
+ enforcementLevel: z.string().default("hard"),
deletedAt: z.date().nullable().optional(),
allowedSelfApprovals: z.boolean().default(true)
});
export type TSecretApprovalPolicies = z.infer<typeof SecretApprovalPoliciesSchema>;
export type TSecretApprovalPoliciesInsert = Omit<z.input<typeof SecretApprovalPoliciesSchema>, TImmutableDBKeys>;
-export type TSecretApprovalPoliciesUpdate = Partial<Omit<z.input<typeof SecretApprovalPoliciesSchema>, TImmutableDBKeys>>;
+export type TSecretApprovalPoliciesUpdate = Partial<
+ Omit<z.input<typeof SecretApprovalPoliciesSchema>, TImmutableDBKeys>
+>;
diff --git a/backend/src/db/schemas/secret-approval-request-secret-tags-v2.ts b/backend/src/db/schemas/secret-approval-request-secret-tags-v2.ts
index 713b5bb108..6ded05a5dd 100644
--- a/backend/src/db/schemas/secret-approval-request-secret-tags-v2.ts
+++ b/backend/src/db/schemas/secret-approval-request-secret-tags-v2.ts
@@ -5,8 +5,6 @@
import { z } from "zod";
-
-
import { TImmutableDBKeys } from "./models";
export const SecretApprovalRequestSecretTagsV2Schema = z.object({
@@ -18,5 +16,10 @@ export const SecretApprovalRequestSecretTagsV2Schema = z.object({
});
export type TSecretApprovalRequestSecretTagsV2 = z.infer<typeof SecretApprovalRequestSecretTagsV2Schema>;
-export type TSecretApprovalRequestSecretTagsV2Insert = Omit<z.input<typeof SecretApprovalRequestSecretTagsV2Schema>, TImmutableDBKeys>;
-export type TSecretApprovalRequestSecretTagsV2Update = Partial<Omit<z.input<typeof SecretApprovalRequestSecretTagsV2Schema>, TImmutableDBKeys>>;
+export type TSecretApprovalRequestSecretTagsV2Insert = Omit<
+ z.input<typeof SecretApprovalRequestSecretTagsV2Schema>,
+ TImmutableDBKeys
+>;
+export type TSecretApprovalRequestSecretTagsV2Update = Partial<
+ Omit<z.input<typeof SecretApprovalRequestSecretTagsV2Schema>, TImmutableDBKeys>
+>;
diff --git a/backend/src/db/schemas/secret-approval-request-secret-tags.ts b/backend/src/db/schemas/secret-approval-request-secret-tags.ts
index dfa8405289..2851321e2b 100644
--- a/backend/src/db/schemas/secret-approval-request-secret-tags.ts
+++ b/backend/src/db/schemas/secret-approval-request-secret-tags.ts
@@ -5,8 +5,6 @@
import { z } from "zod";
-
-
import { TImmutableDBKeys } from "./models";
export const SecretApprovalRequestSecretTagsSchema = z.object({
@@ -18,5 +16,10 @@ export const SecretApprovalRequestSecretTagsSchema = z.object({
});
export type TSecretApprovalRequestSecretTags = z.infer<typeof SecretApprovalRequestSecretTagsSchema>;
-export type TSecretApprovalRequestSecretTagsInsert = Omit<z.input<typeof SecretApprovalRequestSecretTagsSchema>, TImmutableDBKeys>;
-export type TSecretApprovalRequestSecretTagsUpdate = Partial<Omit<z.input<typeof SecretApprovalRequestSecretTagsSchema>, TImmutableDBKeys>>;
+export type TSecretApprovalRequestSecretTagsInsert = Omit<
+ z.input<typeof SecretApprovalRequestSecretTagsSchema>,
+ TImmutableDBKeys
+>;
+export type TSecretApprovalRequestSecretTagsUpdate = Partial<
+ Omit<z.input<typeof SecretApprovalRequestSecretTagsSchema>, TImmutableDBKeys>
+>;
diff --git a/backend/src/db/schemas/secret-approval-requests-reviewers.ts b/backend/src/db/schemas/secret-approval-requests-reviewers.ts
index 820f7ab4c3..147646b8d9 100644
--- a/backend/src/db/schemas/secret-approval-requests-reviewers.ts
+++ b/backend/src/db/schemas/secret-approval-requests-reviewers.ts
@@ -5,8 +5,6 @@
import { z } from "zod";
-
-
import { TImmutableDBKeys } from "./models";
export const SecretApprovalRequestsReviewersSchema = z.object({
@@ -20,5 +18,10 @@ export const SecretApprovalRequestsReviewersSchema = z.object({
});
export type TSecretApprovalRequestsReviewers = z.infer<typeof SecretApprovalRequestsReviewersSchema>;
-export type TSecretApprovalRequestsReviewersInsert = Omit<z.input<typeof SecretApprovalRequestsReviewersSchema>, TImmutableDBKeys>;
-export type TSecretApprovalRequestsReviewersUpdate = Partial<Omit<z.input<typeof SecretApprovalRequestsReviewersSchema>, TImmutableDBKeys>>;
+export type TSecretApprovalRequestsReviewersInsert = Omit<
+ z.input<typeof SecretApprovalRequestsReviewersSchema>,
+ TImmutableDBKeys
+>;
+export type TSecretApprovalRequestsReviewersUpdate = Partial<
+ Omit<z.input<typeof SecretApprovalRequestsReviewersSchema>, TImmutableDBKeys>
+>;
diff --git a/backend/src/db/schemas/secret-approval-requests-secrets-v2.ts b/backend/src/db/schemas/secret-approval-requests-secrets-v2.ts
index 1502b5d288..298985fedd 100644
--- a/backend/src/db/schemas/secret-approval-requests-secrets-v2.ts
+++ b/backend/src/db/schemas/secret-approval-requests-secrets-v2.ts
@@ -29,5 +29,10 @@ export const SecretApprovalRequestsSecretsV2Schema = z.object({
});
export type TSecretApprovalRequestsSecretsV2 = z.infer<typeof SecretApprovalRequestsSecretsV2Schema>;
-export type TSecretApprovalRequestsSecretsV2Insert = Omit<z.input<typeof SecretApprovalRequestsSecretsV2Schema>, TImmutableDBKeys>;
-export type TSecretApprovalRequestsSecretsV2Update = Partial<Omit<z.input<typeof SecretApprovalRequestsSecretsV2Schema>, TImmutableDBKeys>>;
+export type TSecretApprovalRequestsSecretsV2Insert = Omit<
+ z.input<typeof SecretApprovalRequestsSecretsV2Schema>,
+ TImmutableDBKeys
+>;
+export type TSecretApprovalRequestsSecretsV2Update = Partial<
+ Omit<z.input<typeof SecretApprovalRequestsSecretsV2Schema>, TImmutableDBKeys>
+>;
diff --git a/backend/src/db/schemas/secret-approval-requests-secrets.ts b/backend/src/db/schemas/secret-approval-requests-secrets.ts
index 5e82e20955..b795b47b43 100644
--- a/backend/src/db/schemas/secret-approval-requests-secrets.ts
+++ b/backend/src/db/schemas/secret-approval-requests-secrets.ts
@@ -5,8 +5,6 @@
import { z } from "zod";
-
-
import { TImmutableDBKeys } from "./models";
export const SecretApprovalRequestsSecretsSchema = z.object({
@@ -25,8 +23,8 @@ export const SecretApprovalRequestsSecretsSchema = z.object({
secretReminderNote: z.string().nullable().optional(),
secretReminderRepeatDays: z.number().nullable().optional(),
skipMultilineEncoding: z.boolean().default(false).nullable().optional(),
- algorithm: z.string().default('aes-256-gcm'),
- keyEncoding: z.string().default('utf8'),
+ algorithm: z.string().default("aes-256-gcm"),
+ keyEncoding: z.string().default("utf8"),
metadata: z.unknown().nullable().optional(),
createdAt: z.date(),
updatedAt: z.date(),
@@ -37,5 +35,10 @@ export const SecretApprovalRequestsSecretsSchema = z.object({
});
export type TSecretApprovalRequestsSecrets = z.infer<typeof SecretApprovalRequestsSecretsSchema>;
-export type TSecretApprovalRequestsSecretsInsert = Omit<z.input<typeof SecretApprovalRequestsSecretsSchema>, TImmutableDBKeys>;
-export type TSecretApprovalRequestsSecretsUpdate = Partial<Omit<z.input<typeof SecretApprovalRequestsSecretsSchema>, TImmutableDBKeys>>;
+export type TSecretApprovalRequestsSecretsInsert = Omit<
+ z.input<typeof SecretApprovalRequestsSecretsSchema>,
+ TImmutableDBKeys
+>;
+export type TSecretApprovalRequestsSecretsUpdate = Partial<
+ Omit<z.input<typeof SecretApprovalRequestsSecretsSchema>, TImmutableDBKeys>
+>;
diff --git a/backend/src/db/schemas/secret-approval-requests.ts b/backend/src/db/schemas/secret-approval-requests.ts
index 78f91cfc89..218a0f922f 100644
--- a/backend/src/db/schemas/secret-approval-requests.ts
+++ b/backend/src/db/schemas/secret-approval-requests.ts
@@ -5,15 +5,13 @@
import { z } from "zod";
-
-
import { TImmutableDBKeys } from "./models";
export const SecretApprovalRequestsSchema = z.object({
id: z.string().uuid(),
policyId: z.string().uuid(),
hasMerged: z.boolean().default(false),
- status: z.string().default('open'),
+ status: z.string().default("open"),
conflicts: z.unknown().nullable().optional(),
slug: z.string(),
folderId: z.string().uuid(),
@@ -27,4 +25,6 @@ export const SecretApprovalRequestsSchema = z.object({
export type TSecretApprovalRequests = z.infer<typeof SecretApprovalRequestsSchema>;
export type TSecretApprovalRequestsInsert = Omit<z.input<typeof SecretApprovalRequestsSchema>, TImmutableDBKeys>;
-export type TSecretApprovalRequestsUpdate = Partial<Omit<z.input<typeof SecretApprovalRequestsSchema>, TImmutableDBKeys>>;
+export type TSecretApprovalRequestsUpdate = Partial<
+ Omit<z.input<typeof SecretApprovalRequestsSchema>, TImmutableDBKeys>
+>;
diff --git a/backend/src/db/schemas/secret-blind-indexes.ts b/backend/src/db/schemas/secret-blind-indexes.ts
index 09c8f8b89c..474e0aa540 100644
--- a/backend/src/db/schemas/secret-blind-indexes.ts
+++ b/backend/src/db/schemas/secret-blind-indexes.ts
@@ -5,8 +5,6 @@
import { z } from "zod";
-
-
import { TImmutableDBKeys } from "./models";
export const SecretBlindIndexesSchema = z.object({
@@ -14,8 +12,8 @@ export const SecretBlindIndexesSchema = z.object({
encryptedSaltCipherText: z.string(),
saltIV: z.string(),
saltTag: z.string(),
- algorithm: z.string().default('aes-256-gcm'),
- keyEncoding: z.string().default('utf8'),
+ algorithm: z.string().default("aes-256-gcm"),
+ keyEncoding: z.string().default("utf8"),
projectId: z.string(),
createdAt: z.date(),
updatedAt: z.date()
diff --git a/backend/src/db/schemas/secret-folder-versions.ts b/backend/src/db/schemas/secret-folder-versions.ts
index e7348bb59b..8bef6e83f5 100644
--- a/backend/src/db/schemas/secret-folder-versions.ts
+++ b/backend/src/db/schemas/secret-folder-versions.ts
@@ -5,8 +5,6 @@
import { z } from "zod";
-
-
import { TImmutableDBKeys } from "./models";
export const SecretFolderVersionsSchema = z.object({
diff --git a/backend/src/db/schemas/secret-folders.ts b/backend/src/db/schemas/secret-folders.ts
index c0564eff1d..09e2fe8c14 100644
--- a/backend/src/db/schemas/secret-folders.ts
+++ b/backend/src/db/schemas/secret-folders.ts
@@ -5,8 +5,6 @@
import { z } from "zod";
-
-
import { TImmutableDBKeys } from "./models";
export const SecretFoldersSchema = z.object({
diff --git a/backend/src/db/schemas/secret-imports.ts b/backend/src/db/schemas/secret-imports.ts
index eaa82bea53..4bb1e669de 100644
--- a/backend/src/db/schemas/secret-imports.ts
+++ b/backend/src/db/schemas/secret-imports.ts
@@ -5,8 +5,6 @@
import { z } from "zod";
-
-
import { TImmutableDBKeys } from "./models";
export const SecretImportsSchema = z.object({
diff --git a/backend/src/db/schemas/secret-references-v2.ts b/backend/src/db/schemas/secret-references-v2.ts
index c4098ee5a7..ed339e65c5 100644
--- a/backend/src/db/schemas/secret-references-v2.ts
+++ b/backend/src/db/schemas/secret-references-v2.ts
@@ -5,8 +5,6 @@
import { z } from "zod";
-
-
import { TImmutableDBKeys } from "./models";
export const SecretReferencesV2Schema = z.object({
diff --git a/backend/src/db/schemas/secret-references.ts b/backend/src/db/schemas/secret-references.ts
index 83e4794980..b3e6a86294 100644
--- a/backend/src/db/schemas/secret-references.ts
+++ b/backend/src/db/schemas/secret-references.ts
@@ -5,8 +5,6 @@
import { z } from "zod";
-
-
import { TImmutableDBKeys } from "./models";
export const SecretReferencesSchema = z.object({
diff --git a/backend/src/db/schemas/secret-rotation-output-v2.ts b/backend/src/db/schemas/secret-rotation-output-v2.ts
index 5be9d46463..28d45413a7 100644
--- a/backend/src/db/schemas/secret-rotation-output-v2.ts
+++ b/backend/src/db/schemas/secret-rotation-output-v2.ts
@@ -5,8 +5,6 @@
import { z } from "zod";
-
-
import { TImmutableDBKeys } from "./models";
export const SecretRotationOutputV2Schema = z.object({
@@ -18,4 +16,6 @@ export const SecretRotationOutputV2Schema = z.object({
export type TSecretRotationOutputV2 = z.infer<typeof SecretRotationOutputV2Schema>;
export type TSecretRotationOutputV2Insert = Omit<z.input<typeof SecretRotationOutputV2Schema>, TImmutableDBKeys>;
-export type TSecretRotationOutputV2Update = Partial<Omit<z.input<typeof SecretRotationOutputV2Schema>, TImmutableDBKeys>>;
+export type TSecretRotationOutputV2Update = Partial<
+ Omit<z.input<typeof SecretRotationOutputV2Schema>, TImmutableDBKeys>
+>;
diff --git a/backend/src/db/schemas/secret-rotation-outputs.ts b/backend/src/db/schemas/secret-rotation-outputs.ts
index dc4b49cdf9..3ac5c2c9e9 100644
--- a/backend/src/db/schemas/secret-rotation-outputs.ts
+++ b/backend/src/db/schemas/secret-rotation-outputs.ts
@@ -5,8 +5,6 @@
import { z } from "zod";
-
-
import { TImmutableDBKeys } from "./models";
export const SecretRotationOutputsSchema = z.object({
diff --git a/backend/src/db/schemas/secret-scanning-git-risks.ts b/backend/src/db/schemas/secret-scanning-git-risks.ts
index 677dc2e73e..08ba690e45 100644
--- a/backend/src/db/schemas/secret-scanning-git-risks.ts
+++ b/backend/src/db/schemas/secret-scanning-git-risks.ts
@@ -5,8 +5,6 @@
import { z } from "zod";
-
-
import { TImmutableDBKeys } from "./models";
export const SecretScanningGitRisksSchema = z.object({
@@ -45,4 +43,6 @@ export const SecretScanningGitRisksSchema = z.object({
export type TSecretScanningGitRisks = z.infer<typeof SecretScanningGitRisksSchema>;
export type TSecretScanningGitRisksInsert = Omit<z.input<typeof SecretScanningGitRisksSchema>, TImmutableDBKeys>;
-export type TSecretScanningGitRisksUpdate = Partial<Omit<z.input<typeof SecretScanningGitRisksSchema>, TImmutableDBKeys>>;
+export type TSecretScanningGitRisksUpdate = Partial<
+ Omit<z.input<typeof SecretScanningGitRisksSchema>, TImmutableDBKeys>
+>;
diff --git a/backend/src/db/schemas/secret-sharing.ts b/backend/src/db/schemas/secret-sharing.ts
index 22bdac3d5f..24ea266772 100644
--- a/backend/src/db/schemas/secret-sharing.ts
+++ b/backend/src/db/schemas/secret-sharing.ts
@@ -21,13 +21,13 @@ export const SecretSharingSchema = z.object({
createdAt: z.date(),
updatedAt: z.date(),
expiresAfterViews: z.number().nullable().optional(),
- accessType: z.string().default('anyone'),
+ accessType: z.string().default("anyone"),
name: z.string().nullable().optional(),
lastViewedAt: z.date().nullable().optional(),
password: z.string().nullable().optional(),
encryptedSecret: zodBuffer.nullable().optional(),
identifier: z.string().nullable().optional(),
- type: z.string().default('share')
+ type: z.string().default("share")
});
export type TSecretSharing = z.infer<typeof SecretSharingSchema>;
diff --git a/backend/src/db/schemas/secret-snapshot-folders.ts b/backend/src/db/schemas/secret-snapshot-folders.ts
index 89d3e07a4d..3e2853cbef 100644
--- a/backend/src/db/schemas/secret-snapshot-folders.ts
+++ b/backend/src/db/schemas/secret-snapshot-folders.ts
@@ -5,8 +5,6 @@
import { z } from "zod";
-
-
import { TImmutableDBKeys } from "./models";
export const SecretSnapshotFoldersSchema = z.object({
diff --git a/backend/src/db/schemas/secret-snapshot-secrets-v2.ts b/backend/src/db/schemas/secret-snapshot-secrets-v2.ts
index 8dea884e44..d643f7f8c7 100644
--- a/backend/src/db/schemas/secret-snapshot-secrets-v2.ts
+++ b/backend/src/db/schemas/secret-snapshot-secrets-v2.ts
@@ -5,8 +5,6 @@
import { z } from "zod";
-
-
import { TImmutableDBKeys } from "./models";
export const SecretSnapshotSecretsV2Schema = z.object({
@@ -20,4 +18,6 @@ export const SecretSnapshotSecretsV2Schema = z.object({
export type TSecretSnapshotSecretsV2 = z.infer<typeof SecretSnapshotSecretsV2Schema>;
export type TSecretSnapshotSecretsV2Insert = Omit<z.input<typeof SecretSnapshotSecretsV2Schema>, TImmutableDBKeys>;
-export type TSecretSnapshotSecretsV2Update = Partial<Omit<z.input<typeof SecretSnapshotSecretsV2Schema>, TImmutableDBKeys>>;
+export type TSecretSnapshotSecretsV2Update = Partial<
+ Omit<z.input<typeof SecretSnapshotSecretsV2Schema>, TImmutableDBKeys>
+>;
diff --git a/backend/src/db/schemas/secret-snapshot-secrets.ts b/backend/src/db/schemas/secret-snapshot-secrets.ts
index 510a69e99b..121c5d56ea 100644
--- a/backend/src/db/schemas/secret-snapshot-secrets.ts
+++ b/backend/src/db/schemas/secret-snapshot-secrets.ts
@@ -5,8 +5,6 @@
import { z } from "zod";
-
-
import { TImmutableDBKeys } from "./models";
export const SecretSnapshotSecretsSchema = z.object({
diff --git a/backend/src/db/schemas/secret-snapshots.ts b/backend/src/db/schemas/secret-snapshots.ts
index 866bcd42f7..7f070075fc 100644
--- a/backend/src/db/schemas/secret-snapshots.ts
+++ b/backend/src/db/schemas/secret-snapshots.ts
@@ -5,8 +5,6 @@
import { z } from "zod";
-
-
import { TImmutableDBKeys } from "./models";
export const SecretSnapshotsSchema = z.object({
diff --git a/backend/src/db/schemas/secret-syncs.ts b/backend/src/db/schemas/secret-syncs.ts
index 488cd0f6c0..0e0728e874 100644
--- a/backend/src/db/schemas/secret-syncs.ts
+++ b/backend/src/db/schemas/secret-syncs.ts
@@ -5,8 +5,6 @@
import { z } from "zod";
-
-
import { TImmutableDBKeys } from "./models";
export const SecretSyncsSchema = z.object({
diff --git a/backend/src/db/schemas/secret-tag-junction.ts b/backend/src/db/schemas/secret-tag-junction.ts
index 52e98fd7d5..d14384fabc 100644
--- a/backend/src/db/schemas/secret-tag-junction.ts
+++ b/backend/src/db/schemas/secret-tag-junction.ts
@@ -5,8 +5,6 @@
import { z } from "zod";
-
-
import { TImmutableDBKeys } from "./models";
export const SecretTagJunctionSchema = z.object({
diff --git a/backend/src/db/schemas/secret-tags.ts b/backend/src/db/schemas/secret-tags.ts
index 3828d05535..7ba7204a4d 100644
--- a/backend/src/db/schemas/secret-tags.ts
+++ b/backend/src/db/schemas/secret-tags.ts
@@ -5,8 +5,6 @@
import { z } from "zod";
-
-
import { TImmutableDBKeys } from "./models";
export const SecretTagsSchema = z.object({
@@ -17,7 +15,7 @@ export const SecretTagsSchema = z.object({
updatedAt: z.date(),
createdBy: z.string().uuid().nullable().optional(),
projectId: z.string(),
- createdByActorType: z.string().default('user')
+ createdByActorType: z.string().default("user")
});
export type TSecretTags = z.infer<typeof SecretTagsSchema>;
diff --git a/backend/src/db/schemas/secret-v2-tag-junction.ts b/backend/src/db/schemas/secret-v2-tag-junction.ts
index 04ecd7526b..982e11f505 100644
--- a/backend/src/db/schemas/secret-v2-tag-junction.ts
+++ b/backend/src/db/schemas/secret-v2-tag-junction.ts
@@ -5,8 +5,6 @@
import { z } from "zod";
-
-
import { TImmutableDBKeys } from "./models";
export const SecretV2TagJunctionSchema = z.object({
diff --git a/backend/src/db/schemas/secret-version-tag-junction.ts b/backend/src/db/schemas/secret-version-tag-junction.ts
index a93e9f586d..b36e28c724 100644
--- a/backend/src/db/schemas/secret-version-tag-junction.ts
+++ b/backend/src/db/schemas/secret-version-tag-junction.ts
@@ -5,8 +5,6 @@
import { z } from "zod";
-
-
import { TImmutableDBKeys } from "./models";
export const SecretVersionTagJunctionSchema = z.object({
@@ -17,4 +15,6 @@ export const SecretVersionTagJunctionSchema = z.object({
export type TSecretVersionTagJunction = z.infer<typeof SecretVersionTagJunctionSchema>;
export type TSecretVersionTagJunctionInsert = Omit<z.input<typeof SecretVersionTagJunctionSchema>, TImmutableDBKeys>;
-export type TSecretVersionTagJunctionUpdate = Partial<Omit<z.input<typeof SecretVersionTagJunctionSchema>, TImmutableDBKeys>>;
+export type TSecretVersionTagJunctionUpdate = Partial<
+ Omit<z.input<typeof SecretVersionTagJunctionSchema>, TImmutableDBKeys>
+>;
diff --git a/backend/src/db/schemas/secret-version-v2-tag-junction.ts b/backend/src/db/schemas/secret-version-v2-tag-junction.ts
index 1706bf31b0..4679116a0c 100644
--- a/backend/src/db/schemas/secret-version-v2-tag-junction.ts
+++ b/backend/src/db/schemas/secret-version-v2-tag-junction.ts
@@ -5,8 +5,6 @@
import { z } from "zod";
-
-
import { TImmutableDBKeys } from "./models";
export const SecretVersionV2TagJunctionSchema = z.object({
@@ -16,5 +14,10 @@ export const SecretVersionV2TagJunctionSchema = z.object({
});
export type TSecretVersionV2TagJunction = z.infer<typeof SecretVersionV2TagJunctionSchema>;
-export type TSecretVersionV2TagJunctionInsert = Omit<z.input<typeof SecretVersionV2TagJunctionSchema>, TImmutableDBKeys>;
-export type TSecretVersionV2TagJunctionUpdate = Partial<Omit<z.input<typeof SecretVersionV2TagJunctionSchema>, TImmutableDBKeys>>;
+export type TSecretVersionV2TagJunctionInsert = Omit<
+ z.input<typeof SecretVersionV2TagJunctionSchema>,
+ TImmutableDBKeys
+>;
+export type TSecretVersionV2TagJunctionUpdate = Partial<
+ Omit<z.input<typeof SecretVersionV2TagJunctionSchema>, TImmutableDBKeys>
+>;
diff --git a/backend/src/db/schemas/secret-versions-v2.ts b/backend/src/db/schemas/secret-versions-v2.ts
index 3ac217c810..593a46b068 100644
--- a/backend/src/db/schemas/secret-versions-v2.ts
+++ b/backend/src/db/schemas/secret-versions-v2.ts
@@ -12,7 +12,7 @@ import { TImmutableDBKeys } from "./models";
export const SecretVersionsV2Schema = z.object({
id: z.string().uuid(),
version: z.number().default(1),
- type: z.string().default('shared'),
+ type: z.string().default("shared"),
key: z.string(),
encryptedValue: zodBuffer.nullable().optional(),
encryptedComment: zodBuffer.nullable().optional(),
diff --git a/backend/src/db/schemas/secret-versions.ts b/backend/src/db/schemas/secret-versions.ts
index cddecd67af..d60db9b754 100644
--- a/backend/src/db/schemas/secret-versions.ts
+++ b/backend/src/db/schemas/secret-versions.ts
@@ -5,14 +5,12 @@
import { z } from "zod";
-
-
import { TImmutableDBKeys } from "./models";
export const SecretVersionsSchema = z.object({
id: z.string().uuid(),
version: z.number().default(1),
- type: z.string().default('shared'),
+ type: z.string().default("shared"),
secretBlindIndex: z.string().nullable().optional(),
secretKeyCiphertext: z.string(),
secretKeyIV: z.string(),
@@ -26,8 +24,8 @@ export const SecretVersionsSchema = z.object({
secretReminderNote: z.string().nullable().optional(),
secretReminderRepeatDays: z.number().nullable().optional(),
skipMultilineEncoding: z.boolean().default(false).nullable().optional(),
- algorithm: z.string().default('aes-256-gcm'),
- keyEncoding: z.string().default('utf8'),
+ algorithm: z.string().default("aes-256-gcm"),
+ keyEncoding: z.string().default("utf8"),
metadata: z.unknown().nullable().optional(),
envId: z.string().uuid().nullable().optional(),
secretId: z.string().uuid(),
diff --git a/backend/src/db/schemas/secrets-v2.ts b/backend/src/db/schemas/secrets-v2.ts
index 5c74f704e2..18fa3b4762 100644
--- a/backend/src/db/schemas/secrets-v2.ts
+++ b/backend/src/db/schemas/secrets-v2.ts
@@ -12,7 +12,7 @@ import { TImmutableDBKeys } from "./models";
export const SecretsV2Schema = z.object({
id: z.string().uuid(),
version: z.number().default(1),
- type: z.string().default('shared'),
+ type: z.string().default("shared"),
key: z.string(),
encryptedValue: zodBuffer.nullable().optional(),
encryptedComment: zodBuffer.nullable().optional(),
diff --git a/backend/src/db/schemas/secrets.ts b/backend/src/db/schemas/secrets.ts
index 874ffb73c8..f261c40bbe 100644
--- a/backend/src/db/schemas/secrets.ts
+++ b/backend/src/db/schemas/secrets.ts
@@ -5,14 +5,12 @@
import { z } from "zod";
-
-
import { TImmutableDBKeys } from "./models";
export const SecretsSchema = z.object({
id: z.string().uuid(),
version: z.number().default(1),
- type: z.string().default('shared'),
+ type: z.string().default("shared"),
secretBlindIndex: z.string().nullable().optional(),
secretKeyCiphertext: z.string(),
secretKeyIV: z.string(),
@@ -26,8 +24,8 @@ export const SecretsSchema = z.object({
secretReminderNote: z.string().nullable().optional(),
secretReminderRepeatDays: z.number().nullable().optional(),
skipMultilineEncoding: z.boolean().default(false).nullable().optional(),
- algorithm: z.string().default('aes-256-gcm'),
- keyEncoding: z.string().default('utf8'),
+ algorithm: z.string().default("aes-256-gcm"),
+ keyEncoding: z.string().default("utf8"),
metadata: z.unknown().nullable().optional(),
userId: z.string().uuid().nullable().optional(),
folderId: z.string().uuid(),
diff --git a/backend/src/db/schemas/service-tokens.ts b/backend/src/db/schemas/service-tokens.ts
index f7a74b695e..720c8fd6fa 100644
--- a/backend/src/db/schemas/service-tokens.ts
+++ b/backend/src/db/schemas/service-tokens.ts
@@ -5,8 +5,6 @@
import { z } from "zod";
-
-
import { TImmutableDBKeys } from "./models";
export const ServiceTokensSchema = z.object({
diff --git a/backend/src/db/schemas/ssh-certificate-authorities.ts b/backend/src/db/schemas/ssh-certificate-authorities.ts
index 3a273aaa81..75603406f6 100644
--- a/backend/src/db/schemas/ssh-certificate-authorities.ts
+++ b/backend/src/db/schemas/ssh-certificate-authorities.ts
@@ -5,8 +5,6 @@
import { z } from "zod";
-
-
import { TImmutableDBKeys } from "./models";
export const SshCertificateAuthoritiesSchema = z.object({
@@ -22,4 +20,6 @@ export const SshCertificateAuthoritiesSchema = z.object({
export type TSshCertificateAuthorities = z.infer<typeof SshCertificateAuthoritiesSchema>;
export type TSshCertificateAuthoritiesInsert = Omit<z.input<typeof SshCertificateAuthoritiesSchema>, TImmutableDBKeys>;
-export type TSshCertificateAuthoritiesUpdate = Partial<Omit<z.input<typeof SshCertificateAuthoritiesSchema>, TImmutableDBKeys>>;
+export type TSshCertificateAuthoritiesUpdate = Partial<
+ Omit<z.input<typeof SshCertificateAuthoritiesSchema>, TImmutableDBKeys>
+>;
diff --git a/backend/src/db/schemas/ssh-certificate-authority-secrets.ts b/backend/src/db/schemas/ssh-certificate-authority-secrets.ts
index 4c4f6320e0..934c10ab23 100644
--- a/backend/src/db/schemas/ssh-certificate-authority-secrets.ts
+++ b/backend/src/db/schemas/ssh-certificate-authority-secrets.ts
@@ -18,5 +18,10 @@ export const SshCertificateAuthoritySecretsSchema = z.object({
});
export type TSshCertificateAuthoritySecrets = z.infer<typeof SshCertificateAuthoritySecretsSchema>;
-export type TSshCertificateAuthoritySecretsInsert = Omit<z.input<typeof SshCertificateAuthoritySecretsSchema>, TImmutableDBKeys>;
-export type TSshCertificateAuthoritySecretsUpdate = Partial<Omit<z.input<typeof SshCertificateAuthoritySecretsSchema>, TImmutableDBKeys>>;
+export type TSshCertificateAuthoritySecretsInsert = Omit<
+ z.input<typeof SshCertificateAuthoritySecretsSchema>,
+ TImmutableDBKeys
+>;
+export type TSshCertificateAuthoritySecretsUpdate = Partial<
+ Omit<z.input<typeof SshCertificateAuthoritySecretsSchema>, TImmutableDBKeys>
+>;
diff --git a/backend/src/db/schemas/ssh-certificate-templates.ts b/backend/src/db/schemas/ssh-certificate-templates.ts
index 88846673c3..6c16c3942f 100644
--- a/backend/src/db/schemas/ssh-certificate-templates.ts
+++ b/backend/src/db/schemas/ssh-certificate-templates.ts
@@ -5,8 +5,6 @@
import { z } from "zod";
-
-
import { TImmutableDBKeys } from "./models";
export const SshCertificateTemplatesSchema = z.object({
@@ -27,4 +25,6 @@ export const SshCertificateTemplatesSchema = z.object({
export type TSshCertificateTemplates = z.infer<typeof SshCertificateTemplatesSchema>;
export type TSshCertificateTemplatesInsert = Omit<z.input<typeof SshCertificateTemplatesSchema>, TImmutableDBKeys>;
-export type TSshCertificateTemplatesUpdate = Partial<Omit<z.input<typeof SshCertificateTemplatesSchema>, TImmutableDBKeys>>;
+export type TSshCertificateTemplatesUpdate = Partial<
+ Omit<z.input<typeof SshCertificateTemplatesSchema>, TImmutableDBKeys>
+>;
diff --git a/backend/src/db/schemas/ssh-certificates.ts b/backend/src/db/schemas/ssh-certificates.ts
index 2344359e5b..351875bbb1 100644
--- a/backend/src/db/schemas/ssh-certificates.ts
+++ b/backend/src/db/schemas/ssh-certificates.ts
@@ -5,8 +5,6 @@
import { z } from "zod";
-
-
import { TImmutableDBKeys } from "./models";
export const SshCertificatesSchema = z.object({
diff --git a/backend/src/db/schemas/ssh-host-login-mappings.ts b/backend/src/db/schemas/ssh-host-login-mappings.ts
index 12f851a931..0353589d2e 100644
--- a/backend/src/db/schemas/ssh-host-login-mappings.ts
+++ b/backend/src/db/schemas/ssh-host-login-mappings.ts
@@ -5,8 +5,6 @@
import { z } from "zod";
-
-
import { TImmutableDBKeys } from "./models";
export const SshHostLoginMappingsSchema = z.object({
diff --git a/backend/src/db/schemas/ssh-hosts.ts b/backend/src/db/schemas/ssh-hosts.ts
index 3b21823c83..7577e065b1 100644
--- a/backend/src/db/schemas/ssh-hosts.ts
+++ b/backend/src/db/schemas/ssh-hosts.ts
@@ -5,8 +5,6 @@
import { z } from "zod";
-
-
import { TImmutableDBKeys } from "./models";
export const SshHostsSchema = z.object({
@@ -16,7 +14,9 @@ export const SshHostsSchema = z.object({
projectId: z.string(),
hostname: z.string(),
userCertTtl: z.string(),
- hostCertTtl: z.string()
+ hostCertTtl: z.string(),
+ userSshCaId: z.string().uuid(),
+ hostSshCaId: z.string().uuid()
});
export type TSshHosts = z.infer<typeof SshHostsSchema>;
diff --git a/backend/src/db/schemas/trusted-ips.ts b/backend/src/db/schemas/trusted-ips.ts
index 80579504e3..f9973a843b 100644
--- a/backend/src/db/schemas/trusted-ips.ts
+++ b/backend/src/db/schemas/trusted-ips.ts
@@ -5,8 +5,6 @@
import { z } from "zod";
-
-
import { TImmutableDBKeys } from "./models";
export const TrustedIpsSchema = z.object({
diff --git a/backend/src/db/schemas/user-actions.ts b/backend/src/db/schemas/user-actions.ts
index 9937f36d68..89d2698470 100644
--- a/backend/src/db/schemas/user-actions.ts
+++ b/backend/src/db/schemas/user-actions.ts
@@ -5,8 +5,6 @@
import { z } from "zod";
-
-
import { TImmutableDBKeys } from "./models";
export const UserActionsSchema = z.object({
diff --git a/backend/src/db/schemas/user-aliases.ts b/backend/src/db/schemas/user-aliases.ts
index 0fdd59892c..14147abf8d 100644
--- a/backend/src/db/schemas/user-aliases.ts
+++ b/backend/src/db/schemas/user-aliases.ts
@@ -5,8 +5,6 @@
import { z } from "zod";
-
-
import { TImmutableDBKeys } from "./models";
export const UserAliasesSchema = z.object({
diff --git a/backend/src/db/schemas/user-encryption-keys.ts b/backend/src/db/schemas/user-encryption-keys.ts
index 4911cdf530..fd9d21a9d5 100644
--- a/backend/src/db/schemas/user-encryption-keys.ts
+++ b/backend/src/db/schemas/user-encryption-keys.ts
@@ -5,8 +5,6 @@
import { z } from "zod";
-
-
import { TImmutableDBKeys } from "./models";
export const UserEncryptionKeysSchema = z.object({
diff --git a/backend/src/db/schemas/user-group-membership.ts b/backend/src/db/schemas/user-group-membership.ts
index b23d8b15e6..6b5fccd46d 100644
--- a/backend/src/db/schemas/user-group-membership.ts
+++ b/backend/src/db/schemas/user-group-membership.ts
@@ -5,8 +5,6 @@
import { z } from "zod";
-
-
import { TImmutableDBKeys } from "./models";
export const UserGroupMembershipSchema = z.object({
diff --git a/backend/src/db/schemas/users.ts b/backend/src/db/schemas/users.ts
index d18722db75..1c1f579ead 100644
--- a/backend/src/db/schemas/users.ts
+++ b/backend/src/db/schemas/users.ts
@@ -5,8 +5,6 @@
import { z } from "zod";
-
-
import { TImmutableDBKeys } from "./models";
export const UsersSchema = z.object({
diff --git a/backend/src/db/schemas/webhooks.ts b/backend/src/db/schemas/webhooks.ts
index 1648b70410..60f031ffff 100644
--- a/backend/src/db/schemas/webhooks.ts
+++ b/backend/src/db/schemas/webhooks.ts
@@ -11,7 +11,7 @@ import { TImmutableDBKeys } from "./models";
export const WebhooksSchema = z.object({
id: z.string().uuid(),
- secretPath: z.string().default('/'),
+ secretPath: z.string().default("/"),
url: z.string().nullable().optional(),
lastStatus: z.string().nullable().optional(),
lastRunErrorMessage: z.string().nullable().optional(),
@@ -27,7 +27,7 @@ export const WebhooksSchema = z.object({
urlCipherText: z.string().nullable().optional(),
urlIV: z.string().nullable().optional(),
urlTag: z.string().nullable().optional(),
- type: z.string().default('general').nullable().optional(),
+ type: z.string().default("general").nullable().optional(),
encryptedPassKey: zodBuffer.nullable().optional(),
encryptedUrl: zodBuffer
});
diff --git a/backend/src/db/schemas/workflow-integrations.ts b/backend/src/db/schemas/workflow-integrations.ts
index 060b6ac2fe..ae1ae9a25c 100644
--- a/backend/src/db/schemas/workflow-integrations.ts
+++ b/backend/src/db/schemas/workflow-integrations.ts
@@ -5,8 +5,6 @@
import { z } from "zod";
-
-
import { TImmutableDBKeys } from "./models";
export const WorkflowIntegrationsSchema = z.object({
diff --git a/backend/src/ee/routes/v1/ssh-certificate-authority-router.ts b/backend/src/ee/routes/v1/ssh-certificate-authority-router.ts
index da9c2bd6a9..783cb9b727 100644
--- a/backend/src/ee/routes/v1/ssh-certificate-authority-router.ts
+++ b/backend/src/ee/routes/v1/ssh-certificate-authority-router.ts
@@ -4,12 +4,12 @@ import { EventType } from "@app/ee/services/audit-log/audit-log-types";
import { normalizeSshPrivateKey } from "@app/ee/services/ssh/ssh-certificate-authority-fns";
import { sanitizedSshCa } from "@app/ee/services/ssh/ssh-certificate-authority-schema";
import { SshCaKeySource, SshCaStatus } from "@app/ee/services/ssh/ssh-certificate-authority-types";
+import { SshCertKeyAlgorithm } from "@app/ee/services/ssh-certificate/ssh-certificate-types";
import { sanitizedSshCertificateTemplate } from "@app/ee/services/ssh-certificate-template/ssh-certificate-template-schema";
import { SSH_CERTIFICATE_AUTHORITIES } from "@app/lib/api-docs";
import { readLimit, writeLimit } from "@app/server/config/rateLimiter";
import { verifyAuth } from "@app/server/plugins/auth/verify-auth";
import { AuthMode } from "@app/services/auth/auth-type";
-import { CertKeyAlgorithm } from "@app/services/certificate/certificate-types";
export const registerSshCaRouter = async (server: FastifyZodProvider) => {
server.route({
@@ -26,8 +26,8 @@ export const registerSshCaRouter = async (server: FastifyZodProvider) => {
projectId: z.string().describe(SSH_CERTIFICATE_AUTHORITIES.CREATE.projectId),
friendlyName: z.string().describe(SSH_CERTIFICATE_AUTHORITIES.CREATE.friendlyName),
keyAlgorithm: z
- .nativeEnum(CertKeyAlgorithm)
- .default(CertKeyAlgorithm.RSA_2048)
+ .nativeEnum(SshCertKeyAlgorithm)
+ .default(SshCertKeyAlgorithm.ED25519)
.describe(SSH_CERTIFICATE_AUTHORITIES.CREATE.keyAlgorithm),
publicKey: z.string().trim().optional().describe(SSH_CERTIFICATE_AUTHORITIES.CREATE.publicKey),
privateKey: z
diff --git a/backend/src/ee/routes/v1/ssh-certificate-router.ts b/backend/src/ee/routes/v1/ssh-certificate-router.ts
index 249a96b500..eb0fc158af 100644
--- a/backend/src/ee/routes/v1/ssh-certificate-router.ts
+++ b/backend/src/ee/routes/v1/ssh-certificate-router.ts
@@ -2,13 +2,13 @@ import { z } from "zod";
import { EventType } from "@app/ee/services/audit-log/audit-log-types";
import { SshCertType } from "@app/ee/services/ssh/ssh-certificate-authority-types";
+import { SshCertKeyAlgorithm } from "@app/ee/services/ssh-certificate/ssh-certificate-types";
import { SSH_CERTIFICATE_AUTHORITIES } from "@app/lib/api-docs";
import { ms } from "@app/lib/ms";
import { writeLimit } from "@app/server/config/rateLimiter";
import { getTelemetryDistinctId } from "@app/server/lib/telemetry";
import { verifyAuth } from "@app/server/plugins/auth/verify-auth";
import { AuthMode } from "@app/services/auth/auth-type";
-import { CertKeyAlgorithm } from "@app/services/certificate/certificate-types";
import { PostHogEventTypes } from "@app/services/telemetry/telemetry-types";
export const registerSshCertRouter = async (server: FastifyZodProvider) => {
@@ -108,8 +108,8 @@ export const registerSshCertRouter = async (server: FastifyZodProvider) => {
.min(1)
.describe(SSH_CERTIFICATE_AUTHORITIES.ISSUE_SSH_CREDENTIALS.certificateTemplateId),
keyAlgorithm: z
- .nativeEnum(CertKeyAlgorithm)
- .default(CertKeyAlgorithm.RSA_2048)
+ .nativeEnum(SshCertKeyAlgorithm)
+ .default(SshCertKeyAlgorithm.ED25519)
.describe(SSH_CERTIFICATE_AUTHORITIES.ISSUE_SSH_CREDENTIALS.keyAlgorithm),
certType: z
.nativeEnum(SshCertType)
@@ -133,7 +133,7 @@ export const registerSshCertRouter = async (server: FastifyZodProvider) => {
privateKey: z.string().describe(SSH_CERTIFICATE_AUTHORITIES.ISSUE_SSH_CREDENTIALS.privateKey),
publicKey: z.string().describe(SSH_CERTIFICATE_AUTHORITIES.ISSUE_SSH_CREDENTIALS.publicKey),
keyAlgorithm: z
- .nativeEnum(CertKeyAlgorithm)
+ .nativeEnum(SshCertKeyAlgorithm)
.describe(SSH_CERTIFICATE_AUTHORITIES.ISSUE_SSH_CREDENTIALS.keyAlgorithm)
})
}
diff --git a/backend/src/ee/routes/v1/ssh-host-router.ts b/backend/src/ee/routes/v1/ssh-host-router.ts
index 671b296195..15ec5d417e 100644
--- a/backend/src/ee/routes/v1/ssh-host-router.ts
+++ b/backend/src/ee/routes/v1/ssh-host-router.ts
@@ -1,5 +1,6 @@
import { z } from "zod";
+import { SshCertKeyAlgorithm } from "@app/ee/services/ssh-certificate/ssh-certificate-types";
import { sanitizedSshHost } from "@app/ee/services/ssh-host/ssh-host-schema";
import { isValidHostname } from "@app/ee/services/ssh-host/ssh-host-validators";
import { SSH_HOSTS } from "@app/lib/api-docs";
@@ -262,4 +263,77 @@ export const registerSshHostRouter = async (server: FastifyZodProvider) => {
return host;
}
});
+
+ server.route({
+ // TODO: consider just using the SSH issue creds endpoint
+ method: "POST",
+ url: "/:sshHostId/issue",
+ config: {
+ rateLimit: writeLimit
+ },
+ onRequest: verifyAuth([AuthMode.JWT, AuthMode.IDENTITY_ACCESS_TOKEN]),
+ schema: {
+ description: "Issue SSH credentials (certificate + key)",
+ params: z.object({
+ sshHostId: z.string().describe(SSH_HOSTS.DELETE.sshHostId)
+ }),
+ response: {
+ 200: z.object({
+ serialNumber: z.string().describe(SSH_HOSTS.ISSUE_SSH_CREDENTIALS.serialNumber),
+ signedKey: z.string().describe(SSH_HOSTS.ISSUE_SSH_CREDENTIALS.signedKey),
+ privateKey: z.string().describe(SSH_HOSTS.ISSUE_SSH_CREDENTIALS.privateKey),
+ publicKey: z.string().describe(SSH_HOSTS.ISSUE_SSH_CREDENTIALS.publicKey),
+ keyAlgorithm: z.nativeEnum(SshCertKeyAlgorithm).describe(SSH_HOSTS.ISSUE_SSH_CREDENTIALS.keyAlgorithm)
+ })
+ }
+ },
+ handler: () => {
+ // const { serialNumber, signedPublicKey, privateKey, publicKey, certificateTemplate, ttl, keyId } =
+ // await server.services.sshCertificateAuthority.issueSshCreds({
+ // actor: req.permission.type,
+ // actorId: req.permission.id,
+ // actorAuthMethod: req.permission.authMethod,
+ // actorOrgId: req.permission.orgId,
+ // ...req.body
+ // });
+ // await server.services.auditLog.createAuditLog({
+ // ...req.auditLogInfo,
+ // orgId: req.permission.orgId,
+ // event: {
+ // type: EventType.ISSUE_SSH_CREDS,
+ // metadata: {
+ // certificateTemplateId: certificateTemplate.id,
+ // keyAlgorithm: req.body.keyAlgorithm,
+ // certType: req.body.certType,
+ // principals: req.body.principals,
+ // ttl: String(ttl),
+ // keyId
+ // }
+ // }
+ // });
+ // await server.services.telemetry.sendPostHogEvents({
+ // event: PostHogEventTypes.IssueSshCreds,
+ // distinctId: getTelemetryDistinctId(req),
+ // properties: {
+ // certificateTemplateId: req.body.certificateTemplateId,
+ // principals: req.body.principals,
+ // ...req.auditLogInfo
+ // }
+ // });
+ // return {
+ // serialNumber,
+ // signedKey: signedPublicKey,
+ // privateKey,
+ // publicKey,
+ // keyAlgorithm: req.body.keyAlgorithm
+ // };
+ return {
+ serialNumber: "",
+ signedKey: "",
+ privateKey: "",
+ publicKey: "",
+ keyAlgorithm: SshCertKeyAlgorithm.ED25519
+ };
+ }
+ });
};
diff --git a/backend/src/ee/services/audit-log/audit-log-types.ts b/backend/src/ee/services/audit-log/audit-log-types.ts
index 5e7df94444..53340e6e2a 100644
--- a/backend/src/ee/services/audit-log/audit-log-types.ts
+++ b/backend/src/ee/services/audit-log/audit-log-types.ts
@@ -3,6 +3,7 @@ import {
TUpdateProjectTemplateDTO
} from "@app/ee/services/project-template/project-template-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";
@@ -1358,7 +1359,7 @@ interface IssueSshCreds {
type: EventType.ISSUE_SSH_CREDS;
metadata: {
certificateTemplateId: string;
- keyAlgorithm: CertKeyAlgorithm;
+ keyAlgorithm: SshCertKeyAlgorithm;
certType: SshCertType;
principals: string[];
ttl: string;
diff --git a/backend/src/ee/services/ssh-certificate/ssh-certificate-types.ts b/backend/src/ee/services/ssh-certificate/ssh-certificate-types.ts
new file mode 100644
index 0000000000..14e2755eed
--- /dev/null
+++ b/backend/src/ee/services/ssh-certificate/ssh-certificate-types.ts
@@ -0,0 +1,7 @@
+export enum SshCertKeyAlgorithm {
+ RSA_2048 = "RSA_2048",
+ RSA_4096 = "RSA_4096",
+ ECDSA_P256 = "EC_prime256v1",
+ ECDSA_P384 = "EC_secp384r1",
+ ED25519 = "ED25519"
+}
diff --git a/backend/src/ee/services/ssh-host/ssh-host-service.ts b/backend/src/ee/services/ssh-host/ssh-host-service.ts
index 434479ced6..c6f7b565b0 100644
--- a/backend/src/ee/services/ssh-host/ssh-host-service.ts
+++ b/backend/src/ee/services/ssh-host/ssh-host-service.ts
@@ -29,6 +29,7 @@ export type TSshHostServiceFactory = ReturnType<typeof sshHostServiceFactory>;
*/
export const sshHostServiceFactory = ({
+ projectDAL
sshHostDAL,
sshHostLoginMappingDAL,
permissionService
@@ -70,6 +71,10 @@ export const sshHostServiceFactory = ({
});
}
+ // attach hosts?
+
+ // create host ssh cas in default bound to default user ca and host ca
+
const host = await sshHostDAL.create(
{
projectId,
diff --git a/backend/src/ee/services/ssh/ssh-certificate-authority-fns.ts b/backend/src/ee/services/ssh/ssh-certificate-authority-fns.ts
index 98e219f4f7..578e8b92b4 100644
--- a/backend/src/ee/services/ssh/ssh-certificate-authority-fns.ts
+++ b/backend/src/ee/services/ssh/ssh-certificate-authority-fns.ts
@@ -1,21 +1,29 @@
import { execFile } from "child_process";
import crypto from "crypto";
import { promises as fs } from "fs";
+import { Knex } from "knex";
import os from "os";
import path from "path";
import { promisify } from "util";
import { TSshCertificateTemplates } from "@app/db/schemas";
+import { SshCertKeyAlgorithm } from "@app/ee/services/ssh-certificate/ssh-certificate-types";
import { BadRequestError } from "@app/lib/errors";
import { ms } from "@app/lib/ms";
import { CharacterType, characterValidator } from "@app/lib/validator/validate-string";
-import { CertKeyAlgorithm } from "@app/services/certificate/certificate-types";
+import { KmsDataKey } from "@app/services/kms/kms-types";
import {
isValidHostPattern,
isValidUserPattern
} from "../ssh-certificate-template/ssh-certificate-template-validators";
-import { SshCertType, TCreateSshCertDTO } from "./ssh-certificate-authority-types";
+import {
+ SshCaKeySource,
+ SshCaStatus,
+ SshCertType,
+ TCreateSshCaHelperDTO,
+ TCreateSshCertDTO
+} from "./ssh-certificate-authority-types";
const execFileAsync = promisify(execFile);
@@ -31,31 +39,35 @@ export const createSshCertSerialNumber = () => {
* Return a pair of SSH CA keys based on the specified key algorithm [keyAlgorithm].
* We use this function because the key format generated by `ssh-keygen` is unique.
*/
-export const createSshKeyPair = async (keyAlgorithm: CertKeyAlgorithm) => {
+export const createSshKeyPair = async (keyAlgorithm: SshCertKeyAlgorithm) => {
const tempDir = await fs.mkdtemp(path.join(os.tmpdir(), "ssh-key-"));
const privateKeyFile = path.join(tempDir, "id_key");
const publicKeyFile = `${privateKeyFile}.pub`;
let keyType: string;
- let keyBits: string;
+ let keyBits: string | null;
switch (keyAlgorithm) {
- case CertKeyAlgorithm.RSA_2048:
+ case SshCertKeyAlgorithm.RSA_2048:
keyType = "rsa";
keyBits = "2048";
break;
- case CertKeyAlgorithm.RSA_4096:
+ case SshCertKeyAlgorithm.RSA_4096:
keyType = "rsa";
keyBits = "4096";
break;
- case CertKeyAlgorithm.ECDSA_P256:
+ case SshCertKeyAlgorithm.ECDSA_P256:
keyType = "ecdsa";
keyBits = "256";
break;
- case CertKeyAlgorithm.ECDSA_P384:
+ case SshCertKeyAlgorithm.ECDSA_P384:
keyType = "ecdsa";
keyBits = "384";
break;
+ case SshCertKeyAlgorithm.ED25519:
+ keyType = "ed25519";
+ keyBits = null;
+ break;
default:
throw new BadRequestError({
message: "Failed to produce SSH CA key pair generation command due to unrecognized key algorithm"
@@ -63,10 +75,16 @@ export const createSshKeyPair = async (keyAlgorithm: CertKeyAlgorithm) => {
}
try {
+ const args = ["-t", keyType];
+ if (keyBits !== null) {
+ args.push("-b", keyBits);
+ }
+ args.push("-f", privateKeyFile, "-N", "");
+
// Generate the SSH key pair
// The "-N ''" sets an empty passphrase
// The keys are created in the temporary directory
- await execFileAsync("ssh-keygen", ["-t", keyType, "-b", keyBits, "-f", privateKeyFile, "-N", ""], {
+ await execFileAsync("ssh-keygen", args, {
timeout: EXEC_TIMEOUT_MS
});
@@ -322,17 +340,22 @@ const validateSshPublicKey = async (publicKey: string) => {
}
};
-export const getKeyAlgorithmFromFingerprintOutput = (output: string): CertKeyAlgorithm | undefined => {
+export const getKeyAlgorithmFromFingerprintOutput = (output: string): SshCertKeyAlgorithm | undefined => {
const parts = output.trim().split(" ");
const bitsInt = parseInt(parts[0], 10);
const keyTypeRaw = parts.at(-1)?.replace(/[()]/g, ""); // remove surrounding parentheses
if (keyTypeRaw === "RSA") {
- return bitsInt === 2048 ? CertKeyAlgorithm.RSA_2048 : CertKeyAlgorithm.RSA_4096;
+ return bitsInt === 2048 ? SshCertKeyAlgorithm.RSA_2048 : SshCertKeyAlgorithm.RSA_4096;
}
if (keyTypeRaw === "ECDSA") {
- return bitsInt === 256 ? CertKeyAlgorithm.ECDSA_P256 : CertKeyAlgorithm.ECDSA_P384;
+ return bitsInt === 256 ? SshCertKeyAlgorithm.ECDSA_P256 : SshCertKeyAlgorithm.ECDSA_P384;
+ }
+
+ if (keyTypeRaw === "ED25519") {
+ // TODO: test
+ return SshCertKeyAlgorithm.ED25519;
}
return undefined;
@@ -473,3 +496,68 @@ export const createSshCert = async ({
await fs.rm(tempDir, { recursive: true, force: true }).catch(() => {});
}
};
+
+export const createSshCaHelper = async ({
+ projectId,
+ friendlyName,
+ keyAlgorithm: requestedKeyAlgorithm,
+ keySource,
+ externalPk,
+ externalSk,
+ sshCertificateAuthorityDAL,
+ sshCertificateAuthoritySecretDAL,
+ kmsService,
+ tx: outerTx
+}: TCreateSshCaHelperDTO) => {
+ // Function to handle the actual creation logic
+ const processCreation = async (tx: Knex) => {
+ let publicKey: string;
+ let privateKey: string;
+ let keyAlgorithm: SshCertKeyAlgorithm = requestedKeyAlgorithm;
+ if (keySource === SshCaKeySource.INTERNAL) {
+ // generate SSH CA key pair internally
+ ({ publicKey, privateKey } = await createSshKeyPair(requestedKeyAlgorithm));
+ } else {
+ // use external SSH CA key pair
+ if (!externalPk || !externalSk) {
+ throw new BadRequestError({
+ message: "Public and private keys are required if generateSigningKey is false"
+ });
+ }
+ publicKey = externalPk;
+ privateKey = externalSk;
+ keyAlgorithm = await validateExternalSshCaKeyPair(publicKey, privateKey);
+ }
+ const ca = await sshCertificateAuthorityDAL.create(
+ {
+ projectId,
+ friendlyName,
+ status: SshCaStatus.ACTIVE,
+ keyAlgorithm,
+ keySource
+ },
+ tx
+ );
+ const { encryptor: secretManagerEncryptor } = await kmsService.createCipherPairWithDataKey(
+ {
+ type: KmsDataKey.SecretManager,
+ projectId
+ },
+ tx
+ );
+ await sshCertificateAuthoritySecretDAL.create(
+ {
+ sshCaId: ca.id,
+ encryptedPrivateKey: secretManagerEncryptor({ plainText: Buffer.from(privateKey, "utf8") }).cipherTextBlob
+ },
+ tx
+ );
+ return { ...ca, publicKey };
+ };
+
+ if (outerTx) {
+ return processCreation(outerTx);
+ }
+
+ return sshCertificateAuthorityDAL.transaction(processCreation);
+};
diff --git a/backend/src/ee/services/ssh/ssh-certificate-authority-service.ts b/backend/src/ee/services/ssh/ssh-certificate-authority-service.ts
index 99d54f68a6..56c6b1c76e 100644
--- a/backend/src/ee/services/ssh/ssh-certificate-authority-service.ts
+++ b/backend/src/ee/services/ssh/ssh-certificate-authority-service.ts
@@ -7,14 +7,15 @@ import { TSshCertificateAuthorityDALFactory } from "@app/ee/services/ssh/ssh-cer
import { TSshCertificateAuthoritySecretDALFactory } from "@app/ee/services/ssh/ssh-certificate-authority-secret-dal";
import { TSshCertificateBodyDALFactory } from "@app/ee/services/ssh-certificate/ssh-certificate-body-dal";
import { TSshCertificateDALFactory } from "@app/ee/services/ssh-certificate/ssh-certificate-dal";
+import { SshCertKeyAlgorithm } from "@app/ee/services/ssh-certificate/ssh-certificate-types";
import { TSshCertificateTemplateDALFactory } from "@app/ee/services/ssh-certificate-template/ssh-certificate-template-dal";
import { BadRequestError, NotFoundError } from "@app/lib/errors";
-import { CertKeyAlgorithm } from "@app/services/certificate/certificate-types";
import { TKmsServiceFactory } from "@app/services/kms/kms-service";
import { KmsDataKey } from "@app/services/kms/kms-types";
import { SshCertTemplateStatus } from "../ssh-certificate-template/ssh-certificate-template-types";
import {
+ createSshCaHelper,
createSshCert,
createSshKeyPair,
getSshPublicKey,
@@ -89,52 +90,16 @@ export const sshCertificateAuthorityServiceFactory = ({
ProjectPermissionSub.SshCertificateAuthorities
);
- const newCa = await sshCertificateAuthorityDAL.transaction(async (tx) => {
- let publicKey: string;
- let privateKey: string;
- let keyAlgorithm: CertKeyAlgorithm = requestedKeyAlgorithm;
-
- if (keySource === SshCaKeySource.INTERNAL) {
- // generate SSH CA key pair internally
- ({ publicKey, privateKey } = await createSshKeyPair(requestedKeyAlgorithm));
- } else {
- // use external SSH CA key pair
- if (!externalPk || !externalSk) {
- throw new BadRequestError({
- message: "Public and private keys are required if generateSigningKey is false"
- });
- }
- publicKey = externalPk;
- privateKey = externalSk;
-
- keyAlgorithm = await validateExternalSshCaKeyPair(publicKey, privateKey);
- }
-
- const ca = await sshCertificateAuthorityDAL.create(
- {
- projectId,
- friendlyName,
- status: SshCaStatus.ACTIVE,
- keyAlgorithm,
- keySource
- },
- tx
- );
-
- const { encryptor: secretManagerEncryptor } = await kmsService.createCipherPairWithDataKey({
- type: KmsDataKey.SecretManager,
- projectId
- });
-
- await sshCertificateAuthoritySecretDAL.create(
- {
- sshCaId: ca.id,
- encryptedPrivateKey: secretManagerEncryptor({ plainText: Buffer.from(privateKey, "utf8") }).cipherTextBlob
- },
- tx
- );
-
- return { ...ca, publicKey };
+ const newCa = await createSshCaHelper({
+ projectId,
+ friendlyName,
+ keyAlgorithm: requestedKeyAlgorithm,
+ keySource,
+ externalPk,
+ externalSk,
+ sshCertificateAuthorityDAL,
+ sshCertificateAuthoritySecretDAL,
+ kmsService
});
return newCa;
diff --git a/backend/src/ee/services/ssh/ssh-certificate-authority-types.ts b/backend/src/ee/services/ssh/ssh-certificate-authority-types.ts
index d2dcb3807d..36a29a714d 100644
--- a/backend/src/ee/services/ssh/ssh-certificate-authority-types.ts
+++ b/backend/src/ee/services/ssh/ssh-certificate-authority-types.ts
@@ -1,6 +1,11 @@
+import { Knex } from "knex";
+
import { TSshCertificateTemplates } 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 { SshCertKeyAlgorithm } from "@app/ee/services/ssh-certificate/ssh-certificate-types";
import { TProjectPermission } from "@app/lib/types";
-import { CertKeyAlgorithm } from "@app/services/certificate/certificate-types";
+import { TKmsServiceFactory } from "@app/services/kms/kms-service";
export enum SshCaStatus {
ACTIVE = "active",
@@ -19,12 +24,25 @@ export enum SshCertType {
export type TCreateSshCaDTO = {
friendlyName: string;
- keyAlgorithm: CertKeyAlgorithm;
+ keyAlgorithm: SshCertKeyAlgorithm;
publicKey?: string;
privateKey?: string;
keySource: SshCaKeySource;
} & TProjectPermission;
+export type TCreateSshCaHelperDTO = {
+ projectId: string;
+ friendlyName: string;
+ keyAlgorithm: SshCertKeyAlgorithm;
+ keySource: SshCaKeySource;
+ externalPk?: string;
+ externalSk?: string;
+ sshCertificateAuthorityDAL: Pick<TSshCertificateAuthorityDALFactory, "transaction" | "create">;
+ sshCertificateAuthoritySecretDAL: Pick<TSshCertificateAuthoritySecretDALFactory, "create">;
+ kmsService: Pick<TKmsServiceFactory, "createCipherPairWithDataKey">;
+ tx?: Knex;
+};
+
export type TGetSshCaDTO = {
caId: string;
} & Omit<TProjectPermission, "projectId">;
@@ -45,7 +63,7 @@ export type TDeleteSshCaDTO = {
export type TIssueSshCredsDTO = {
certificateTemplateId: string;
- keyAlgorithm: CertKeyAlgorithm;
+ keyAlgorithm: SshCertKeyAlgorithm;
certType: SshCertType;
principals: string[];
ttl?: string;
diff --git a/backend/src/lib/api-docs/constants.ts b/backend/src/lib/api-docs/constants.ts
index 1b35b7ab14..dcb498539d 100644
--- a/backend/src/lib/api-docs/constants.ts
+++ b/backend/src/lib/api-docs/constants.ts
@@ -1342,6 +1342,13 @@ export const SSH_HOSTS = {
},
DELETE: {
sshHostId: "The ID of the SSH host to delete."
+ },
+ ISSUE_SSH_CREDENTIALS: {
+ keyAlgorithm: "The type of public key algorithm and size, in bits, of the key pair for the SSH host.",
+ serialNumber: "The serial number of the issued SSH certificate.",
+ signedKey: "The SSH certificate or signed SSH public key.",
+ privateKey: "The private key corresponding to the issued SSH certificate.",
+ publicKey: "The public key of the issued SSH certificate."
}
};
diff --git a/backend/src/server/routes/index.ts b/backend/src/server/routes/index.ts
index 850081b277..cb6e28afaf 100644
--- a/backend/src/server/routes/index.ts
+++ b/backend/src/server/routes/index.ts
@@ -184,6 +184,7 @@ import { pkiCollectionServiceFactory } from "@app/services/pki-collection/pki-co
import { projectDALFactory } from "@app/services/project/project-dal";
import { projectQueueFactory } from "@app/services/project/project-queue";
import { projectServiceFactory } from "@app/services/project/project-service";
+import { projectSshConfigDALFactory } from "@app/services/project/project-ssh-config-dal";
import { projectBotDALFactory } from "@app/services/project-bot/project-bot-dal";
import { projectBotServiceFactory } from "@app/services/project-bot/project-bot-service";
import { projectEnvDALFactory } from "@app/services/project-env/project-env-dal";
@@ -292,6 +293,7 @@ export const registerRoutes = async (
const apiKeyDAL = apiKeyDALFactory(db);
const projectDAL = projectDALFactory(db);
+ const projectSshConfigDAL = projectSshConfigDALFactory(db);
const projectMembershipDAL = projectMembershipDALFactory(db);
const projectUserAdditionalPrivilegeDAL = projectUserAdditionalPrivilegeDALFactory(db);
const projectUserMembershipRoleDAL = projectUserMembershipRoleDALFactory(db);
@@ -943,6 +945,7 @@ export const registerRoutes = async (
const projectService = projectServiceFactory({
permissionService,
projectDAL,
+ projectSshConfigDAL,
secretDAL,
secretV2BridgeDAL,
queueService,
@@ -964,6 +967,7 @@ export const registerRoutes = async (
pkiAlertDAL,
pkiCollectionDAL,
sshCertificateAuthorityDAL,
+ sshCertificateAuthoritySecretDAL,
sshCertificateDAL,
sshCertificateTemplateDAL,
sshHostDAL,
diff --git a/backend/src/services/project/project-fns.ts b/backend/src/services/project/project-fns.ts
index 92d0dfc39d..08652e3486 100644
--- a/backend/src/services/project/project-fns.ts
+++ b/backend/src/services/project/project-fns.ts
@@ -1,12 +1,15 @@
import crypto from "crypto";
import { ProjectVersion, TProjects } from "@app/db/schemas";
+import { createSshCaHelper } from "@app/ee/services/ssh/ssh-certificate-authority-fns";
+import { SshCaKeySource } from "@app/ee/services/ssh/ssh-certificate-authority-types";
+import { SshCertKeyAlgorithm } from "@app/ee/services/ssh-certificate/ssh-certificate-types";
import { decryptAsymmetric, encryptAsymmetric } from "@app/lib/crypto";
import { NotFoundError } from "@app/lib/errors";
import { TKmsServiceFactory } from "@app/services/kms/kms-service";
import { TProjectDALFactory } from "@app/services/project/project-dal";
-import { AddUserToWsDTO } from "./project-types";
+import { AddUserToWsDTO, TBootstrapSshProjectDTO } from "./project-types";
export const assignWorkspaceKeysToMembers = ({ members, decryptKey, userPrivateKey }: AddUserToWsDTO) => {
const plaintextProjectKey = decryptAsymmetric({
@@ -102,3 +105,48 @@ export const getProjectKmsCertificateKeyId = async ({
return keyId;
};
+
+/**
+ * Bootstraps an SSH project.
+ * - Creates a user and host SSH CA
+ * - Creates a project SSH config with the user and host SSH CA as defaults
+ */
+export const bootstrapSshProject = async ({
+ projectId,
+ sshCertificateAuthorityDAL,
+ sshCertificateAuthoritySecretDAL,
+ kmsService,
+ projectSshConfigDAL,
+ tx
+}: TBootstrapSshProjectDTO) => {
+ const userSshCa = await createSshCaHelper({
+ projectId,
+ friendlyName: "User CA",
+ keyAlgorithm: SshCertKeyAlgorithm.ED25519,
+ keySource: SshCaKeySource.INTERNAL,
+ sshCertificateAuthorityDAL,
+ sshCertificateAuthoritySecretDAL,
+ kmsService,
+ tx
+ });
+
+ const hostSshCa = await createSshCaHelper({
+ projectId,
+ friendlyName: "Host CA",
+ keyAlgorithm: SshCertKeyAlgorithm.ED25519,
+ keySource: SshCaKeySource.INTERNAL,
+ sshCertificateAuthorityDAL,
+ sshCertificateAuthoritySecretDAL,
+ kmsService,
+ tx
+ });
+
+ await projectSshConfigDAL.create(
+ {
+ projectId,
+ defaultHostSshCaId: hostSshCa.id,
+ defaultUserSshCaId: userSshCa.id
+ },
+ tx
+ );
+};
diff --git a/backend/src/services/project/project-service.ts b/backend/src/services/project/project-service.ts
index 0e39554f86..c6dac7f5fe 100644
--- a/backend/src/services/project/project-service.ts
+++ b/backend/src/services/project/project-service.ts
@@ -20,6 +20,7 @@ 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";
@@ -60,8 +61,9 @@ import { TProjectSlackConfigDALFactory } from "../slack/project-slack-config-dal
import { TSlackIntegrationDALFactory } from "../slack/slack-integration-dal";
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,
@@ -95,8 +97,8 @@ export const DEFAULT_PROJECT_ENVS = [
];
type TProjectServiceFactoryDep = {
- // TODO: Pick
projectDAL: TProjectDALFactory;
+ projectSshConfigDAL: Pick<TProjectSshConfigDALFactory, "create">;
projectQueue: TProjectQueueFactory;
userDAL: TUserDALFactory;
projectBotService: Pick<TProjectBotServiceFactory, "getBotKey">;
@@ -118,7 +120,8 @@ type TProjectServiceFactoryDep = {
certificateTemplateDAL: Pick<TCertificateTemplateDALFactory, "getCertTemplatesByProjectId">;
pkiAlertDAL: Pick<TPkiAlertDALFactory, "find">;
pkiCollectionDAL: Pick<TPkiCollectionDALFactory, "find">;
- sshCertificateAuthorityDAL: Pick<TSshCertificateAuthorityDALFactory, "find">;
+ sshCertificateAuthorityDAL: Pick<TSshCertificateAuthorityDALFactory, "find" | "create" | "transaction">;
+ sshCertificateAuthoritySecretDAL: Pick<TSshCertificateAuthoritySecretDALFactory, "create">;
sshCertificateDAL: Pick<TSshCertificateDALFactory, "find" | "countSshCertificatesInProject">;
sshCertificateTemplateDAL: Pick<TSshCertificateTemplateDALFactory, "find">;
sshHostDAL: Pick<TSshHostDALFactory, "find" | "findSshHostsWithLoginMappings">;
@@ -139,6 +142,7 @@ type TProjectServiceFactoryDep = {
| "getKmsById"
| "getProjectSecretManagerKmsKeyId"
| "deleteInternalKms"
+ | "createCipherPairWithDataKey"
>;
projectTemplateService: TProjectTemplateServiceFactory;
};
@@ -147,6 +151,7 @@ export type TProjectServiceFactory = ReturnType<typeof projectServiceFactory>;
export const projectServiceFactory = ({
projectDAL,
+ projectSshConfigDAL,
secretDAL,
secretV2BridgeDAL,
projectQueue,
@@ -172,6 +177,7 @@ export const projectServiceFactory = ({
pkiCollectionDAL,
pkiAlertDAL,
sshCertificateAuthorityDAL,
+ sshCertificateAuthoritySecretDAL,
sshCertificateDAL,
sshCertificateTemplateDAL,
sshHostDAL,
@@ -261,6 +267,17 @@ export const projectServiceFactory = ({
tx
);
+ if (type === ProjectType.SSH) {
+ await bootstrapSshProject({
+ projectId: project.id,
+ sshCertificateAuthorityDAL,
+ sshCertificateAuthoritySecretDAL,
+ kmsService,
+ projectSshConfigDAL,
+ tx
+ });
+ }
+
// set ghost user as admin of project
const projectMembership = await projectMembershipDAL.create(
{
diff --git a/backend/src/services/project/project-ssh-config-dal.ts b/backend/src/services/project/project-ssh-config-dal.ts
new file mode 100644
index 0000000000..5085bd4385
--- /dev/null
+++ b/backend/src/services/project/project-ssh-config-dal.ts
@@ -0,0 +1,11 @@
+import { TDbClient } from "@app/db";
+import { TableName } from "@app/db/schemas";
+import { ormify } from "@app/lib/knex";
+
+export type TProjectSshConfigDALFactory = ReturnType<typeof projectSshConfigDALFactory>;
+
+export const projectSshConfigDALFactory = (db: TDbClient) => {
+ const projectSshConfigOrm = ormify(db, TableName.ProjectSshConfig);
+
+ return projectSshConfigOrm;
+};
diff --git a/backend/src/services/project/project-types.ts b/backend/src/services/project/project-types.ts
index b9dee98bc1..906189be28 100644
--- a/backend/src/services/project/project-types.ts
+++ b/backend/src/services/project/project-types.ts
@@ -1,7 +1,11 @@
import { Knex } from "knex";
import { ProjectType, TProjectKeys } 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 { ActorAuthMethod, ActorType } from "../auth/auth-type";
@@ -159,3 +163,12 @@ export type TUpdateProjectSlackConfig = {
isSecretRequestNotificationEnabled: boolean;
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;
+};
diff --git a/frontend/src/hooks/api/sshCa/constants.tsx b/frontend/src/hooks/api/sshCa/constants.tsx
index 50b478952d..05380a239c 100644
--- a/frontend/src/hooks/api/sshCa/constants.tsx
+++ b/frontend/src/hooks/api/sshCa/constants.tsx
@@ -17,3 +17,42 @@ export enum SshCaKeySource {
INTERNAL = "internal",
EXTERNAL = "external"
}
+
+export enum SshCertKeyAlgorithm {
+ RSA_2048 = "RSA_2048",
+ RSA_4096 = "RSA_4096",
+ ECDSA_P256 = "EC_prime256v1",
+ ECDSA_P384 = "EC_secp384r1",
+ ED25519 = "ED25519"
+}
+
+export const sshCertKeyAlgorithmToNameMap: { [K in SshCertKeyAlgorithm]: string } = {
+ [SshCertKeyAlgorithm.RSA_2048]: "RSA 2048",
+ [SshCertKeyAlgorithm.RSA_4096]: "RSA 4096",
+ [SshCertKeyAlgorithm.ECDSA_P256]: "ECDSA P256",
+ [SshCertKeyAlgorithm.ECDSA_P384]: "ECDSA P384",
+ [SshCertKeyAlgorithm.ED25519]: "ED25519"
+};
+
+export const sshCertKeyAlgorithms = [
+ {
+ label: sshCertKeyAlgorithmToNameMap[SshCertKeyAlgorithm.RSA_2048],
+ value: SshCertKeyAlgorithm.RSA_2048
+ },
+ {
+ label: sshCertKeyAlgorithmToNameMap[SshCertKeyAlgorithm.RSA_4096],
+ value: SshCertKeyAlgorithm.RSA_4096
+ },
+ {
+ label: sshCertKeyAlgorithmToNameMap[SshCertKeyAlgorithm.ECDSA_P256],
+ value: SshCertKeyAlgorithm.ECDSA_P256
+ },
+ {
+ label: sshCertKeyAlgorithmToNameMap[SshCertKeyAlgorithm.ECDSA_P384],
+ value: SshCertKeyAlgorithm.ECDSA_P384
+ },
+ {
+ label: sshCertKeyAlgorithmToNameMap[SshCertKeyAlgorithm.ED25519],
+ value: SshCertKeyAlgorithm.ED25519
+ }
+];
diff --git a/frontend/src/hooks/api/sshCa/types.ts b/frontend/src/hooks/api/sshCa/types.ts
index 390d697d1f..f145332900 100644
--- a/frontend/src/hooks/api/sshCa/types.ts
+++ b/frontend/src/hooks/api/sshCa/types.ts
@@ -1,5 +1,4 @@
-import { CertKeyAlgorithm } from "../certificates/enums";
-import { SshCaKeySource, SshCaStatus, SshCertType } from "./constants";
+import { SshCaKeySource, SshCaStatus, SshCertKeyAlgorithm, SshCertType } from "./constants";
export type TSshCertificate = {
id: string;
@@ -18,7 +17,7 @@ export type TSshCertificateAuthority = {
projectId: string;
status: SshCaStatus;
friendlyName: string;
- keyAlgorithm: CertKeyAlgorithm;
+ keyAlgorithm: SshCertKeyAlgorithm;
keySource: SshCaKeySource;
createdAt: string;
updatedAt: string;
@@ -30,13 +29,13 @@ export type TCreateSshCaDTO =
projectId: string;
friendlyName?: string;
keySource: SshCaKeySource.INTERNAL;
- keyAlgorithm: CertKeyAlgorithm;
+ keyAlgorithm: SshCertKeyAlgorithm;
}
| {
projectId: string;
friendlyName?: string;
keySource: SshCaKeySource.EXTERNAL;
- keyAlgorithm: CertKeyAlgorithm;
+ keyAlgorithm: SshCertKeyAlgorithm;
publicKey: string;
privateKey: string;
};
@@ -69,7 +68,7 @@ export type TSignSshKeyResponse = {
export type TIssueSshCredsDTO = {
projectId: string;
certificateTemplateId: string;
- keyAlgorithm: CertKeyAlgorithm;
+ keyAlgorithm: SshCertKeyAlgorithm;
certType: SshCertType;
principals: string[];
ttl?: string;
@@ -81,5 +80,5 @@ export type TIssueSshCredsResponse = {
signedKey: string;
privateKey: string;
publicKey: string;
- keyAlgorithm: CertKeyAlgorithm;
+ keyAlgorithm: SshCertKeyAlgorithm;
};
diff --git a/frontend/src/pages/ssh/OverviewPage/components/SshCaModal.tsx b/frontend/src/pages/ssh/OverviewPage/components/SshCaModal.tsx
index ed2563cff4..184ca66d4b 100644
--- a/frontend/src/pages/ssh/OverviewPage/components/SshCaModal.tsx
+++ b/frontend/src/pages/ssh/OverviewPage/components/SshCaModal.tsx
@@ -17,9 +17,11 @@ import {
} from "@app/components/v2";
import { useWorkspace } from "@app/context";
import { useCreateSshCa, useGetSshCaById, useUpdateSshCa } from "@app/hooks/api";
-import { certKeyAlgorithms } from "@app/hooks/api/certificates/constants";
-import { CertKeyAlgorithm } from "@app/hooks/api/certificates/enums";
-import { SshCaKeySource } from "@app/hooks/api/sshCa/constants";
+import {
+ SshCaKeySource,
+ SshCertKeyAlgorithm,
+ sshCertKeyAlgorithms
+} from "@app/hooks/api/sshCa/constants";
import { ProjectType } from "@app/hooks/api/workspace/types";
import { UsePopUpState } from "@app/hooks/usePopUp";
@@ -40,10 +42,11 @@ const schema = z
publicKey: z.string().optional(),
privateKey: z.string().optional(),
keyAlgorithm: z.enum([
- CertKeyAlgorithm.RSA_2048,
- CertKeyAlgorithm.RSA_4096,
- CertKeyAlgorithm.ECDSA_P256,
- CertKeyAlgorithm.ECDSA_P384
+ SshCertKeyAlgorithm.RSA_2048,
+ SshCertKeyAlgorithm.RSA_4096,
+ SshCertKeyAlgorithm.ECDSA_P256,
+ SshCertKeyAlgorithm.ECDSA_P384,
+ SshCertKeyAlgorithm.ED25519
])
})
.required();
@@ -69,7 +72,7 @@ export const SshCaModal = ({ popUp, handlePopUpToggle }: Props) => {
resolver: zodResolver(schema),
defaultValues: {
friendlyName: "",
- keyAlgorithm: CertKeyAlgorithm.RSA_2048,
+ keyAlgorithm: SshCertKeyAlgorithm.ED25519,
keySource: SshCaKeySource.INTERNAL,
publicKey: "",
privateKey: ""
@@ -89,7 +92,7 @@ export const SshCaModal = ({ popUp, handlePopUpToggle }: Props) => {
} else {
reset({
friendlyName: "",
- keyAlgorithm: CertKeyAlgorithm.RSA_2048,
+ keyAlgorithm: SshCertKeyAlgorithm.ED25519,
keySource: SshCaKeySource.INTERNAL,
publicKey: "",
privateKey: ""
@@ -210,7 +213,7 @@ export const SshCaModal = ({ popUp, handlePopUpToggle }: Props) => {
<Controller
control={control}
name="keyAlgorithm"
- defaultValue={CertKeyAlgorithm.RSA_2048}
+ defaultValue={SshCertKeyAlgorithm.ED25519}
render={({ field: { onChange, ...field }, fieldState: { error } }) => (
<FormControl
label="Key Algorithm"
@@ -225,7 +228,7 @@ export const SshCaModal = ({ popUp, handlePopUpToggle }: Props) => {
className="w-full"
isDisabled={Boolean(ca)}
>
- {certKeyAlgorithms.map(({ label, value }) => (
+ {sshCertKeyAlgorithms.map(({ label, value }) => (
<SelectItem value={String(value || "")} key={label}>
{label}
</SelectItem>
diff --git a/frontend/src/pages/ssh/SshCaByIDPage/components/SshCaDetailsSection.tsx b/frontend/src/pages/ssh/SshCaByIDPage/components/SshCaDetailsSection.tsx
index 9151ebec5c..b2768dfe99 100644
--- a/frontend/src/pages/ssh/SshCaByIDPage/components/SshCaDetailsSection.tsx
+++ b/frontend/src/pages/ssh/SshCaByIDPage/components/SshCaDetailsSection.tsx
@@ -8,7 +8,7 @@ import { ProjectPermissionActions, ProjectPermissionSub } from "@app/context";
import { useTimedReset } from "@app/hooks";
import { useGetSshCaById } from "@app/hooks/api";
import { caStatusToNameMap } from "@app/hooks/api/ca/constants";
-import { certKeyAlgorithmToNameMap } from "@app/hooks/api/certificates/constants";
+import { sshCertKeyAlgorithmToNameMap } from "@app/hooks/api/sshCa/constants";
import { UsePopUpState } from "@app/hooks/usePopUp";
type Props = {
@@ -93,7 +93,9 @@ export const SshCaDetailsSection = ({ caId, handlePopUpOpen }: Props) => {
</div>
<div className="mb-4">
<p className="text-sm font-semibold text-mineshaft-300">Key Algorithm</p>
- <p className="text-sm text-mineshaft-300">{certKeyAlgorithmToNameMap[ca.keyAlgorithm]}</p>
+ <p className="text-sm text-mineshaft-300">
+ {sshCertKeyAlgorithmToNameMap[ca.keyAlgorithm]}
+ </p>
</div>
<div>
<p className="text-sm font-semibold text-mineshaft-300">Public Key</p>
diff --git a/frontend/src/pages/ssh/SshCaByIDPage/components/SshCertificateModal.tsx b/frontend/src/pages/ssh/SshCaByIDPage/components/SshCertificateModal.tsx
index b50e01acb4..5c46739316 100644
--- a/frontend/src/pages/ssh/SshCaByIDPage/components/SshCertificateModal.tsx
+++ b/frontend/src/pages/ssh/SshCaByIDPage/components/SshCertificateModal.tsx
@@ -22,9 +22,11 @@ import {
useListWorkspaceSshCertificateTemplates,
useSignSshKey
} from "@app/hooks/api";
-import { certKeyAlgorithms } from "@app/hooks/api/certificates/constants";
-import { CertKeyAlgorithm } from "@app/hooks/api/certificates/enums";
-import { SshCertType } from "@app/hooks/api/sshCa/constants";
+import {
+ SshCertKeyAlgorithm,
+ sshCertKeyAlgorithms,
+ SshCertType
+} from "@app/hooks/api/sshCa/constants";
import { UsePopUpState } from "@app/hooks/usePopUp";
import { SshCertificateContent } from "./SshCertificateContent";
@@ -33,10 +35,11 @@ const schema = z.object({
templateId: z.string(),
publicKey: z.string().optional(),
keyAlgorithm: z.enum([
- CertKeyAlgorithm.RSA_2048,
- CertKeyAlgorithm.RSA_4096,
- CertKeyAlgorithm.ECDSA_P256,
- CertKeyAlgorithm.ECDSA_P384
+ SshCertKeyAlgorithm.RSA_2048,
+ SshCertKeyAlgorithm.RSA_4096,
+ SshCertKeyAlgorithm.ECDSA_P256,
+ SshCertKeyAlgorithm.ECDSA_P384,
+ SshCertKeyAlgorithm.ED25519
]),
certType: z.nativeEnum(SshCertType),
principals: z.string(),
@@ -95,7 +98,7 @@ export const SshCertificateModal = ({ popUp, handlePopUpToggle }: Props) => {
} = useForm<FormData>({
resolver: zodResolver(schema),
defaultValues: {
- keyAlgorithm: CertKeyAlgorithm.RSA_2048,
+ keyAlgorithm: SshCertKeyAlgorithm.ED25519,
certType: SshCertType.USER
}
});
@@ -282,7 +285,7 @@ export const SshCertificateModal = ({ popUp, handlePopUpToggle }: Props) => {
<Controller
control={control}
name="keyAlgorithm"
- defaultValue={CertKeyAlgorithm.RSA_2048}
+ defaultValue={SshCertKeyAlgorithm.ED25519}
render={({ field: { onChange, ...field }, fieldState: { error } }) => (
<FormControl
label="Key Algorithm"
@@ -295,7 +298,7 @@ export const SshCertificateModal = ({ popUp, handlePopUpToggle }: Props) => {
onValueChange={(e) => onChange(e)}
className="w-full"
>
- {certKeyAlgorithms.map(({ label, value }) => (
+ {sshCertKeyAlgorithms.map(({ label, value }) => (
<SelectItem value={String(value || "")} key={label}>
{label}
</SelectItem>