mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-09 05:28:23 +00:00
upgrade major version of mongoose from v6 to v7
This commit is contained in:
Generated
+539
-373
File diff suppressed because it is too large
Load Diff
@@ -30,7 +30,8 @@
|
|||||||
"jsrp": "^0.2.4",
|
"jsrp": "^0.2.4",
|
||||||
"libsodium-wrappers": "^0.7.10",
|
"libsodium-wrappers": "^0.7.10",
|
||||||
"lodash": "^4.17.21",
|
"lodash": "^4.17.21",
|
||||||
"mongoose": "^6.10.5",
|
"mongodb": "^5.7.0",
|
||||||
|
"mongoose": "^7.4.1",
|
||||||
"nanoid": "^3.3.6",
|
"nanoid": "^3.3.6",
|
||||||
"node-cache": "^5.1.2",
|
"node-cache": "^5.1.2",
|
||||||
"nodemailer": "^6.8.0",
|
"nodemailer": "^6.8.0",
|
||||||
|
|||||||
@@ -72,7 +72,8 @@ export const deleteWebhook = async (req: Request, res: Response) => {
|
|||||||
workspaceId: webhook.workspace,
|
workspaceId: webhook.workspace,
|
||||||
acceptedRoles: [ADMIN, MEMBER]
|
acceptedRoles: [ADMIN, MEMBER]
|
||||||
});
|
});
|
||||||
await webhook.remove();
|
|
||||||
|
await webhook.deleteOne();
|
||||||
|
|
||||||
return res.status(200).send({
|
return res.status(200).send({
|
||||||
message: "successfully removed webhook"
|
message: "successfully removed webhook"
|
||||||
|
|||||||
@@ -83,7 +83,7 @@ export const createServiceAccount = async (req: Request, res: Response) => {
|
|||||||
lastUsed: new Date(),
|
lastUsed: new Date(),
|
||||||
expiresAt,
|
expiresAt,
|
||||||
secretHash,
|
secretHash,
|
||||||
}).save();
|
}).save()
|
||||||
|
|
||||||
const serviceAccountObj = serviceAccount.toObject();
|
const serviceAccountObj = serviceAccount.toObject();
|
||||||
|
|
||||||
|
|||||||
@@ -151,7 +151,7 @@ export const getAuthSTDPayload = async ({
|
|||||||
const [_, TOKEN_IDENTIFIER, TOKEN_SECRET] = <[string, string, string]>authTokenValue.split(".", 3);
|
const [_, TOKEN_IDENTIFIER, TOKEN_SECRET] = <[string, string, string]>authTokenValue.split(".", 3);
|
||||||
|
|
||||||
let serviceTokenData = await ServiceTokenData
|
let serviceTokenData = await ServiceTokenData
|
||||||
.findById(TOKEN_IDENTIFIER, "+secretHash +expiresAt");
|
.findById(TOKEN_IDENTIFIER, "+secretHash +expiresAt").lean();
|
||||||
|
|
||||||
if (!serviceTokenData) {
|
if (!serviceTokenData) {
|
||||||
throw ServiceTokenDataNotFoundError({ message: "Failed to find service token data" });
|
throw ServiceTokenDataNotFoundError({ message: "Failed to find service token data" });
|
||||||
@@ -176,7 +176,7 @@ export const getAuthSTDPayload = async ({
|
|||||||
}, {
|
}, {
|
||||||
new: true,
|
new: true,
|
||||||
})
|
})
|
||||||
.select("+encryptedKey +iv +tag");
|
.select("+encryptedKey +iv +tag").lean();
|
||||||
|
|
||||||
if (!serviceTokenData) throw ServiceTokenDataNotFoundError({ message: "Failed to find service token data" });
|
if (!serviceTokenData) throw ServiceTokenDataNotFoundError({ message: "Failed to find service token data" });
|
||||||
|
|
||||||
|
|||||||
@@ -484,7 +484,7 @@ export const v2PushSecrets = async ({
|
|||||||
|
|
||||||
// (EE) add secret versions for new secrets
|
// (EE) add secret versions for new secrets
|
||||||
EESecretService.addSecretVersions({
|
EESecretService.addSecretVersions({
|
||||||
secretVersions: newSecrets.map((secretDocument: ISecret) => {
|
secretVersions: newSecrets.map((secretDocument) => {
|
||||||
return new SecretVersion({
|
return new SecretVersion({
|
||||||
...secretDocument,
|
...secretDocument,
|
||||||
secret: secretDocument._id,
|
secret: secretDocument._id,
|
||||||
|
|||||||
@@ -490,7 +490,7 @@ export const backfillSecretFolders = async () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
await SecretSnapshot.insertMany(newSnapshots);
|
await SecretSnapshot.insertMany(newSnapshots);
|
||||||
await secSnapshot.delete();
|
await secSnapshot.deleteOne();
|
||||||
}
|
}
|
||||||
|
|
||||||
secretSnapshots = await SecretSnapshot.find({
|
secretSnapshots = await SecretSnapshot.find({
|
||||||
|
|||||||
Reference in New Issue
Block a user