mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-09-22 13:39:35 +00:00
Merge pull request #1895 from Infisical/maidul-12djiqd
This commit is contained in:
@@ -0,0 +1,21 @@
|
|||||||
|
import { Knex } from "knex";
|
||||||
|
|
||||||
|
import { TableName } from "../schemas";
|
||||||
|
|
||||||
|
export async function up(knex: Knex): Promise<void> {
|
||||||
|
const doesSecretVersionIdExist = await knex.schema.hasColumn(TableName.SnapshotSecret, "secretVersionId");
|
||||||
|
if (await knex.schema.hasTable(TableName.SnapshotSecret)) {
|
||||||
|
await knex.schema.alterTable(TableName.SnapshotSecret, (t) => {
|
||||||
|
if (doesSecretVersionIdExist) t.index("secretVersionId");
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export async function down(knex: Knex): Promise<void> {
|
||||||
|
const doesSecretVersionIdExist = await knex.schema.hasColumn(TableName.SnapshotSecret, "secretVersionId");
|
||||||
|
if (await knex.schema.hasTable(TableName.SnapshotSecret)) {
|
||||||
|
await knex.schema.alterTable(TableName.SnapshotSecret, (t) => {
|
||||||
|
if (doesSecretVersionIdExist) t.dropIndex("secretVersionId");
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -8,7 +8,6 @@ import {
|
|||||||
UsersSchema
|
UsersSchema
|
||||||
} from "@app/db/schemas";
|
} from "@app/db/schemas";
|
||||||
import { PROJECTS } from "@app/lib/api-docs";
|
import { PROJECTS } from "@app/lib/api-docs";
|
||||||
import { BadRequestError } from "@app/lib/errors";
|
|
||||||
import { readLimit, writeLimit } from "@app/server/config/rateLimiter";
|
import { readLimit, writeLimit } from "@app/server/config/rateLimiter";
|
||||||
import { verifyAuth } from "@app/server/plugins/auth/verify-auth";
|
import { verifyAuth } from "@app/server/plugins/auth/verify-auth";
|
||||||
import { AuthMode } from "@app/services/auth/auth-type";
|
import { AuthMode } from "@app/services/auth/auth-type";
|
||||||
@@ -193,19 +192,18 @@ export const registerProjectRouter = async (server: FastifyZodProvider) => {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
onRequest: verifyAuth([AuthMode.JWT, AuthMode.IDENTITY_ACCESS_TOKEN]),
|
onRequest: verifyAuth([AuthMode.JWT, AuthMode.IDENTITY_ACCESS_TOKEN]),
|
||||||
handler: async () => {
|
handler: async (req) => {
|
||||||
// const workspace = await server.services.project.deleteProject({
|
const workspace = await server.services.project.deleteProject({
|
||||||
// filter: {
|
filter: {
|
||||||
// type: ProjectFilterType.ID,
|
type: ProjectFilterType.ID,
|
||||||
// projectId: req.params.workspaceId
|
projectId: req.params.workspaceId
|
||||||
// },
|
},
|
||||||
// actorId: req.permission.id,
|
actorId: req.permission.id,
|
||||||
// actorAuthMethod: req.permission.authMethod,
|
actorAuthMethod: req.permission.authMethod,
|
||||||
// actor: req.permission.type,
|
actor: req.permission.type,
|
||||||
// actorOrgId: req.permission.orgId
|
actorOrgId: req.permission.orgId
|
||||||
// });
|
});
|
||||||
// return { workspace };
|
return { workspace };
|
||||||
throw new BadRequestError({ message: "Project delete has been paused temporarily, please try again later" });
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user