feat: fixed review comments

This commit is contained in:
=
2024-12-13 21:38:43 +05:30
parent 9b4e1f561e
commit c57fc5e3f1
37 changed files with 148 additions and 83 deletions
@@ -202,7 +202,7 @@ export async function up(knex: Knex): Promise<void> {
.select("projectId");
for (const { projectId } of projectsWithCmek) {
if (projectId) {
const newProjectId = await newProject(knex, projectId, ProjectType.Cmek);
const newProjectId = await newProject(knex, projectId, ProjectType.KMS);
await knex(TableName.KmsKey)
.where({
isReserved: false,
@@ -211,14 +211,13 @@ export async function up(knex: Knex): Promise<void> {
.update({ projectId: newProjectId });
await knex(TableName.ProjectSplitBackfillIds).insert({
sourceProjectId: projectId,
destinationProjectType: ProjectType.Cmek,
destinationProjectType: ProjectType.KMS,
destinationProjectId: newProjectId
});
}
}
/* eslint-enable */
await knex.schema.alterTable(TableName.Project, (t) => {
t.string("type").notNullable().alter();
});
+1 -1
View File
@@ -205,5 +205,5 @@ export enum IdentityAuthMethod {
export enum ProjectType {
SecretManager = "secret-manager",
CertificateManager = "cert-manager",
Cmek = "cmek"
KMS = "kms"
}
+1 -1
View File
@@ -25,7 +25,7 @@ export const ProjectsSchema = z.object({
kmsSecretManagerKeyId: z.string().uuid().nullable().optional(),
kmsSecretManagerEncryptedDataKey: zodBuffer.nullable().optional(),
description: z.string().nullable().optional(),
type: z.string().nullable().optional()
type: z.string()
});
export type TProjects = z.infer<typeof ProjectsSchema>;