From 4c1093e2e48a00f5be849456a60443deaa544103 Mon Sep 17 00:00:00 2001 From: Daniel Date: Tue, 23 May 2023 00:39:32 +1000 Subject: [PATCH 01/32] refactor: Upgrade path-to-regexp from 0.1.7 to 6.2.1 (#8558) --- package-lock.json | 24 +++++++++++++++++------- package.json | 2 +- src/cloud-code/Parse.Cloud.js | 4 ++-- src/middlewares.js | 8 ++++++-- 4 files changed, 26 insertions(+), 12 deletions(-) diff --git a/package-lock.json b/package-lock.json index 5f2b1c4917..0251984a35 100644 --- a/package-lock.json +++ b/package-lock.json @@ -40,7 +40,7 @@ "mongodb": "4.10.0", "mustache": "4.2.0", "parse": "4.0.1", - "path-to-regexp": "0.1.7", + "path-to-regexp": "6.2.1", "pg-monitor": "2.0.0", "pg-promise": "11.3.0", "pluralize": "8.0.0", @@ -7314,6 +7314,11 @@ "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==" }, + "node_modules/express/node_modules/path-to-regexp": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz", + "integrity": "sha512-5DFkuoqlv1uYQKxy8omFBeJPQcdoE07Kv2sferDCrAq1ohOU+MSDswDIbnx3YAM60qIOnYa53wBhXW0EbMonrQ==" + }, "node_modules/ext": { "version": "1.7.0", "resolved": "https://registry.npmjs.org/ext/-/ext-1.7.0.tgz", @@ -16206,9 +16211,9 @@ "dev": true }, "node_modules/path-to-regexp": { - "version": "0.1.7", - "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz", - "integrity": "sha512-5DFkuoqlv1uYQKxy8omFBeJPQcdoE07Kv2sferDCrAq1ohOU+MSDswDIbnx3YAM60qIOnYa53wBhXW0EbMonrQ==" + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-6.2.1.tgz", + "integrity": "sha512-JLyh7xT1kizaEvcaXOQwOc2/Yhw6KZOvPf1S8401UyLk86CU79LN3vl7ztXGm/pZ+YjoyAJ4rxmHwbkBXJX+yw==" }, "node_modules/path-type": { "version": "4.0.0", @@ -26129,6 +26134,11 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==" + }, + "path-to-regexp": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz", + "integrity": "sha512-5DFkuoqlv1uYQKxy8omFBeJPQcdoE07Kv2sferDCrAq1ohOU+MSDswDIbnx3YAM60qIOnYa53wBhXW0EbMonrQ==" } } }, @@ -32836,9 +32846,9 @@ "dev": true }, "path-to-regexp": { - "version": "0.1.7", - "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz", - "integrity": "sha512-5DFkuoqlv1uYQKxy8omFBeJPQcdoE07Kv2sferDCrAq1ohOU+MSDswDIbnx3YAM60qIOnYa53wBhXW0EbMonrQ==" + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-6.2.1.tgz", + "integrity": "sha512-JLyh7xT1kizaEvcaXOQwOc2/Yhw6KZOvPf1S8401UyLk86CU79LN3vl7ztXGm/pZ+YjoyAJ4rxmHwbkBXJX+yw==" }, "path-type": { "version": "4.0.0", diff --git a/package.json b/package.json index 0d42ed88dd..127abee3eb 100644 --- a/package.json +++ b/package.json @@ -49,7 +49,7 @@ "mongodb": "4.10.0", "mustache": "4.2.0", "parse": "4.0.1", - "path-to-regexp": "0.1.7", + "path-to-regexp": "6.2.1", "pg-monitor": "2.0.0", "pg-promise": "11.3.0", "pluralize": "8.0.0", diff --git a/src/cloud-code/Parse.Cloud.js b/src/cloud-code/Parse.Cloud.js index 5540e8d719..01bf65f42c 100644 --- a/src/cloud-code/Parse.Cloud.js +++ b/src/cloud-code/Parse.Cloud.js @@ -82,9 +82,9 @@ const getRoute = parseClass => { '@File': 'files', }[parseClass] || 'classes'; if (parseClass === '@File') { - return `/${route}/:id?*`; + return `/${route}/:id?(.*)`; } - return `/${route}/${parseClass}/:id?*`; + return `/${route}/${parseClass}/:id?(.*)`; }; /** @namespace * @name Parse diff --git a/src/middlewares.js b/src/middlewares.js index 2e450f3e03..faaafe542f 100644 --- a/src/middlewares.js +++ b/src/middlewares.js @@ -9,7 +9,7 @@ import MongoStorageAdapter from './Adapters/Storage/Mongo/MongoStorageAdapter'; import PostgresStorageAdapter from './Adapters/Storage/Postgres/PostgresStorageAdapter'; import rateLimit from 'express-rate-limit'; import { RateLimitOptions } from './Options/Definitions'; -import pathToRegexp from 'path-to-regexp'; +import { pathToRegexp } from 'path-to-regexp'; import ipRangeCheck from 'ip-range-check'; import RedisStore from 'rate-limit-redis'; import { createClient } from 'redis'; @@ -512,8 +512,12 @@ export const addRateLimit = (route, config, cloud) => { }, }); } + let transformPath = route.requestPath.replaceAll('/*', '/(.*)'); + if (transformPath === '*') { + transformPath = '(.*)'; + } config.rateLimits.push({ - path: pathToRegexp(route.requestPath), + path: pathToRegexp(transformPath), handler: rateLimit({ windowMs: route.requestTimeWindow, max: route.requestCount, From a005874776d31bd14e5c86ad7d64c2b91549b021 Mon Sep 17 00:00:00 2001 From: Daniel Date: Tue, 23 May 2023 01:11:50 +1000 Subject: [PATCH 02/32] refactor: Upgrade commander from 5.1.0 to 10.0.1 (#8557) --- package-lock.json | 31 +++++++++++++++++++++++-------- package.json | 2 +- spec/CLI.spec.js | 3 +-- src/cli/utils/commander.js | 2 +- 4 files changed, 26 insertions(+), 12 deletions(-) diff --git a/package-lock.json b/package-lock.json index 0251984a35..5f38c25bb1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -19,7 +19,7 @@ "@parse/push-adapter": "4.1.2", "bcryptjs": "2.4.3", "body-parser": "1.20.1", - "commander": "5.1.0", + "commander": "10.0.1", "cors": "2.8.5", "deepcopy": "2.1.0", "express": "4.18.2", @@ -5196,11 +5196,11 @@ } }, "node_modules/commander": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-5.1.0.tgz", - "integrity": "sha512-P0CysNDQ7rtVw4QIQtm+MRxV66vKFSvlsQvGYXZWR3qFU0jlMKHZZZgw8e+8DSah4UDKMqnknRDQz+xuQXQ/Zg==", + "version": "10.0.1", + "resolved": "https://registry.npmjs.org/commander/-/commander-10.0.1.tgz", + "integrity": "sha512-y4Mg2tXshplEbSGzx7amzPwKKOCGuoSRP/CjEdwwk0FOGlUbq6lKuoyDZTNZkmxHdJtp54hdfY/JUrdL7Xfdug==", "engines": { - "node": ">= 6" + "node": ">=14" } }, "node_modules/commondir": { @@ -10426,6 +10426,15 @@ "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "dev": true }, + "node_modules/lint-staged/node_modules/commander": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-5.1.0.tgz", + "integrity": "sha512-P0CysNDQ7rtVw4QIQtm+MRxV66vKFSvlsQvGYXZWR3qFU0jlMKHZZZgw8e+8DSah4UDKMqnknRDQz+xuQXQ/Zg==", + "dev": true, + "engines": { + "node": ">= 6" + } + }, "node_modules/lint-staged/node_modules/cosmiconfig": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-6.0.0.tgz", @@ -24462,9 +24471,9 @@ } }, "commander": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-5.1.0.tgz", - "integrity": "sha512-P0CysNDQ7rtVw4QIQtm+MRxV66vKFSvlsQvGYXZWR3qFU0jlMKHZZZgw8e+8DSah4UDKMqnknRDQz+xuQXQ/Zg==" + "version": "10.0.1", + "resolved": "https://registry.npmjs.org/commander/-/commander-10.0.1.tgz", + "integrity": "sha512-y4Mg2tXshplEbSGzx7amzPwKKOCGuoSRP/CjEdwwk0FOGlUbq6lKuoyDZTNZkmxHdJtp54hdfY/JUrdL7Xfdug==" }, "commondir": { "version": "1.0.1", @@ -28521,6 +28530,12 @@ "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "dev": true }, + "commander": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-5.1.0.tgz", + "integrity": "sha512-P0CysNDQ7rtVw4QIQtm+MRxV66vKFSvlsQvGYXZWR3qFU0jlMKHZZZgw8e+8DSah4UDKMqnknRDQz+xuQXQ/Zg==", + "dev": true + }, "cosmiconfig": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-6.0.0.tgz", diff --git a/package.json b/package.json index 127abee3eb..33727a9832 100644 --- a/package.json +++ b/package.json @@ -28,7 +28,7 @@ "@parse/push-adapter": "4.1.2", "bcryptjs": "2.4.3", "body-parser": "1.20.1", - "commander": "5.1.0", + "commander": "10.0.1", "cors": "2.8.5", "deepcopy": "2.1.0", "express": "4.18.2", diff --git a/spec/CLI.spec.js b/spec/CLI.spec.js index 9affc31016..20667fd349 100644 --- a/spec/CLI.spec.js +++ b/spec/CLI.spec.js @@ -74,7 +74,7 @@ describe('commander additions', () => { done(); }); - it('should load properly use args over env', done => { + it('should load properly use args over env', () => { commander.loadDefinitions(testDefinitions); commander.parse(['node', './CLI.spec.js', '--arg0', 'arg0Value', '--arg4', ''], { PROGRAM_ARG_0: 'arg0ENVValue', @@ -86,7 +86,6 @@ describe('commander additions', () => { expect(commander.arg1).toEqual('arg1ENVValue'); expect(commander.arg2).toEqual(4); expect(commander.arg4).toEqual(''); - done(); }); it('should fail in action as port is invalid', done => { diff --git a/src/cli/utils/commander.js b/src/cli/utils/commander.js index 8b8826fe69..75075bb3ac 100644 --- a/src/cli/utils/commander.js +++ b/src/cli/utils/commander.js @@ -136,5 +136,5 @@ Command.prototype.getOptions = function () { }, {}); }; -export default new Command(); +export default new Command().storeOptionsAsProperties(); /* eslint-enable no-console */ From b0b99e7451b0c632702ce42336609fdd0dbee340 Mon Sep 17 00:00:00 2001 From: Snyk bot Date: Wed, 24 May 2023 00:39:18 +0100 Subject: [PATCH 03/32] refactor: Security upgrade @parse/push-adapter from 4.1.2 to 4.1.3 (#8572) --- package-lock.json | 20 ++++++++++---------- package.json | 2 +- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/package-lock.json b/package-lock.json index 5f38c25bb1..365f254c54 100644 --- a/package-lock.json +++ b/package-lock.json @@ -11,12 +11,12 @@ "license": "Apache-2.0", "dependencies": { "@babel/eslint-parser": "7.19.1", - "@graphql-tools/merge": "^8.4.1", + "@graphql-tools/merge": "8.4.1", "@graphql-tools/schema": "9.0.4", "@graphql-tools/utils": "8.12.0", "@graphql-yoga/node": "2.6.0", "@parse/fs-files-adapter": "1.2.2", - "@parse/push-adapter": "4.1.2", + "@parse/push-adapter": "^4.1.3", "bcryptjs": "2.4.3", "body-parser": "1.20.1", "commander": "10.0.1", @@ -45,14 +45,14 @@ "pg-promise": "11.3.0", "pluralize": "8.0.0", "rate-limit-redis": "3.0.1", - "redis": "^4.6.6", + "redis": "4.6.6", "semver": "7.3.8", "subscriptions-transport-ws": "0.11.0", "tv4": "1.3.0", "uuid": "9.0.0", "winston": "3.8.1", "winston-daily-rotate-file": "4.7.1", - "ws": "^8.13.0" + "ws": "8.13.0" }, "bin": { "parse-server": "bin/parse-server" @@ -2809,9 +2809,9 @@ } }, "node_modules/@parse/push-adapter": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/@parse/push-adapter/-/push-adapter-4.1.2.tgz", - "integrity": "sha512-034vZTlAzgdfefIY4+Q4j8DHS/VwUAIVoh1JeRkHNfyQmUQ++uKbQbUQdJ/nf11HHS69kwLENs13BmhlHMpyHQ==", + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/@parse/push-adapter/-/push-adapter-4.1.3.tgz", + "integrity": "sha512-Oy53ag7DpUva5dUWwP6tNEsrxv2xU9QIk+rb84q1DIm1qVgo2yl4oXcZ3FPG2Ks/NYURbv4w+z9oaSgVfyBRfQ==", "dependencies": { "@parse/node-apn": "5.1.3", "@parse/node-gcm": "1.0.2", @@ -22608,9 +22608,9 @@ } }, "@parse/push-adapter": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/@parse/push-adapter/-/push-adapter-4.1.2.tgz", - "integrity": "sha512-034vZTlAzgdfefIY4+Q4j8DHS/VwUAIVoh1JeRkHNfyQmUQ++uKbQbUQdJ/nf11HHS69kwLENs13BmhlHMpyHQ==", + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/@parse/push-adapter/-/push-adapter-4.1.3.tgz", + "integrity": "sha512-Oy53ag7DpUva5dUWwP6tNEsrxv2xU9QIk+rb84q1DIm1qVgo2yl4oXcZ3FPG2Ks/NYURbv4w+z9oaSgVfyBRfQ==", "requires": { "@parse/node-apn": "5.1.3", "@parse/node-gcm": "1.0.2", diff --git a/package.json b/package.json index 33727a9832..91dd562275 100644 --- a/package.json +++ b/package.json @@ -25,7 +25,7 @@ "@graphql-tools/utils": "8.12.0", "@graphql-yoga/node": "2.6.0", "@parse/fs-files-adapter": "1.2.2", - "@parse/push-adapter": "4.1.2", + "@parse/push-adapter": "4.1.3", "bcryptjs": "2.4.3", "body-parser": "1.20.1", "commander": "10.0.1", From f911f2cd3a8c45cd326272dcd681532764a3761e Mon Sep 17 00:00:00 2001 From: Daniel Date: Thu, 25 May 2023 21:13:39 +1000 Subject: [PATCH 04/32] fix: Rate limit feature is incompatible with Node 14 (#8578) --- src/middlewares.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/middlewares.js b/src/middlewares.js index faaafe542f..b86dafb6b7 100644 --- a/src/middlewares.js +++ b/src/middlewares.js @@ -512,7 +512,7 @@ export const addRateLimit = (route, config, cloud) => { }, }); } - let transformPath = route.requestPath.replaceAll('/*', '/(.*)'); + let transformPath = route.requestPath.split('/*').join('/(.*)'); if (transformPath === '*') { transformPath = '(.*)'; } From 3030c7652edda516bb43acc0fa6f625bef1ba2b2 Mon Sep 17 00:00:00 2001 From: semantic-release-bot Date: Thu, 25 May 2023 11:15:05 +0000 Subject: [PATCH 05/32] chore(release): 6.1.0-alpha.13 [skip ci] # [6.1.0-alpha.13](https://github.com/parse-community/parse-server/compare/6.1.0-alpha.12...6.1.0-alpha.13) (2023-05-25) ### Bug Fixes * Rate limit feature is incompatible with Node 14 ([#8578](https://github.com/parse-community/parse-server/issues/8578)) ([f911f2c](https://github.com/parse-community/parse-server/commit/f911f2cd3a8c45cd326272dcd681532764a3761e)) --- changelogs/CHANGELOG_alpha.md | 7 +++++++ package-lock.json | 4 ++-- package.json | 2 +- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/changelogs/CHANGELOG_alpha.md b/changelogs/CHANGELOG_alpha.md index b4088dba72..9a5cae7fda 100644 --- a/changelogs/CHANGELOG_alpha.md +++ b/changelogs/CHANGELOG_alpha.md @@ -1,3 +1,10 @@ +# [6.1.0-alpha.13](https://github.com/parse-community/parse-server/compare/6.1.0-alpha.12...6.1.0-alpha.13) (2023-05-25) + + +### Bug Fixes + +* Rate limit feature is incompatible with Node 14 ([#8578](https://github.com/parse-community/parse-server/issues/8578)) ([f911f2c](https://github.com/parse-community/parse-server/commit/f911f2cd3a8c45cd326272dcd681532764a3761e)) + # [6.1.0-alpha.12](https://github.com/parse-community/parse-server/compare/6.1.0-alpha.11...6.1.0-alpha.12) (2023-05-19) diff --git a/package-lock.json b/package-lock.json index 365f254c54..88bf2460ed 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "parse-server", - "version": "6.1.0-alpha.12", + "version": "6.1.0-alpha.13", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "parse-server", - "version": "6.1.0-alpha.12", + "version": "6.1.0-alpha.13", "hasInstallScript": true, "license": "Apache-2.0", "dependencies": { diff --git a/package.json b/package.json index 91dd562275..717f720a74 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "parse-server", - "version": "6.1.0-alpha.12", + "version": "6.1.0-alpha.13", "description": "An express module providing a Parse-compatible API server", "main": "lib/index.js", "repository": { From fd6a0077f2e5cf83d65e52172ae5a950ab0f1eae Mon Sep 17 00:00:00 2001 From: Daniel Date: Thu, 25 May 2023 22:00:56 +1000 Subject: [PATCH 06/32] fix: Unnecessary log entries by `extendSessionOnUse` (#8562) --- src/Auth.js | 1 - 1 file changed, 1 deletion(-) diff --git a/src/Auth.js b/src/Auth.js index 0617301d69..96c99cbb1d 100644 --- a/src/Auth.js +++ b/src/Auth.js @@ -84,7 +84,6 @@ const renewSessionIfNeeded = async ({ config, session, sessionToken }) => { { sessionToken }, { limit: 1 } ).execute(); - console.log({ results }); session = results[0]; } const lastUpdated = new Date(session?.updatedAt); From 28aeda3f160efcbbcf85a85484a8d26567fa9761 Mon Sep 17 00:00:00 2001 From: Daniel Date: Fri, 26 May 2023 06:02:33 +1000 Subject: [PATCH 07/32] feat: Allow `Parse.Object` pointers in Cloud Code arguments (#8490) --- spec/CloudCode.spec.js | 21 +++++++++++++++++++++ src/Routers/FunctionsRouter.js | 6 ++++++ 2 files changed, 27 insertions(+) diff --git a/spec/CloudCode.spec.js b/spec/CloudCode.spec.js index c02999ad51..e77b1c69a7 100644 --- a/spec/CloudCode.spec.js +++ b/spec/CloudCode.spec.js @@ -1352,6 +1352,27 @@ describe('Cloud Code', () => { }); }); + it('allow cloud to encode Parse Objects', async () => { + const user = new Parse.User(); + user.setUsername('username'); + user.setPassword('password'); + user.set('deleted', false); + await user.signUp(); + Parse.Cloud.define( + 'deleteAccount', + async req => { + expect(req.params.object instanceof Parse.Object).toBeTrue(); + req.params.object.set('deleted', true); + await req.params.object.save(null, { useMasterKey: true }); + return 'Object deleted'; + }, + { + requireMaster: true, + } + ); + await Parse.Cloud.run('deleteAccount', { object: user.toPointer() }, { useMasterKey: true }); + }); + it('beforeSave should not affect fetched pointers', done => { Parse.Cloud.beforeSave('BeforeSaveUnchanged', () => {}); diff --git a/src/Routers/FunctionsRouter.js b/src/Routers/FunctionsRouter.js index 4972453fc3..da69d54e0c 100644 --- a/src/Routers/FunctionsRouter.js +++ b/src/Routers/FunctionsRouter.js @@ -18,6 +18,12 @@ function parseObject(obj) { return Object.assign(new Date(obj.iso), obj); } else if (obj && obj.__type == 'File') { return Parse.File.fromJSON(obj); + } else if (obj && obj.__type == 'Pointer') { + return Parse.Object.fromJSON({ + __type: 'Pointer', + className: obj.className, + objectId: obj.objectId, + }); } else if (obj && typeof obj === 'object') { return parseParams(obj); } else { From c2e4f8369be64289ccab9d5cac592165c1fe8483 Mon Sep 17 00:00:00 2001 From: Daniel Date: Fri, 26 May 2023 07:59:42 +1000 Subject: [PATCH 08/32] refactor: Upgrade lru-cache from 7.12.0 to 9.1.1 (#8559) --- package-lock.json | 16 ++++++++-------- package.json | 2 +- spec/SessionTokenCache.spec.js | 2 +- src/Adapters/Cache/LRUCache.js | 2 +- src/LiveQuery/ParseLiveQueryServer.js | 6 +++--- src/LiveQuery/SessionTokenCache.js | 2 +- 6 files changed, 15 insertions(+), 15 deletions(-) diff --git a/package-lock.json b/package-lock.json index 88bf2460ed..6af50dfddf 100644 --- a/package-lock.json +++ b/package-lock.json @@ -35,7 +35,7 @@ "jwks-rsa": "2.1.5", "ldapjs": "2.3.3", "lodash": "4.17.21", - "lru-cache": "7.12.0", + "lru-cache": "9.1.1", "mime": "3.0.0", "mongodb": "4.10.0", "mustache": "4.2.0", @@ -11056,11 +11056,11 @@ } }, "node_modules/lru-cache": { - "version": "7.12.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-7.12.0.tgz", - "integrity": "sha512-OIP3DwzRZDfLg9B9VP/huWBlpvbkmbfiBy8xmsXp4RPmE4A3MhwNozc5ZJ3fWnSg8fDcdlE/neRTPG2ycEKliw==", + "version": "9.1.1", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-9.1.1.tgz", + "integrity": "sha512-65/Jky17UwSb0BuB9V+MyDpsOtXKmYwzhyl+cOa9XUiI4uV2Ouy/2voFP3+al0BjZbJgMBD8FojMpAf+Z+qn4A==", "engines": { - "node": ">=12" + "node": "14 || >=16.14" } }, "node_modules/lru-memoizer": { @@ -29041,9 +29041,9 @@ "dev": true }, "lru-cache": { - "version": "7.12.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-7.12.0.tgz", - "integrity": "sha512-OIP3DwzRZDfLg9B9VP/huWBlpvbkmbfiBy8xmsXp4RPmE4A3MhwNozc5ZJ3fWnSg8fDcdlE/neRTPG2ycEKliw==" + "version": "9.1.1", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-9.1.1.tgz", + "integrity": "sha512-65/Jky17UwSb0BuB9V+MyDpsOtXKmYwzhyl+cOa9XUiI4uV2Ouy/2voFP3+al0BjZbJgMBD8FojMpAf+Z+qn4A==" }, "lru-memoizer": { "version": "2.1.4", diff --git a/package.json b/package.json index 717f720a74..9c1d33e67f 100644 --- a/package.json +++ b/package.json @@ -44,7 +44,7 @@ "jwks-rsa": "2.1.5", "ldapjs": "2.3.3", "lodash": "4.17.21", - "lru-cache": "7.12.0", + "lru-cache": "9.1.1", "mime": "3.0.0", "mongodb": "4.10.0", "mustache": "4.2.0", diff --git a/spec/SessionTokenCache.spec.js b/spec/SessionTokenCache.spec.js index de1b101c56..6b3c83df62 100644 --- a/spec/SessionTokenCache.spec.js +++ b/spec/SessionTokenCache.spec.js @@ -47,7 +47,7 @@ describe('SessionTokenCache', function () { sessionTokenCache.getUserId('sessionToken').then(userIdFromCache => { expect(userIdFromCache).toBe('userId'); - expect(sessionTokenCache.cache.length).toBe(1); + expect(sessionTokenCache.cache.size).toBe(1); done(); }); }); diff --git a/src/Adapters/Cache/LRUCache.js b/src/Adapters/Cache/LRUCache.js index f54d8503f9..129a006376 100644 --- a/src/Adapters/Cache/LRUCache.js +++ b/src/Adapters/Cache/LRUCache.js @@ -1,4 +1,4 @@ -import LRU from 'lru-cache'; +import { LRUCache as LRU } from 'lru-cache'; import defaults from '../../defaults'; export class LRUCache { diff --git a/src/LiveQuery/ParseLiveQueryServer.js b/src/LiveQuery/ParseLiveQueryServer.js index 0b71265f33..1105a2a6b7 100644 --- a/src/LiveQuery/ParseLiveQueryServer.js +++ b/src/LiveQuery/ParseLiveQueryServer.js @@ -19,7 +19,7 @@ import { } from '../triggers'; import { getAuthForSessionToken, Auth } from '../Auth'; import { getCacheController, getDatabaseController } from '../Controllers'; -import LRU from 'lru-cache'; +import { LRUCache as LRU } from 'lru-cache'; import UserRouter from '../Routers/UsersRouter'; import DatabaseController from '../Controllers/DatabaseController'; import { isDeepStrictEqual } from 'util'; @@ -518,7 +518,7 @@ class ParseLiveQueryServer { ]); auth1.auth?.clearRoleCache(sessionToken); auth2.auth?.clearRoleCache(sessionToken); - this.authCache.del(sessionToken); + this.authCache.delete(sessionToken); }) ); } catch (e) { @@ -548,7 +548,7 @@ class ParseLiveQueryServer { result.error = error; this.authCache.set(sessionToken, Promise.resolve(result), this.config.cacheTimeout); } else { - this.authCache.del(sessionToken); + this.authCache.delete(sessionToken); } return result; }); diff --git a/src/LiveQuery/SessionTokenCache.js b/src/LiveQuery/SessionTokenCache.js index 13b84c7367..a7f52b65a0 100644 --- a/src/LiveQuery/SessionTokenCache.js +++ b/src/LiveQuery/SessionTokenCache.js @@ -1,5 +1,5 @@ import Parse from 'parse/node'; -import LRU from 'lru-cache'; +import { LRUCache as LRU } from 'lru-cache'; import logger from '../logger'; function userForSessionToken(sessionToken) { From d7ac0cd9f8006fdb88552cb51bf9a10a5dded204 Mon Sep 17 00:00:00 2001 From: Manuel <5673677+mtrezza@users.noreply.github.com> Date: Sun, 28 May 2023 01:31:42 +0200 Subject: [PATCH 09/32] ci: Skip CI for changes in MD files (#8583) --- .github/workflows/ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 91cad880f5..756e4e2419 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -5,6 +5,8 @@ on: pull_request: branches: - '**' + paths-ignore: + - '**/**.md' env: NODE_VERSION: 19.3.0 PARSE_SERVER_TEST_TIMEOUT: 20000 From bd39ac54f45350286dc7795d3fcaa94e99996dec Mon Sep 17 00:00:00 2001 From: semantic-release-bot Date: Sat, 27 May 2023 23:32:51 +0000 Subject: [PATCH 10/32] chore(release): 6.1.0-alpha.14 [skip ci] # [6.1.0-alpha.14](https://github.com/parse-community/parse-server/compare/6.1.0-alpha.13...6.1.0-alpha.14) (2023-05-27) ### Bug Fixes * Unnecessary log entries by `extendSessionOnUse` ([#8562](https://github.com/parse-community/parse-server/issues/8562)) ([fd6a007](https://github.com/parse-community/parse-server/commit/fd6a0077f2e5cf83d65e52172ae5a950ab0f1eae)) ### Features * Allow `Parse.Object` pointers in Cloud Code arguments ([#8490](https://github.com/parse-community/parse-server/issues/8490)) ([28aeda3](https://github.com/parse-community/parse-server/commit/28aeda3f160efcbbcf85a85484a8d26567fa9761)) --- changelogs/CHANGELOG_alpha.md | 11 +++++++++++ package-lock.json | 4 ++-- package.json | 2 +- 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/changelogs/CHANGELOG_alpha.md b/changelogs/CHANGELOG_alpha.md index 9a5cae7fda..6332515081 100644 --- a/changelogs/CHANGELOG_alpha.md +++ b/changelogs/CHANGELOG_alpha.md @@ -1,3 +1,14 @@ +# [6.1.0-alpha.14](https://github.com/parse-community/parse-server/compare/6.1.0-alpha.13...6.1.0-alpha.14) (2023-05-27) + + +### Bug Fixes + +* Unnecessary log entries by `extendSessionOnUse` ([#8562](https://github.com/parse-community/parse-server/issues/8562)) ([fd6a007](https://github.com/parse-community/parse-server/commit/fd6a0077f2e5cf83d65e52172ae5a950ab0f1eae)) + +### Features + +* Allow `Parse.Object` pointers in Cloud Code arguments ([#8490](https://github.com/parse-community/parse-server/issues/8490)) ([28aeda3](https://github.com/parse-community/parse-server/commit/28aeda3f160efcbbcf85a85484a8d26567fa9761)) + # [6.1.0-alpha.13](https://github.com/parse-community/parse-server/compare/6.1.0-alpha.12...6.1.0-alpha.13) (2023-05-25) diff --git a/package-lock.json b/package-lock.json index 6af50dfddf..ca648a642b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "parse-server", - "version": "6.1.0-alpha.13", + "version": "6.1.0-alpha.14", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "parse-server", - "version": "6.1.0-alpha.13", + "version": "6.1.0-alpha.14", "hasInstallScript": true, "license": "Apache-2.0", "dependencies": { diff --git a/package.json b/package.json index 9c1d33e67f..0d9e6d5b44 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "parse-server", - "version": "6.1.0-alpha.13", + "version": "6.1.0-alpha.14", "description": "An express module providing a Parse-compatible API server", "main": "lib/index.js", "repository": { From a37d1ee24420c84470a9360fe2e1de50d0f7af15 Mon Sep 17 00:00:00 2001 From: Manuel <5673677+mtrezza@users.noreply.github.com> Date: Sun, 28 May 2023 01:44:10 +0200 Subject: [PATCH 11/32] docs: Add code ownership section to CONTRIBUTING guide (#8584) --- CONTRIBUTING.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 255364a172..a37df4037e 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -11,6 +11,7 @@ - [Review Feedback](#review-feedback) - [Merge Readiness](#merge-readiness) - [Review Validity](#review-validity) + - [Code Ownership](#code-ownership) - [Environment Setup](#environment-setup) - [Recommended Tools](#recommended-tools) - [Setting up your local machine](#setting-up-your-local-machine) @@ -34,6 +35,8 @@ - [Breaking Change](#breaking-change-1) - [Reverting](#reverting) - [Security Vulnerability](#security-vulnerability) + - [Local Testing](#local-testing) + - [Merging](#merging-1) - [Releasing](#releasing) - [General Considerations](#general-considerations) - [Major Release / Long-Term-Support](#major-release--long-term-support) @@ -143,6 +146,12 @@ It's contrary to an open, collaborative environment to expect others to be invol Your arguments must focus on the issue, not on your assumption of someone else's personal experience. We will take immediate and appropriate action in case of personal attacks, regardless of your previous contributions. Personal attacks are not permissible. If you became a victim of personal attacks, you can privately [report](https://docs.github.com/en/communities/maintaining-your-safety-on-github/reporting-abuse-or-spam) the GitHub comment to the Parse Platform PMC. +### Code Ownership + +> *Can I open a new pull request based on another author's pull request?* + +If your pull request contains work from someone else then you are required to get their permission to use their work in your pull request. Please make sure to observe the [license](LICENSE) for more details. In addition, as an appreciative gesture you should clearly mention that your pull request is based on another pull request with a link in the top-most comment of your pull request. To avoid this issue we encourage contributors to collaborate on a single pull request to preserve the commit history and clearly identify each author's contribution. To do so, you can review the other author's pull request and submit your code suggestions, or ask the original author to grant you write access to their repository to also be able to make commits directly to their pull request. + ## Environment Setup ### Recommended Tools From 5eb690c1c54a8c1697061ff0df503eaea4f8ff67 Mon Sep 17 00:00:00 2001 From: Corey Date: Sun, 28 May 2023 06:58:16 -0400 Subject: [PATCH 12/32] refactor: Incorrect spelling in hooks error message (#8585) --- spec/ParseHooks.spec.js | 2 +- src/Controllers/HooksController.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/spec/ParseHooks.spec.js b/spec/ParseHooks.spec.js index d5d980d3d0..f4bcc2e440 100644 --- a/spec/ParseHooks.spec.js +++ b/spec/ParseHooks.spec.js @@ -208,7 +208,7 @@ describe('Hooks', () => { expect(err).not.toBe(null); if (err) { expect(err.code).toBe(143); - expect(err.message).toBe('function name: my_new_function already exits'); + expect(err.message).toBe('function name: my_new_function already exists'); } return Parse.Hooks.removeFunction('my_new_function'); } diff --git a/src/Controllers/HooksController.js b/src/Controllers/HooksController.js index 9cc5f427e8..277104ef32 100644 --- a/src/Controllers/HooksController.js +++ b/src/Controllers/HooksController.js @@ -144,7 +144,7 @@ export class HooksController { if (aHook.functionName) { return this.getFunction(aHook.functionName).then(result => { if (result) { - throw new Parse.Error(143, `function name: ${aHook.functionName} already exits`); + throw new Parse.Error(143, `function name: ${aHook.functionName} already exists`); } else { return this.createOrUpdateHook(aHook); } From 0823a02fbf80bc88dc403bc47e9f5c6597ea78b4 Mon Sep 17 00:00:00 2001 From: patelmilanun <20059797+patelmilanun@users.noreply.github.com> Date: Sun, 28 May 2023 04:32:02 -0700 Subject: [PATCH 13/32] fix: Inaccurate table total row count for PostgreSQL (#8511) --- src/Adapters/Storage/Postgres/PostgresStorageAdapter.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Adapters/Storage/Postgres/PostgresStorageAdapter.js b/src/Adapters/Storage/Postgres/PostgresStorageAdapter.js index 82ac0c20dc..83dd4444e7 100644 --- a/src/Adapters/Storage/Postgres/PostgresStorageAdapter.js +++ b/src/Adapters/Storage/Postgres/PostgresStorageAdapter.js @@ -2040,7 +2040,7 @@ export class PostgresStorageAdapter implements StorageAdapter { if (where.pattern.length > 0 || !estimate) { qs = `SELECT count(*) FROM $1:name ${wherePattern}`; } else { - qs = 'SELECT reltuples AS approximate_row_count FROM pg_class WHERE relname = $1'; + qs = 'SELECT n_live_tup AS approximate_row_count FROM pg_stat_all_tables WHERE relname = $1;'; } return this._client From 6c5f89a56bf21609818b8aac7c55137101f8c62f Mon Sep 17 00:00:00 2001 From: semantic-release-bot Date: Sun, 28 May 2023 11:59:52 +0000 Subject: [PATCH 14/32] chore(release): 6.1.0-alpha.15 [skip ci] # [6.1.0-alpha.15](https://github.com/parse-community/parse-server/compare/6.1.0-alpha.14...6.1.0-alpha.15) (2023-05-28) ### Bug Fixes * Inaccurate table total row count for PostgreSQL ([#8511](https://github.com/parse-community/parse-server/issues/8511)) ([0823a02](https://github.com/parse-community/parse-server/commit/0823a02fbf80bc88dc403bc47e9f5c6597ea78b4)) --- changelogs/CHANGELOG_alpha.md | 7 +++++++ package-lock.json | 4 ++-- package.json | 2 +- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/changelogs/CHANGELOG_alpha.md b/changelogs/CHANGELOG_alpha.md index 6332515081..5ca44aa573 100644 --- a/changelogs/CHANGELOG_alpha.md +++ b/changelogs/CHANGELOG_alpha.md @@ -1,3 +1,10 @@ +# [6.1.0-alpha.15](https://github.com/parse-community/parse-server/compare/6.1.0-alpha.14...6.1.0-alpha.15) (2023-05-28) + + +### Bug Fixes + +* Inaccurate table total row count for PostgreSQL ([#8511](https://github.com/parse-community/parse-server/issues/8511)) ([0823a02](https://github.com/parse-community/parse-server/commit/0823a02fbf80bc88dc403bc47e9f5c6597ea78b4)) + # [6.1.0-alpha.14](https://github.com/parse-community/parse-server/compare/6.1.0-alpha.13...6.1.0-alpha.14) (2023-05-27) diff --git a/package-lock.json b/package-lock.json index ca648a642b..46db012795 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "parse-server", - "version": "6.1.0-alpha.14", + "version": "6.1.0-alpha.15", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "parse-server", - "version": "6.1.0-alpha.14", + "version": "6.1.0-alpha.15", "hasInstallScript": true, "license": "Apache-2.0", "dependencies": { diff --git a/package.json b/package.json index 0d9e6d5b44..c839cae1be 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "parse-server", - "version": "6.1.0-alpha.14", + "version": "6.1.0-alpha.15", "description": "An express module providing a Parse-compatible API server", "main": "lib/index.js", "repository": { From 6722110f203bc5fdcaa68cdf091cf9e7b48d1cff Mon Sep 17 00:00:00 2001 From: Manuel <5673677+mtrezza@users.noreply.github.com> Date: Sun, 28 May 2023 21:44:42 +0200 Subject: [PATCH 15/32] revert: fix: Inaccurate table total row count for PostgreSQL This reverts commit 0823a02fbf80bc88dc403bc47e9f5c6597ea78b4. --- src/Adapters/Storage/Postgres/PostgresStorageAdapter.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Adapters/Storage/Postgres/PostgresStorageAdapter.js b/src/Adapters/Storage/Postgres/PostgresStorageAdapter.js index 83dd4444e7..82ac0c20dc 100644 --- a/src/Adapters/Storage/Postgres/PostgresStorageAdapter.js +++ b/src/Adapters/Storage/Postgres/PostgresStorageAdapter.js @@ -2040,7 +2040,7 @@ export class PostgresStorageAdapter implements StorageAdapter { if (where.pattern.length > 0 || !estimate) { qs = `SELECT count(*) FROM $1:name ${wherePattern}`; } else { - qs = 'SELECT n_live_tup AS approximate_row_count FROM pg_stat_all_tables WHERE relname = $1;'; + qs = 'SELECT reltuples AS approximate_row_count FROM pg_class WHERE relname = $1'; } return this._client From fc81b411e944aef90cd2f9cb0052923983d6ac9e Mon Sep 17 00:00:00 2001 From: semantic-release-bot Date: Sun, 28 May 2023 19:46:01 +0000 Subject: [PATCH 16/32] chore(release): 6.1.0-alpha.16 [skip ci] # [6.1.0-alpha.16](https://github.com/parse-community/parse-server/compare/6.1.0-alpha.15...6.1.0-alpha.16) (2023-05-28) ### Reverts * fix: Inaccurate table total row count for PostgreSQL ([6722110](https://github.com/parse-community/parse-server/commit/6722110f203bc5fdcaa68cdf091cf9e7b48d1cff)) --- changelogs/CHANGELOG_alpha.md | 7 +++++++ package-lock.json | 4 ++-- package.json | 2 +- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/changelogs/CHANGELOG_alpha.md b/changelogs/CHANGELOG_alpha.md index 5ca44aa573..3002b21d26 100644 --- a/changelogs/CHANGELOG_alpha.md +++ b/changelogs/CHANGELOG_alpha.md @@ -1,3 +1,10 @@ +# [6.1.0-alpha.16](https://github.com/parse-community/parse-server/compare/6.1.0-alpha.15...6.1.0-alpha.16) (2023-05-28) + + +### Reverts + +* fix: Inaccurate table total row count for PostgreSQL ([6722110](https://github.com/parse-community/parse-server/commit/6722110f203bc5fdcaa68cdf091cf9e7b48d1cff)) + # [6.1.0-alpha.15](https://github.com/parse-community/parse-server/compare/6.1.0-alpha.14...6.1.0-alpha.15) (2023-05-28) diff --git a/package-lock.json b/package-lock.json index 46db012795..289dde1767 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "parse-server", - "version": "6.1.0-alpha.15", + "version": "6.1.0-alpha.16", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "parse-server", - "version": "6.1.0-alpha.15", + "version": "6.1.0-alpha.16", "hasInstallScript": true, "license": "Apache-2.0", "dependencies": { diff --git a/package.json b/package.json index c839cae1be..ad6bc5e8b9 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "parse-server", - "version": "6.1.0-alpha.15", + "version": "6.1.0-alpha.16", "description": "An express module providing a Parse-compatible API server", "main": "lib/index.js", "repository": { From 505dd6bcfe2ce787a85d380b60b0d4dc5656fea1 Mon Sep 17 00:00:00 2001 From: Daniel Date: Mon, 29 May 2023 22:11:45 +1000 Subject: [PATCH 17/32] ci: Fix flaky definitions check (#8504) --- ci/definitionsCheck.js | 19 +++---------------- 1 file changed, 3 insertions(+), 16 deletions(-) diff --git a/ci/definitionsCheck.js b/ci/definitionsCheck.js index 735d9c0b9d..e73473a984 100644 --- a/ci/definitionsCheck.js +++ b/ci/definitionsCheck.js @@ -1,27 +1,14 @@ const fs = require('fs').promises; const { exec } = require('child_process'); const core = require('@actions/core'); -const { nextTick } = require('process'); -const { AbortController } = require("node-abort-controller"); +const util = require('util'); (async () => { const [currentDefinitions, currentDocs] = await Promise.all([ fs.readFile('./src/Options/Definitions.js', 'utf8'), fs.readFile('./src/Options/docs.js', 'utf8'), ]); - exec('npm run definitions'); - const ac = new AbortController(); - const { signal } = ac; - const watcher = fs.watch('./src/Options/docs.js', {signal}); - let i = 0; - // eslint-disable-next-line - for await (const _ of watcher) { - i++; - if (i === 3) { - ac.abort(); - break; - } - } - await new Promise(resolve => nextTick(resolve)); + const execute = util.promisify(exec); + await execute('npm run definitions'); const [newDefinitions, newDocs] = await Promise.all([ fs.readFile('./src/Options/Definitions.js', 'utf8'), fs.readFile('./src/Options/docs.js', 'utf8'), From fc3b7526a6350dc0111e3016dfbc55eeb1b021f7 Mon Sep 17 00:00:00 2001 From: Corey Date: Mon, 29 May 2023 11:40:51 -0400 Subject: [PATCH 18/32] refactor: Upgrade pg-promise from 11.3.0 to 11.5.0 (#8586) --- package-lock.json | 149 +++++++++++++++++++++++++--------------------- package.json | 2 +- 2 files changed, 81 insertions(+), 70 deletions(-) diff --git a/package-lock.json b/package-lock.json index 289dde1767..6341e654a1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -16,7 +16,7 @@ "@graphql-tools/utils": "8.12.0", "@graphql-yoga/node": "2.6.0", "@parse/fs-files-adapter": "1.2.2", - "@parse/push-adapter": "^4.1.3", + "@parse/push-adapter": "4.1.3", "bcryptjs": "2.4.3", "body-parser": "1.20.1", "commander": "10.0.1", @@ -42,7 +42,7 @@ "parse": "4.0.1", "path-to-regexp": "6.2.1", "pg-monitor": "2.0.0", - "pg-promise": "11.3.0", + "pg-promise": "11.5.0", "pluralize": "8.0.0", "rate-limit-redis": "3.0.1", "redis": "4.6.6", @@ -4090,9 +4090,9 @@ } }, "node_modules/assert-options": { - "version": "0.8.0", - "resolved": "https://registry.npmjs.org/assert-options/-/assert-options-0.8.0.tgz", - "integrity": "sha512-qSELrEaEz4sGwTs4Qh+swQkjiHAysC4rot21+jzXU86dJzNG+FDqBzyS3ohSoTRf4ZLA3FSwxQdiuNl5NXUtvA==", + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/assert-options/-/assert-options-0.8.1.tgz", + "integrity": "sha512-5lNGRB5g5i2bGIzb+J1QQE1iKU/WEMVBReFIc5pPDWjcPj23otPL0eI6PB2v7QPi0qU6Mhym5D3y0ZiSIOf3GA==", "engines": { "node": ">=10.0.0" } @@ -15175,11 +15175,6 @@ "safer-buffer": "^2.0.2", "tweetnacl": "~0.14.0" }, - "bin": { - "sshpk-conv": "bin/sshpk-conv", - "sshpk-sign": "bin/sshpk-sign", - "sshpk-verify": "bin/sshpk-verify" - }, "engines": { "node": ">=0.10.0" } @@ -16245,14 +16240,14 @@ "integrity": "sha512-7EAHlyLHI56VEIdK57uwHdHKIaAGbnXPiw0yWbarQZOKaKpvUIgW0jWRVLiatnM+XXlSwsanIBH/hzGMJulMow==" }, "node_modules/pg": { - "version": "8.9.0", - "resolved": "https://registry.npmjs.org/pg/-/pg-8.9.0.tgz", - "integrity": "sha512-ZJM+qkEbtOHRuXjmvBtOgNOXOtLSbxiMiUVMgE4rV6Zwocy03RicCVvDXgx8l4Biwo8/qORUnEqn2fdQzV7KCg==", + "version": "8.11.0", + "resolved": "https://registry.npmjs.org/pg/-/pg-8.11.0.tgz", + "integrity": "sha512-meLUVPn2TWgJyLmy7el3fQQVwft4gU5NGyvV0XbD41iU9Jbg8lCH4zexhIkihDzVHJStlt6r088G6/fWeNjhXA==", "dependencies": { "buffer-writer": "2.0.0", "packet-reader": "1.0.0", - "pg-connection-string": "^2.5.0", - "pg-pool": "^3.5.2", + "pg-connection-string": "^2.6.0", + "pg-pool": "^3.6.0", "pg-protocol": "^1.6.0", "pg-types": "^2.1.0", "pgpass": "1.x" @@ -16260,6 +16255,9 @@ "engines": { "node": ">= 8.0.0" }, + "optionalDependencies": { + "pg-cloudflare": "^1.1.0" + }, "peerDependencies": { "pg-native": ">=3.0.1" }, @@ -16269,10 +16267,16 @@ } } }, + "node_modules/pg-cloudflare": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/pg-cloudflare/-/pg-cloudflare-1.1.0.tgz", + "integrity": "sha512-tGM8/s6frwuAIyRcJ6nWcIvd3+3NmUKIs6OjviIm1HPPFEt5MzQDOTBQyhPWg/m0kCl95M6gA1JaIXtS8KovOA==", + "optional": true + }, "node_modules/pg-connection-string": { - "version": "2.5.0", - "resolved": "https://registry.npmjs.org/pg-connection-string/-/pg-connection-string-2.5.0.tgz", - "integrity": "sha512-r5o/V/ORTA6TmUnyWZR9nCj1klXCO2CEKNRlVuJptZe85QuhFayC7WeMic7ndayT5IRIR0S0xFxFi2ousartlQ==" + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/pg-connection-string/-/pg-connection-string-2.6.0.tgz", + "integrity": "sha512-x14ibktcwlHKoHxx9X3uTVW9zIGR41ZB6QNhHb21OPNdCCO3NaRnpJuwKIQSR4u+Yqjx4HCvy7Hh7VSy1U4dGg==" }, "node_modules/pg-int8": { "version": "1.0.1", @@ -16283,11 +16287,11 @@ } }, "node_modules/pg-minify": { - "version": "1.6.2", - "resolved": "https://registry.npmjs.org/pg-minify/-/pg-minify-1.6.2.tgz", - "integrity": "sha512-1KdmFGGTP6jplJoI8MfvRlfvMiyBivMRP7/ffh4a11RUFJ7kC2J0ZHlipoKiH/1hz+DVgceon9U2qbaHpPeyPg==", + "version": "1.6.3", + "resolved": "https://registry.npmjs.org/pg-minify/-/pg-minify-1.6.3.tgz", + "integrity": "sha512-NoSsPqXxbkD8RIe+peQCqiea4QzXgosdTKY8p7PsbbGsh2F8TifDj/vJxfuR8qJwNYrijdSs7uf0tAe6WOyCsQ==", "engines": { - "node": ">=8.0" + "node": ">=12.0.0" } }, "node_modules/pg-monitor": { @@ -16357,22 +16361,22 @@ "integrity": "sha512-+5nt5AAniqsCnu2cEQQdpzCAh33kVx8n0VoFidKpB1dVVLAN/F+bgVOqOJqOnEnrhp222clB5p3vUlD+1QAnfg==" }, "node_modules/pg-pool": { - "version": "3.5.2", - "resolved": "https://registry.npmjs.org/pg-pool/-/pg-pool-3.5.2.tgz", - "integrity": "sha512-His3Fh17Z4eg7oANLob6ZvH8xIVen3phEZh2QuyrIl4dQSDVEabNducv6ysROKpDNPSD+12tONZVWfSgMvDD9w==", + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/pg-pool/-/pg-pool-3.6.0.tgz", + "integrity": "sha512-clFRf2ksqd+F497kWFyM21tMjeikn60oGDmqMT8UBrynEwVEX/5R5xd2sdvdo1cZCFlguORNpVuqxIj+aK4cfQ==", "peerDependencies": { "pg": ">=8.0" } }, "node_modules/pg-promise": { - "version": "11.3.0", - "resolved": "https://registry.npmjs.org/pg-promise/-/pg-promise-11.3.0.tgz", - "integrity": "sha512-A2CYmax5gsqVAO2N0ET9oPRCPX3kpKymj9qLVK7+jszlJL6l8uJDq/DGqLpxNi5VHwK7Dmm2WNRdrwkh1xuaxQ==", + "version": "11.5.0", + "resolved": "https://registry.npmjs.org/pg-promise/-/pg-promise-11.5.0.tgz", + "integrity": "sha512-ZfhntV6Yoc3S0hQWOlEodk5fEmF9ADxKl0vNvBnZgzvLt73uY29wVaNBz2AZK2J0gVmm/zhO51RXPtI4MgKkSQ==", "dependencies": { - "assert-options": "0.8.0", - "pg": "8.9.0", - "pg-minify": "1.6.2", - "spex": "3.2.0" + "assert-options": "0.8.1", + "pg": "8.11.0", + "pg-minify": "1.6.3", + "spex": "3.3.0" }, "engines": { "node": ">=14.0" @@ -16407,9 +16411,9 @@ } }, "node_modules/pgpass/node_modules/split2": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/split2/-/split2-4.1.0.tgz", - "integrity": "sha512-VBiJxFkxiXRlUIeyMQi8s4hgvKCSjtknJv/LVYbrgALPwf5zSKmEwV9Lst25AkvMDnvxODugjdl6KZgwKM1WYQ==", + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/split2/-/split2-4.2.0.tgz", + "integrity": "sha512-UcjcJOWknrNkF6PLX83qcHM6KHgVKNkV62Y8a5uYDVv9ydGQVwAHMKqHdJje1VTWpljG0WYpCDhrCdAOYH4TWg==", "engines": { "node": ">= 10.x" } @@ -18771,11 +18775,11 @@ "dev": true }, "node_modules/spex": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/spex/-/spex-3.2.0.tgz", - "integrity": "sha512-9srjJM7NaymrpwMHvSmpDeIK5GoRMX/Tq0E8aOlDPS54dDnDUIp30DrP9SphMPEETDLzEM9+4qo+KipmbtPecg==", + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/spex/-/spex-3.3.0.tgz", + "integrity": "sha512-VNiXjFp6R4ldPbVRYbpxlD35yRHceecVXlct1J4/X80KuuPnW2AXMq3sGwhnJOhKkUsOxAT6nRGfGE5pocVw5w==", "engines": { - "node": ">=4.5" + "node": ">=10.0.0" } }, "node_modules/split": { @@ -23617,9 +23621,9 @@ } }, "assert-options": { - "version": "0.8.0", - "resolved": "https://registry.npmjs.org/assert-options/-/assert-options-0.8.0.tgz", - "integrity": "sha512-qSELrEaEz4sGwTs4Qh+swQkjiHAysC4rot21+jzXU86dJzNG+FDqBzyS3ohSoTRf4ZLA3FSwxQdiuNl5NXUtvA==" + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/assert-options/-/assert-options-0.8.1.tgz", + "integrity": "sha512-5lNGRB5g5i2bGIzb+J1QQE1iKU/WEMVBReFIc5pPDWjcPj23otPL0eI6PB2v7QPi0qU6Mhym5D3y0ZiSIOf3GA==" }, "assert-plus": { "version": "1.0.0", @@ -32883,23 +32887,30 @@ "integrity": "sha512-7EAHlyLHI56VEIdK57uwHdHKIaAGbnXPiw0yWbarQZOKaKpvUIgW0jWRVLiatnM+XXlSwsanIBH/hzGMJulMow==" }, "pg": { - "version": "8.9.0", - "resolved": "https://registry.npmjs.org/pg/-/pg-8.9.0.tgz", - "integrity": "sha512-ZJM+qkEbtOHRuXjmvBtOgNOXOtLSbxiMiUVMgE4rV6Zwocy03RicCVvDXgx8l4Biwo8/qORUnEqn2fdQzV7KCg==", + "version": "8.11.0", + "resolved": "https://registry.npmjs.org/pg/-/pg-8.11.0.tgz", + "integrity": "sha512-meLUVPn2TWgJyLmy7el3fQQVwft4gU5NGyvV0XbD41iU9Jbg8lCH4zexhIkihDzVHJStlt6r088G6/fWeNjhXA==", "requires": { "buffer-writer": "2.0.0", "packet-reader": "1.0.0", - "pg-connection-string": "^2.5.0", - "pg-pool": "^3.5.2", + "pg-cloudflare": "^1.1.0", + "pg-connection-string": "^2.6.0", + "pg-pool": "^3.6.0", "pg-protocol": "^1.6.0", "pg-types": "^2.1.0", "pgpass": "1.x" } }, + "pg-cloudflare": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/pg-cloudflare/-/pg-cloudflare-1.1.0.tgz", + "integrity": "sha512-tGM8/s6frwuAIyRcJ6nWcIvd3+3NmUKIs6OjviIm1HPPFEt5MzQDOTBQyhPWg/m0kCl95M6gA1JaIXtS8KovOA==", + "optional": true + }, "pg-connection-string": { - "version": "2.5.0", - "resolved": "https://registry.npmjs.org/pg-connection-string/-/pg-connection-string-2.5.0.tgz", - "integrity": "sha512-r5o/V/ORTA6TmUnyWZR9nCj1klXCO2CEKNRlVuJptZe85QuhFayC7WeMic7ndayT5IRIR0S0xFxFi2ousartlQ==" + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/pg-connection-string/-/pg-connection-string-2.6.0.tgz", + "integrity": "sha512-x14ibktcwlHKoHxx9X3uTVW9zIGR41ZB6QNhHb21OPNdCCO3NaRnpJuwKIQSR4u+Yqjx4HCvy7Hh7VSy1U4dGg==" }, "pg-int8": { "version": "1.0.1", @@ -32907,9 +32918,9 @@ "integrity": "sha512-WCtabS6t3c8SkpDBUlb1kjOs7l66xsGdKpIPZsg4wR+B3+u9UAum2odSsF9tnvxg80h4ZxLWMy4pRjOsFIqQpw==" }, "pg-minify": { - "version": "1.6.2", - "resolved": "https://registry.npmjs.org/pg-minify/-/pg-minify-1.6.2.tgz", - "integrity": "sha512-1KdmFGGTP6jplJoI8MfvRlfvMiyBivMRP7/ffh4a11RUFJ7kC2J0ZHlipoKiH/1hz+DVgceon9U2qbaHpPeyPg==" + "version": "1.6.3", + "resolved": "https://registry.npmjs.org/pg-minify/-/pg-minify-1.6.3.tgz", + "integrity": "sha512-NoSsPqXxbkD8RIe+peQCqiea4QzXgosdTKY8p7PsbbGsh2F8TifDj/vJxfuR8qJwNYrijdSs7uf0tAe6WOyCsQ==" }, "pg-monitor": { "version": "2.0.0", @@ -32974,20 +32985,20 @@ } }, "pg-pool": { - "version": "3.5.2", - "resolved": "https://registry.npmjs.org/pg-pool/-/pg-pool-3.5.2.tgz", - "integrity": "sha512-His3Fh17Z4eg7oANLob6ZvH8xIVen3phEZh2QuyrIl4dQSDVEabNducv6ysROKpDNPSD+12tONZVWfSgMvDD9w==", + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/pg-pool/-/pg-pool-3.6.0.tgz", + "integrity": "sha512-clFRf2ksqd+F497kWFyM21tMjeikn60oGDmqMT8UBrynEwVEX/5R5xd2sdvdo1cZCFlguORNpVuqxIj+aK4cfQ==", "requires": {} }, "pg-promise": { - "version": "11.3.0", - "resolved": "https://registry.npmjs.org/pg-promise/-/pg-promise-11.3.0.tgz", - "integrity": "sha512-A2CYmax5gsqVAO2N0ET9oPRCPX3kpKymj9qLVK7+jszlJL6l8uJDq/DGqLpxNi5VHwK7Dmm2WNRdrwkh1xuaxQ==", + "version": "11.5.0", + "resolved": "https://registry.npmjs.org/pg-promise/-/pg-promise-11.5.0.tgz", + "integrity": "sha512-ZfhntV6Yoc3S0hQWOlEodk5fEmF9ADxKl0vNvBnZgzvLt73uY29wVaNBz2AZK2J0gVmm/zhO51RXPtI4MgKkSQ==", "requires": { - "assert-options": "0.8.0", - "pg": "8.9.0", - "pg-minify": "1.6.2", - "spex": "3.2.0" + "assert-options": "0.8.1", + "pg": "8.11.0", + "pg-minify": "1.6.3", + "spex": "3.3.0" } }, "pg-protocol": { @@ -33016,9 +33027,9 @@ }, "dependencies": { "split2": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/split2/-/split2-4.1.0.tgz", - "integrity": "sha512-VBiJxFkxiXRlUIeyMQi8s4hgvKCSjtknJv/LVYbrgALPwf5zSKmEwV9Lst25AkvMDnvxODugjdl6KZgwKM1WYQ==" + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/split2/-/split2-4.2.0.tgz", + "integrity": "sha512-UcjcJOWknrNkF6PLX83qcHM6KHgVKNkV62Y8a5uYDVv9ydGQVwAHMKqHdJje1VTWpljG0WYpCDhrCdAOYH4TWg==" } } }, @@ -34853,9 +34864,9 @@ "dev": true }, "spex": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/spex/-/spex-3.2.0.tgz", - "integrity": "sha512-9srjJM7NaymrpwMHvSmpDeIK5GoRMX/Tq0E8aOlDPS54dDnDUIp30DrP9SphMPEETDLzEM9+4qo+KipmbtPecg==" + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/spex/-/spex-3.3.0.tgz", + "integrity": "sha512-VNiXjFp6R4ldPbVRYbpxlD35yRHceecVXlct1J4/X80KuuPnW2AXMq3sGwhnJOhKkUsOxAT6nRGfGE5pocVw5w==" }, "split": { "version": "1.0.1", diff --git a/package.json b/package.json index ad6bc5e8b9..cd06e45523 100644 --- a/package.json +++ b/package.json @@ -51,7 +51,7 @@ "parse": "4.0.1", "path-to-regexp": "6.2.1", "pg-monitor": "2.0.0", - "pg-promise": "11.3.0", + "pg-promise": "11.5.0", "pluralize": "8.0.0", "rate-limit-redis": "3.0.1", "redis": "4.6.6", From 9f1edd09f7e1084615a72cf254633cd9ce3405cb Mon Sep 17 00:00:00 2001 From: Parse Platform <90459499+parseplatformorg@users.noreply.github.com> Date: Mon, 29 May 2023 20:20:43 +0200 Subject: [PATCH 19/32] refactor: Upgrade express-rate-limit from 6.6.0 to 6.7.0 (#8595) --- package-lock.json | 14 +++++++------- package.json | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/package-lock.json b/package-lock.json index 6341e654a1..28398b6130 100644 --- a/package-lock.json +++ b/package-lock.json @@ -23,7 +23,7 @@ "cors": "2.8.5", "deepcopy": "2.1.0", "express": "4.18.2", - "express-rate-limit": "6.6.0", + "express-rate-limit": "^6.7.0", "follow-redirects": "1.15.2", "graphql": "16.6.0", "graphql-list-fields": "2.0.2", @@ -7291,9 +7291,9 @@ } }, "node_modules/express-rate-limit": { - "version": "6.6.0", - "resolved": "https://registry.npmjs.org/express-rate-limit/-/express-rate-limit-6.6.0.tgz", - "integrity": "sha512-HFN2+4ZGdkQOS8Qli4z6knmJFnw6lZed67o6b7RGplWeb1Z0s8VXaj3dUgPIdm9hrhZXTRpCTHXA0/2Eqex0vA==", + "version": "6.7.0", + "resolved": "https://registry.npmjs.org/express-rate-limit/-/express-rate-limit-6.7.0.tgz", + "integrity": "sha512-vhwIdRoqcYB/72TK3tRZI+0ttS8Ytrk24GfmsxDXK9o9IhHNO5bXRiXQSExPQ4GbaE5tvIS7j1SGrxsuWs+sGA==", "engines": { "node": ">= 12.9.0" }, @@ -26156,9 +26156,9 @@ } }, "express-rate-limit": { - "version": "6.6.0", - "resolved": "https://registry.npmjs.org/express-rate-limit/-/express-rate-limit-6.6.0.tgz", - "integrity": "sha512-HFN2+4ZGdkQOS8Qli4z6knmJFnw6lZed67o6b7RGplWeb1Z0s8VXaj3dUgPIdm9hrhZXTRpCTHXA0/2Eqex0vA==", + "version": "6.7.0", + "resolved": "https://registry.npmjs.org/express-rate-limit/-/express-rate-limit-6.7.0.tgz", + "integrity": "sha512-vhwIdRoqcYB/72TK3tRZI+0ttS8Ytrk24GfmsxDXK9o9IhHNO5bXRiXQSExPQ4GbaE5tvIS7j1SGrxsuWs+sGA==", "requires": {} }, "ext": { diff --git a/package.json b/package.json index cd06e45523..b4f24be68a 100644 --- a/package.json +++ b/package.json @@ -32,7 +32,7 @@ "cors": "2.8.5", "deepcopy": "2.1.0", "express": "4.18.2", - "express-rate-limit": "6.6.0", + "express-rate-limit": "6.7.0", "follow-redirects": "1.15.2", "graphql": "16.6.0", "graphql-list-fields": "2.0.2", From 15704a68f101e3bfab1077b24ea7cfcc1acc4cb6 Mon Sep 17 00:00:00 2001 From: Parse Platform <90459499+parseplatformorg@users.noreply.github.com> Date: Mon, 29 May 2023 22:54:41 +0200 Subject: [PATCH 20/32] refactor: Upgrade rate-limit-redis from 3.0.1 to 3.0.2 (#8596) --- package-lock.json | 14 +++++++------- package.json | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/package-lock.json b/package-lock.json index 28398b6130..8934629a3e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -44,7 +44,7 @@ "pg-monitor": "2.0.0", "pg-promise": "11.5.0", "pluralize": "8.0.0", - "rate-limit-redis": "3.0.1", + "rate-limit-redis": "^3.0.2", "redis": "4.6.6", "semver": "7.3.8", "subscriptions-transport-ws": "0.11.0", @@ -16927,9 +16927,9 @@ } }, "node_modules/rate-limit-redis": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/rate-limit-redis/-/rate-limit-redis-3.0.1.tgz", - "integrity": "sha512-L6yhOUBrAZ8VEMX9DwlM3X6hfm8yq+gBO4LoOW7+JgmNq59zE7QmLz4v5VnwYPvLeSh/e7PDcrzUI3UumJw1iw==", + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/rate-limit-redis/-/rate-limit-redis-3.0.2.tgz", + "integrity": "sha512-4SBK6AzIr9PKkCF4HmSDcJH2O2KKMF3fZEcsbNMXyaL5I9d6X71uOreUldFRiyrRyP+qkQrTxzJ38ZKKN+sScw==", "engines": { "node": ">= 14.5.0" }, @@ -33403,9 +33403,9 @@ "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==" }, "rate-limit-redis": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/rate-limit-redis/-/rate-limit-redis-3.0.1.tgz", - "integrity": "sha512-L6yhOUBrAZ8VEMX9DwlM3X6hfm8yq+gBO4LoOW7+JgmNq59zE7QmLz4v5VnwYPvLeSh/e7PDcrzUI3UumJw1iw==", + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/rate-limit-redis/-/rate-limit-redis-3.0.2.tgz", + "integrity": "sha512-4SBK6AzIr9PKkCF4HmSDcJH2O2KKMF3fZEcsbNMXyaL5I9d6X71uOreUldFRiyrRyP+qkQrTxzJ38ZKKN+sScw==", "requires": {} }, "raw-body": { diff --git a/package.json b/package.json index b4f24be68a..684bf622fa 100644 --- a/package.json +++ b/package.json @@ -53,7 +53,7 @@ "pg-monitor": "2.0.0", "pg-promise": "11.5.0", "pluralize": "8.0.0", - "rate-limit-redis": "3.0.1", + "rate-limit-redis": "3.0.2", "redis": "4.6.6", "semver": "7.3.8", "subscriptions-transport-ws": "0.11.0", From c0d1bc4f72486d08f5ed77b8b9cea511a1f4d31e Mon Sep 17 00:00:00 2001 From: Snyk bot Date: Tue, 30 May 2023 19:00:12 +0100 Subject: [PATCH 21/32] refactor: Upgrade winston from 3.8.1 to 3.8.2 (#8598) --- package-lock.json | 20 +++++++++++--------- package.json | 2 +- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/package-lock.json b/package-lock.json index 8934629a3e..f3be934eb2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -23,7 +23,7 @@ "cors": "2.8.5", "deepcopy": "2.1.0", "express": "4.18.2", - "express-rate-limit": "^6.7.0", + "express-rate-limit": "6.7.0", "follow-redirects": "1.15.2", "graphql": "16.6.0", "graphql-list-fields": "2.0.2", @@ -44,13 +44,13 @@ "pg-monitor": "2.0.0", "pg-promise": "11.5.0", "pluralize": "8.0.0", - "rate-limit-redis": "^3.0.2", + "rate-limit-redis": "3.0.2", "redis": "4.6.6", "semver": "7.3.8", "subscriptions-transport-ws": "0.11.0", "tv4": "1.3.0", "uuid": "9.0.0", - "winston": "3.8.1", + "winston": "^3.8.2", "winston-daily-rotate-file": "4.7.1", "ws": "8.13.0" }, @@ -20307,10 +20307,11 @@ } }, "node_modules/winston": { - "version": "3.8.1", - "resolved": "https://registry.npmjs.org/winston/-/winston-3.8.1.tgz", - "integrity": "sha512-r+6YAiCR4uI3N8eQNOg8k3P3PqwAm20cLKlzVD9E66Ch39+LZC+VH1UKf9JemQj2B3QoUHfKD7Poewn0Pr3Y1w==", + "version": "3.8.2", + "resolved": "https://registry.npmjs.org/winston/-/winston-3.8.2.tgz", + "integrity": "sha512-MsE1gRx1m5jdTTO9Ld/vND4krP2To+lgDoMEHGGa4HIlAUyXJtfc7CxQcGXVyz2IBpw5hbFkj2b/AtUdQwyRew==", "dependencies": { + "@colors/colors": "1.5.0", "@dabh/diagnostics": "^2.0.2", "async": "^3.2.3", "is-stream": "^2.0.0", @@ -36045,10 +36046,11 @@ } }, "winston": { - "version": "3.8.1", - "resolved": "https://registry.npmjs.org/winston/-/winston-3.8.1.tgz", - "integrity": "sha512-r+6YAiCR4uI3N8eQNOg8k3P3PqwAm20cLKlzVD9E66Ch39+LZC+VH1UKf9JemQj2B3QoUHfKD7Poewn0Pr3Y1w==", + "version": "3.8.2", + "resolved": "https://registry.npmjs.org/winston/-/winston-3.8.2.tgz", + "integrity": "sha512-MsE1gRx1m5jdTTO9Ld/vND4krP2To+lgDoMEHGGa4HIlAUyXJtfc7CxQcGXVyz2IBpw5hbFkj2b/AtUdQwyRew==", "requires": { + "@colors/colors": "1.5.0", "@dabh/diagnostics": "^2.0.2", "async": "^3.2.3", "is-stream": "^2.0.0", diff --git a/package.json b/package.json index 684bf622fa..4ea51de157 100644 --- a/package.json +++ b/package.json @@ -59,7 +59,7 @@ "subscriptions-transport-ws": "0.11.0", "tv4": "1.3.0", "uuid": "9.0.0", - "winston": "3.8.1", + "winston": "3.8.2", "winston-daily-rotate-file": "4.7.1", "ws": "8.13.0" }, From 5ab370d58e4f9fca8b4b0c18afdd6549d906bc2f Mon Sep 17 00:00:00 2001 From: Parse Platform <90459499+parseplatformorg@users.noreply.github.com> Date: Wed, 31 May 2023 11:09:10 +0200 Subject: [PATCH 22/32] refactor: Upgrade @babel/eslint-parser from 7.19.1 to 7.21.8 (#8591) --- package-lock.json | 14 +++++++------- package.json | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/package-lock.json b/package-lock.json index f3be934eb2..cdcc09a0a0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,7 +10,7 @@ "hasInstallScript": true, "license": "Apache-2.0", "dependencies": { - "@babel/eslint-parser": "7.19.1", + "@babel/eslint-parser": "^7.21.8", "@graphql-tools/merge": "8.4.1", "@graphql-tools/schema": "9.0.4", "@graphql-tools/utils": "8.12.0", @@ -299,9 +299,9 @@ } }, "node_modules/@babel/eslint-parser": { - "version": "7.19.1", - "resolved": "https://registry.npmjs.org/@babel/eslint-parser/-/eslint-parser-7.19.1.tgz", - "integrity": "sha512-AqNf2QWt1rtu2/1rLswy6CDP7H9Oh3mMhk177Y67Rg8d7RD9WfOLLv8CGn6tisFvS2htm86yIe1yLF6I1UDaGQ==", + "version": "7.21.8", + "resolved": "https://registry.npmjs.org/@babel/eslint-parser/-/eslint-parser-7.21.8.tgz", + "integrity": "sha512-HLhI+2q+BP3sf78mFUZNCGc10KEmoUqtUT1OCdMZsN+qr4qFeLUod62/zAnF3jNQstwyasDkZnVXwfK2Bml7MQ==", "dependencies": { "@nicolo-ribaudo/eslint-scope-5-internals": "5.1.1-v1", "eslint-visitor-keys": "^2.1.0", @@ -20801,9 +20801,9 @@ } }, "@babel/eslint-parser": { - "version": "7.19.1", - "resolved": "https://registry.npmjs.org/@babel/eslint-parser/-/eslint-parser-7.19.1.tgz", - "integrity": "sha512-AqNf2QWt1rtu2/1rLswy6CDP7H9Oh3mMhk177Y67Rg8d7RD9WfOLLv8CGn6tisFvS2htm86yIe1yLF6I1UDaGQ==", + "version": "7.21.8", + "resolved": "https://registry.npmjs.org/@babel/eslint-parser/-/eslint-parser-7.21.8.tgz", + "integrity": "sha512-HLhI+2q+BP3sf78mFUZNCGc10KEmoUqtUT1OCdMZsN+qr4qFeLUod62/zAnF3jNQstwyasDkZnVXwfK2Bml7MQ==", "requires": { "@nicolo-ribaudo/eslint-scope-5-internals": "5.1.1-v1", "eslint-visitor-keys": "^2.1.0", diff --git a/package.json b/package.json index 4ea51de157..b10e9a8bb0 100644 --- a/package.json +++ b/package.json @@ -19,7 +19,7 @@ ], "license": "Apache-2.0", "dependencies": { - "@babel/eslint-parser": "7.19.1", + "@babel/eslint-parser": "7.21.8", "@graphql-tools/merge": "8.4.1", "@graphql-tools/schema": "9.0.4", "@graphql-tools/utils": "8.12.0", From bf2a224e46612d2edd9ac8605f2e0212b4b6d60c Mon Sep 17 00:00:00 2001 From: Parse Platform <90459499+parseplatformorg@users.noreply.github.com> Date: Wed, 31 May 2023 22:09:48 +0200 Subject: [PATCH 23/32] refactor: Upgrade body-parser from 1.20.1 to 1.20.2 (#8594) --- package-lock.json | 113 ++++++++++++++++++++++++++++++++++++---------- package.json | 2 +- 2 files changed, 91 insertions(+), 24 deletions(-) diff --git a/package-lock.json b/package-lock.json index cdcc09a0a0..269c3ccadb 100644 --- a/package-lock.json +++ b/package-lock.json @@ -18,7 +18,7 @@ "@parse/fs-files-adapter": "1.2.2", "@parse/push-adapter": "4.1.3", "bcryptjs": "2.4.3", - "body-parser": "1.20.1", + "body-parser": "^1.20.2", "commander": "10.0.1", "cors": "2.8.5", "deepcopy": "2.1.0", @@ -4386,12 +4386,12 @@ "dev": true }, "node_modules/body-parser": { - "version": "1.20.1", - "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.1.tgz", - "integrity": "sha512-jWi7abTbYwajOytWCQc37VulmWiRae5RyTpaCyDcS5/lMdtwSz5lOpDE67srw/HYe35f1z3fDQw+3txg7gNtWw==", + "version": "1.20.2", + "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.2.tgz", + "integrity": "sha512-ml9pReCu3M61kGlqoTm2umSXTlRTuGTx0bfYj+uIUKKYycG5NtSbeetV3faSU6R7ajOPw0g/J1PvK4qNy7s5bA==", "dependencies": { "bytes": "3.1.2", - "content-type": "~1.0.4", + "content-type": "~1.0.5", "debug": "2.6.9", "depd": "2.0.0", "destroy": "1.2.0", @@ -4399,7 +4399,7 @@ "iconv-lite": "0.4.24", "on-finished": "2.4.1", "qs": "6.11.0", - "raw-body": "2.5.1", + "raw-body": "2.5.2", "type-is": "~1.6.18", "unpipe": "1.0.0" }, @@ -5270,9 +5270,9 @@ } }, "node_modules/content-type": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.4.tgz", - "integrity": "sha512-hIP3EEPs8tB9AT1L+NUqtwOAps4mk2Zob89MWXMHjHWg9milF/j4osnnQLXBCBFBk/tvIG/tUc9mOUJiPBhPXA==", + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.5.tgz", + "integrity": "sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA==", "engines": { "node": ">= 0.6" } @@ -7301,6 +7301,29 @@ "express": "^4 || ^5" } }, + "node_modules/express/node_modules/body-parser": { + "version": "1.20.1", + "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.1.tgz", + "integrity": "sha512-jWi7abTbYwajOytWCQc37VulmWiRae5RyTpaCyDcS5/lMdtwSz5lOpDE67srw/HYe35f1z3fDQw+3txg7gNtWw==", + "dependencies": { + "bytes": "3.1.2", + "content-type": "~1.0.4", + "debug": "2.6.9", + "depd": "2.0.0", + "destroy": "1.2.0", + "http-errors": "2.0.0", + "iconv-lite": "0.4.24", + "on-finished": "2.4.1", + "qs": "6.11.0", + "raw-body": "2.5.1", + "type-is": "~1.6.18", + "unpipe": "1.0.0" + }, + "engines": { + "node": ">= 0.8", + "npm": "1.2.8000 || >= 1.4.16" + } + }, "node_modules/express/node_modules/debug": { "version": "2.6.9", "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", @@ -7319,6 +7342,20 @@ "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz", "integrity": "sha512-5DFkuoqlv1uYQKxy8omFBeJPQcdoE07Kv2sferDCrAq1ohOU+MSDswDIbnx3YAM60qIOnYa53wBhXW0EbMonrQ==" }, + "node_modules/express/node_modules/raw-body": { + "version": "2.5.1", + "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.5.1.tgz", + "integrity": "sha512-qqJBtEyVgS0ZmPGdCFPWJ3FreoqvG4MVQln/kCgF7Olq95IbOp0/BWyMwbdtn4VTvkM8Y7khCQ2Xgk/tcrCXig==", + "dependencies": { + "bytes": "3.1.2", + "http-errors": "2.0.0", + "iconv-lite": "0.4.24", + "unpipe": "1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, "node_modules/ext": { "version": "1.7.0", "resolved": "https://registry.npmjs.org/ext/-/ext-1.7.0.tgz", @@ -16938,9 +16975,9 @@ } }, "node_modules/raw-body": { - "version": "2.5.1", - "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.5.1.tgz", - "integrity": "sha512-qqJBtEyVgS0ZmPGdCFPWJ3FreoqvG4MVQln/kCgF7Olq95IbOp0/BWyMwbdtn4VTvkM8Y7khCQ2Xgk/tcrCXig==", + "version": "2.5.2", + "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.5.2.tgz", + "integrity": "sha512-8zGqypfENjCIqGhgXToC8aB2r7YrBX+AQAfIPs/Mlk+BtPTztOvTS01NRW/3Eh60J+a48lt8qsCzirQ6loCVfA==", "dependencies": { "bytes": "3.1.2", "http-errors": "2.0.0", @@ -23853,12 +23890,12 @@ "dev": true }, "body-parser": { - "version": "1.20.1", - "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.1.tgz", - "integrity": "sha512-jWi7abTbYwajOytWCQc37VulmWiRae5RyTpaCyDcS5/lMdtwSz5lOpDE67srw/HYe35f1z3fDQw+3txg7gNtWw==", + "version": "1.20.2", + "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.2.tgz", + "integrity": "sha512-ml9pReCu3M61kGlqoTm2umSXTlRTuGTx0bfYj+uIUKKYycG5NtSbeetV3faSU6R7ajOPw0g/J1PvK4qNy7s5bA==", "requires": { "bytes": "3.1.2", - "content-type": "~1.0.4", + "content-type": "~1.0.5", "debug": "2.6.9", "depd": "2.0.0", "destroy": "1.2.0", @@ -23866,7 +23903,7 @@ "iconv-lite": "0.4.24", "on-finished": "2.4.1", "qs": "6.11.0", - "raw-body": "2.5.1", + "raw-body": "2.5.2", "type-is": "~1.6.18", "unpipe": "1.0.0" }, @@ -24544,9 +24581,9 @@ } }, "content-type": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.4.tgz", - "integrity": "sha512-hIP3EEPs8tB9AT1L+NUqtwOAps4mk2Zob89MWXMHjHWg9milF/j4osnnQLXBCBFBk/tvIG/tUc9mOUJiPBhPXA==" + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.5.tgz", + "integrity": "sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA==" }, "conventional-changelog-angular": { "version": "5.0.13", @@ -26136,6 +26173,25 @@ "vary": "~1.1.2" }, "dependencies": { + "body-parser": { + "version": "1.20.1", + "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.1.tgz", + "integrity": "sha512-jWi7abTbYwajOytWCQc37VulmWiRae5RyTpaCyDcS5/lMdtwSz5lOpDE67srw/HYe35f1z3fDQw+3txg7gNtWw==", + "requires": { + "bytes": "3.1.2", + "content-type": "~1.0.4", + "debug": "2.6.9", + "depd": "2.0.0", + "destroy": "1.2.0", + "http-errors": "2.0.0", + "iconv-lite": "0.4.24", + "on-finished": "2.4.1", + "qs": "6.11.0", + "raw-body": "2.5.1", + "type-is": "~1.6.18", + "unpipe": "1.0.0" + } + }, "debug": { "version": "2.6.9", "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", @@ -26153,6 +26209,17 @@ "version": "0.1.7", "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz", "integrity": "sha512-5DFkuoqlv1uYQKxy8omFBeJPQcdoE07Kv2sferDCrAq1ohOU+MSDswDIbnx3YAM60qIOnYa53wBhXW0EbMonrQ==" + }, + "raw-body": { + "version": "2.5.1", + "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.5.1.tgz", + "integrity": "sha512-qqJBtEyVgS0ZmPGdCFPWJ3FreoqvG4MVQln/kCgF7Olq95IbOp0/BWyMwbdtn4VTvkM8Y7khCQ2Xgk/tcrCXig==", + "requires": { + "bytes": "3.1.2", + "http-errors": "2.0.0", + "iconv-lite": "0.4.24", + "unpipe": "1.0.0" + } } } }, @@ -33410,9 +33477,9 @@ "requires": {} }, "raw-body": { - "version": "2.5.1", - "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.5.1.tgz", - "integrity": "sha512-qqJBtEyVgS0ZmPGdCFPWJ3FreoqvG4MVQln/kCgF7Olq95IbOp0/BWyMwbdtn4VTvkM8Y7khCQ2Xgk/tcrCXig==", + "version": "2.5.2", + "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.5.2.tgz", + "integrity": "sha512-8zGqypfENjCIqGhgXToC8aB2r7YrBX+AQAfIPs/Mlk+BtPTztOvTS01NRW/3Eh60J+a48lt8qsCzirQ6loCVfA==", "requires": { "bytes": "3.1.2", "http-errors": "2.0.0", diff --git a/package.json b/package.json index b10e9a8bb0..f288bd6a79 100644 --- a/package.json +++ b/package.json @@ -27,7 +27,7 @@ "@parse/fs-files-adapter": "1.2.2", "@parse/push-adapter": "4.1.3", "bcryptjs": "2.4.3", - "body-parser": "1.20.1", + "body-parser": "1.20.2", "commander": "10.0.1", "cors": "2.8.5", "deepcopy": "2.1.0", From 3ec453d88548f03bdd31f9c5fecbaf3bfb6ac298 Mon Sep 17 00:00:00 2001 From: Parse Platform <90459499+parseplatformorg@users.noreply.github.com> Date: Thu, 1 Jun 2023 16:09:24 +0200 Subject: [PATCH 24/32] refactor: Upgrade semver from 7.3.8 to 7.5.0 (#8593) --- package-lock.json | 14 +++++++------- package.json | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/package-lock.json b/package-lock.json index 269c3ccadb..d7f2fab021 100644 --- a/package-lock.json +++ b/package-lock.json @@ -46,7 +46,7 @@ "pluralize": "8.0.0", "rate-limit-redis": "3.0.2", "redis": "4.6.6", - "semver": "7.3.8", + "semver": "^7.5.0", "subscriptions-transport-ws": "0.11.0", "tv4": "1.3.0", "uuid": "9.0.0", @@ -18182,9 +18182,9 @@ } }, "node_modules/semver": { - "version": "7.3.8", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.8.tgz", - "integrity": "sha512-NB1ctGL5rlHrPJtFDVIVzTyQylMLu9N9VICA6HSFJo8MCGVTMW6gfpicwKmmK/dAjTOrqu5l63JJOpDSrAis3A==", + "version": "7.5.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.0.tgz", + "integrity": "sha512-+XC0AD/R7Q2mPSRuy2Id0+CGTZ98+8f+KvwirxOKIEyid+XSx6HbC63p+O4IndTHuX5Z+JxQ0TghCkO5Cg/2HA==", "dependencies": { "lru-cache": "^6.0.0" }, @@ -34415,9 +34415,9 @@ } }, "semver": { - "version": "7.3.8", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.8.tgz", - "integrity": "sha512-NB1ctGL5rlHrPJtFDVIVzTyQylMLu9N9VICA6HSFJo8MCGVTMW6gfpicwKmmK/dAjTOrqu5l63JJOpDSrAis3A==", + "version": "7.5.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.0.tgz", + "integrity": "sha512-+XC0AD/R7Q2mPSRuy2Id0+CGTZ98+8f+KvwirxOKIEyid+XSx6HbC63p+O4IndTHuX5Z+JxQ0TghCkO5Cg/2HA==", "requires": { "lru-cache": "^6.0.0" }, diff --git a/package.json b/package.json index f288bd6a79..5442642d4c 100644 --- a/package.json +++ b/package.json @@ -55,7 +55,7 @@ "pluralize": "8.0.0", "rate-limit-redis": "3.0.2", "redis": "4.6.6", - "semver": "7.3.8", + "semver": "7.5.0", "subscriptions-transport-ws": "0.11.0", "tv4": "1.3.0", "uuid": "9.0.0", From 8c9a56e8eaeadd39425491a6335a33a74b4c23ed Mon Sep 17 00:00:00 2001 From: Parse Platform <90459499+parseplatformorg@users.noreply.github.com> Date: Sat, 3 Jun 2023 14:16:14 +0200 Subject: [PATCH 25/32] refactor: Upgrade parse from 4.0.1 to 4.1.0 (#8604) --- package-lock.json | 104 ++++++++++++++++++++-------------------------- package.json | 2 +- 2 files changed, 46 insertions(+), 60 deletions(-) diff --git a/package-lock.json b/package-lock.json index d7f2fab021..90f9c1a71f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,7 +10,7 @@ "hasInstallScript": true, "license": "Apache-2.0", "dependencies": { - "@babel/eslint-parser": "^7.21.8", + "@babel/eslint-parser": "7.21.8", "@graphql-tools/merge": "8.4.1", "@graphql-tools/schema": "9.0.4", "@graphql-tools/utils": "8.12.0", @@ -18,7 +18,7 @@ "@parse/fs-files-adapter": "1.2.2", "@parse/push-adapter": "4.1.3", "bcryptjs": "2.4.3", - "body-parser": "^1.20.2", + "body-parser": "1.20.2", "commander": "10.0.1", "cors": "2.8.5", "deepcopy": "2.1.0", @@ -39,18 +39,18 @@ "mime": "3.0.0", "mongodb": "4.10.0", "mustache": "4.2.0", - "parse": "4.0.1", + "parse": "^4.1.0", "path-to-regexp": "6.2.1", "pg-monitor": "2.0.0", "pg-promise": "11.5.0", "pluralize": "8.0.0", "rate-limit-redis": "3.0.2", "redis": "4.6.6", - "semver": "^7.5.0", + "semver": "7.5.0", "subscriptions-transport-ws": "0.11.0", "tv4": "1.3.0", "uuid": "9.0.0", - "winston": "^3.8.2", + "winston": "3.8.2", "winston-daily-rotate-file": "4.7.1", "ws": "8.13.0" }, @@ -1775,6 +1775,7 @@ "version": "7.18.0", "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.18.0.tgz", "integrity": "sha512-YMQvx/6nKEaucl0MY56mwIG483xk8SDNdlUwb2Ts6FUpr7fm85DxEmsY18LXBNhcTz6tO6JwZV8w1W06v8UKeg==", + "dev": true, "dependencies": { "regenerator-runtime": "^0.13.4" }, @@ -1783,12 +1784,12 @@ } }, "node_modules/@babel/runtime-corejs3": { - "version": "7.17.8", - "resolved": "https://registry.npmjs.org/@babel/runtime-corejs3/-/runtime-corejs3-7.17.8.tgz", - "integrity": "sha512-ZbYSUvoSF6dXZmMl/CYTMOvzIFnbGfv4W3SEHYgMvNsFTeLaF2gkGAF4K2ddmtSK4Emej+0aYcnSC6N5dPCXUQ==", + "version": "7.21.0", + "resolved": "https://registry.npmjs.org/@babel/runtime-corejs3/-/runtime-corejs3-7.21.0.tgz", + "integrity": "sha512-TDD4UJzos3JJtM+tHX+w2Uc+KWj7GV+VKKFdMVd2Rx8sdA19hcc3P3AHFYd5LVOw+pYuSd5lICC3gm52B6Rwxw==", "dependencies": { - "core-js-pure": "^3.20.2", - "regenerator-runtime": "^0.13.4" + "core-js-pure": "^3.25.1", + "regenerator-runtime": "^0.13.11" }, "engines": { "node": ">=6.9.0" @@ -9182,9 +9183,9 @@ } }, "node_modules/idb-keyval": { - "version": "6.0.3", - "resolved": "https://registry.npmjs.org/idb-keyval/-/idb-keyval-6.0.3.tgz", - "integrity": "sha512-yh8V7CnE6EQMu9YDwQXhRxwZh4nv+8xm/HV4ZqK4IiYFJBWYGjJuykADJbSP+F/GDXUBwCSSNn/14IpGL81TuA==", + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/idb-keyval/-/idb-keyval-6.2.0.tgz", + "integrity": "sha512-uw+MIyQn2jl3+hroD7hF8J7PUviBU7BPKWw4f/ISf32D4LoGu98yHjrzWWJDASu9QNrX10tCJqk9YY0ClWm8Ng==", "dependencies": { "safari-14-idb-fix": "^3.0.0" } @@ -16121,20 +16122,19 @@ } }, "node_modules/parse": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/parse/-/parse-4.0.1.tgz", - "integrity": "sha512-ctv7zaVKlQIBSbarorB7TH3yacDzCvgWBP4ccpLKxlpe21QlaY88kv9V7ca7JdG/Txb3qWug4MwepQoPogXB6Q==", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/parse/-/parse-4.1.0.tgz", + "integrity": "sha512-s0Ti+nWrKWj9DlFcmkEE05fGwa/K5ycZSdqCz01F8YL7Hevqv4WLXAmYGOwzq5UJSZ005seKgb20KwVwLdy/Zg==", "dependencies": { - "@babel/runtime": "7.18.0", - "@babel/runtime-corejs3": "7.17.8", - "idb-keyval": "6.0.3", + "@babel/runtime-corejs3": "7.21.0", + "idb-keyval": "6.2.0", "react-native-crypto-js": "1.0.0", - "uuid": "3.4.0", - "ws": "8.6.0", + "uuid": "9.0.0", + "ws": "8.12.0", "xmlhttprequest": "1.8.0" }, "engines": { - "node": ">=14.21.0 <17 || >=18 <19" + "node": ">=14.21.0 <17 || >=18 <20" }, "optionalDependencies": { "crypto-js": "4.1.1" @@ -16167,25 +16167,16 @@ "node": ">=6" } }, - "node_modules/parse/node_modules/uuid": { - "version": "3.4.0", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz", - "integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==", - "deprecated": "Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.", - "bin": { - "uuid": "bin/uuid" - } - }, "node_modules/parse/node_modules/ws": { - "version": "8.6.0", - "resolved": "https://registry.npmjs.org/ws/-/ws-8.6.0.tgz", - "integrity": "sha512-AzmM3aH3gk0aX7/rZLYvjdvZooofDu3fFOzGqcSnQ1tOcTWwhM/o+q++E8mAyVVIyUdajrkzWUGftaVSDLn1bw==", + "version": "8.12.0", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.12.0.tgz", + "integrity": "sha512-kU62emKIdKVeEIOIKVegvqpXMSTAMLJozpHZaJNDYqBjzlSYXQGviYwN1osDLJ9av68qHd4a2oSjd7yD4pacig==", "engines": { "node": ">=10.0.0" }, "peerDependencies": { "bufferutil": "^4.0.1", - "utf-8-validate": "^5.0.2" + "utf-8-validate": ">=5.0.2" }, "peerDependenciesMeta": { "bufferutil": { @@ -21873,17 +21864,18 @@ "version": "7.18.0", "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.18.0.tgz", "integrity": "sha512-YMQvx/6nKEaucl0MY56mwIG483xk8SDNdlUwb2Ts6FUpr7fm85DxEmsY18LXBNhcTz6tO6JwZV8w1W06v8UKeg==", + "dev": true, "requires": { "regenerator-runtime": "^0.13.4" } }, "@babel/runtime-corejs3": { - "version": "7.17.8", - "resolved": "https://registry.npmjs.org/@babel/runtime-corejs3/-/runtime-corejs3-7.17.8.tgz", - "integrity": "sha512-ZbYSUvoSF6dXZmMl/CYTMOvzIFnbGfv4W3SEHYgMvNsFTeLaF2gkGAF4K2ddmtSK4Emej+0aYcnSC6N5dPCXUQ==", + "version": "7.21.0", + "resolved": "https://registry.npmjs.org/@babel/runtime-corejs3/-/runtime-corejs3-7.21.0.tgz", + "integrity": "sha512-TDD4UJzos3JJtM+tHX+w2Uc+KWj7GV+VKKFdMVd2Rx8sdA19hcc3P3AHFYd5LVOw+pYuSd5lICC3gm52B6Rwxw==", "requires": { - "core-js-pure": "^3.20.2", - "regenerator-runtime": "^0.13.4" + "core-js-pure": "^3.25.1", + "regenerator-runtime": "^0.13.11" } }, "@babel/template": { @@ -27606,9 +27598,9 @@ } }, "idb-keyval": { - "version": "6.0.3", - "resolved": "https://registry.npmjs.org/idb-keyval/-/idb-keyval-6.0.3.tgz", - "integrity": "sha512-yh8V7CnE6EQMu9YDwQXhRxwZh4nv+8xm/HV4ZqK4IiYFJBWYGjJuykADJbSP+F/GDXUBwCSSNn/14IpGL81TuA==", + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/idb-keyval/-/idb-keyval-6.2.0.tgz", + "integrity": "sha512-uw+MIyQn2jl3+hroD7hF8J7PUviBU7BPKWw4f/ISf32D4LoGu98yHjrzWWJDASu9QNrX10tCJqk9YY0ClWm8Ng==", "requires": { "safari-14-idb-fix": "^3.0.0" } @@ -32847,29 +32839,23 @@ } }, "parse": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/parse/-/parse-4.0.1.tgz", - "integrity": "sha512-ctv7zaVKlQIBSbarorB7TH3yacDzCvgWBP4ccpLKxlpe21QlaY88kv9V7ca7JdG/Txb3qWug4MwepQoPogXB6Q==", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/parse/-/parse-4.1.0.tgz", + "integrity": "sha512-s0Ti+nWrKWj9DlFcmkEE05fGwa/K5ycZSdqCz01F8YL7Hevqv4WLXAmYGOwzq5UJSZ005seKgb20KwVwLdy/Zg==", "requires": { - "@babel/runtime": "7.18.0", - "@babel/runtime-corejs3": "7.17.8", + "@babel/runtime-corejs3": "7.21.0", "crypto-js": "4.1.1", - "idb-keyval": "6.0.3", + "idb-keyval": "6.2.0", "react-native-crypto-js": "1.0.0", - "uuid": "3.4.0", - "ws": "8.6.0", + "uuid": "9.0.0", + "ws": "8.12.0", "xmlhttprequest": "1.8.0" }, "dependencies": { - "uuid": { - "version": "3.4.0", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz", - "integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==" - }, "ws": { - "version": "8.6.0", - "resolved": "https://registry.npmjs.org/ws/-/ws-8.6.0.tgz", - "integrity": "sha512-AzmM3aH3gk0aX7/rZLYvjdvZooofDu3fFOzGqcSnQ1tOcTWwhM/o+q++E8mAyVVIyUdajrkzWUGftaVSDLn1bw==", + "version": "8.12.0", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.12.0.tgz", + "integrity": "sha512-kU62emKIdKVeEIOIKVegvqpXMSTAMLJozpHZaJNDYqBjzlSYXQGviYwN1osDLJ9av68qHd4a2oSjd7yD4pacig==", "requires": {} } } diff --git a/package.json b/package.json index 5442642d4c..369978721b 100644 --- a/package.json +++ b/package.json @@ -48,7 +48,7 @@ "mime": "3.0.0", "mongodb": "4.10.0", "mustache": "4.2.0", - "parse": "4.0.1", + "parse": "4.1.0", "path-to-regexp": "6.2.1", "pg-monitor": "2.0.0", "pg-promise": "11.5.0", From 0ce36927598ac35ca72c447aa724d6f66222b793 Mon Sep 17 00:00:00 2001 From: Snyk bot Date: Mon, 5 Jun 2023 09:03:46 +0100 Subject: [PATCH 26/32] refactor: Upgrade semver from 7.5.0 to 7.5.1 (#8612) --- package-lock.json | 16 ++++++++-------- package.json | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/package-lock.json b/package-lock.json index 90f9c1a71f..5ddc19b436 100644 --- a/package-lock.json +++ b/package-lock.json @@ -39,14 +39,14 @@ "mime": "3.0.0", "mongodb": "4.10.0", "mustache": "4.2.0", - "parse": "^4.1.0", + "parse": "4.1.0", "path-to-regexp": "6.2.1", "pg-monitor": "2.0.0", "pg-promise": "11.5.0", "pluralize": "8.0.0", "rate-limit-redis": "3.0.2", "redis": "4.6.6", - "semver": "7.5.0", + "semver": "^7.5.1", "subscriptions-transport-ws": "0.11.0", "tv4": "1.3.0", "uuid": "9.0.0", @@ -18173,9 +18173,9 @@ } }, "node_modules/semver": { - "version": "7.5.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.0.tgz", - "integrity": "sha512-+XC0AD/R7Q2mPSRuy2Id0+CGTZ98+8f+KvwirxOKIEyid+XSx6HbC63p+O4IndTHuX5Z+JxQ0TghCkO5Cg/2HA==", + "version": "7.5.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.1.tgz", + "integrity": "sha512-Wvss5ivl8TMRZXXESstBA4uR5iXgEN/VC5/sOcuXdVLzcdkz4HWetIoRfG5gb5X+ij/G9rw9YoGn3QoQ8OCSpw==", "dependencies": { "lru-cache": "^6.0.0" }, @@ -34401,9 +34401,9 @@ } }, "semver": { - "version": "7.5.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.0.tgz", - "integrity": "sha512-+XC0AD/R7Q2mPSRuy2Id0+CGTZ98+8f+KvwirxOKIEyid+XSx6HbC63p+O4IndTHuX5Z+JxQ0TghCkO5Cg/2HA==", + "version": "7.5.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.1.tgz", + "integrity": "sha512-Wvss5ivl8TMRZXXESstBA4uR5iXgEN/VC5/sOcuXdVLzcdkz4HWetIoRfG5gb5X+ij/G9rw9YoGn3QoQ8OCSpw==", "requires": { "lru-cache": "^6.0.0" }, diff --git a/package.json b/package.json index 369978721b..5d30586d4a 100644 --- a/package.json +++ b/package.json @@ -55,7 +55,7 @@ "pluralize": "8.0.0", "rate-limit-redis": "3.0.2", "redis": "4.6.6", - "semver": "7.5.0", + "semver": "7.5.1", "subscriptions-transport-ws": "0.11.0", "tv4": "1.3.0", "uuid": "9.0.0", From 82da30842a55980aa90cb7680fbf6db37ee16dab Mon Sep 17 00:00:00 2001 From: Daniel Date: Thu, 8 Jun 2023 05:51:53 +1000 Subject: [PATCH 27/32] feat: Add new Parse Server option `preventSignupWithUnverifiedEmail` to prevent returning a user without session token on sign-up with unverified email address (#8451) --- spec/ValidationAndPasswordsReset.spec.js | 101 ++++++++++++----------- spec/VerifyUserPassword.spec.js | 40 ++++----- src/Options/Definitions.js | 7 ++ src/Options/docs.js | 1 + src/Options/index.js | 7 ++ src/RestWrite.js | 6 +- 6 files changed, 88 insertions(+), 74 deletions(-) diff --git a/spec/ValidationAndPasswordsReset.spec.js b/spec/ValidationAndPasswordsReset.spec.js index 3272f07fc3..ab944e14c1 100644 --- a/spec/ValidationAndPasswordsReset.spec.js +++ b/spec/ValidationAndPasswordsReset.spec.js @@ -242,8 +242,7 @@ describe('Custom Pages, Email Verification, Password Reset', () => { }); }); - it('allows user to login only after user clicks on the link to confirm email address if preventLoginWithUnverifiedEmail is set to true', done => { - const user = new Parse.User(); + it('allows user to login only after user clicks on the link to confirm email address if preventLoginWithUnverifiedEmail is set to true', async () => { let sendEmailOptions; const emailAdapter = { sendVerificationEmail: options => { @@ -252,59 +251,32 @@ describe('Custom Pages, Email Verification, Password Reset', () => { sendPasswordResetEmail: () => Promise.resolve(), sendMail: () => {}, }; - reconfigureServer({ + await reconfigureServer({ appName: 'emailing app', verifyUserEmails: true, preventLoginWithUnverifiedEmail: true, emailAdapter: emailAdapter, publicServerURL: 'http://localhost:8378/1', - }) - .then(() => { - user.setPassword('other-password'); - user.setUsername('user'); - user.set('email', 'user@parse.com'); - return user.signUp(); - }) - .then(() => { - expect(sendEmailOptions).not.toBeUndefined(); - request({ - url: sendEmailOptions.link, - followRedirects: false, - }).then(response => { - expect(response.status).toEqual(302); - expect(response.text).toEqual( - 'Found. Redirecting to http://localhost:8378/1/apps/verify_email_success.html?username=user' - ); - user - .fetch({ useMasterKey: true }) - .then( - () => { - expect(user.get('emailVerified')).toEqual(true); - - Parse.User.logIn('user', 'other-password').then( - user => { - expect(typeof user).toBe('object'); - expect(user.get('emailVerified')).toBe(true); - done(); - }, - () => { - fail('login should have succeeded'); - done(); - } - ); - }, - err => { - jfail(err); - fail('this should not fail'); - done(); - } - ) - .catch(err => { - jfail(err); - done(); - }); - }); - }); + }); + let user = new Parse.User(); + user.setPassword('other-password'); + user.setUsername('user'); + user.set('email', 'user@example.com'); + await user.signUp(); + expect(sendEmailOptions).not.toBeUndefined(); + const response = await request({ + url: sendEmailOptions.link, + followRedirects: false, + }); + expect(response.status).toEqual(302); + expect(response.text).toEqual( + 'Found. Redirecting to http://localhost:8378/1/apps/verify_email_success.html?username=user' + ); + user = await new Parse.Query(Parse.User).first({ useMasterKey: true }); + expect(user.get('emailVerified')).toEqual(true); + user = await Parse.User.logIn('user', 'other-password'); + expect(typeof user).toBe('object'); + expect(user.get('emailVerified')).toBe(true); }); it('allows user to login if email is not verified but preventLoginWithUnverifiedEmail is set to false', done => { @@ -345,6 +317,35 @@ describe('Custom Pages, Email Verification, Password Reset', () => { }); }); + it('does not allow signup with preventSignupWithUnverified', async () => { + let sendEmailOptions; + const emailAdapter = { + sendVerificationEmail: options => { + sendEmailOptions = options; + }, + sendPasswordResetEmail: () => Promise.resolve(), + sendMail: () => {}, + }; + await reconfigureServer({ + appName: 'test', + publicServerURL: 'http://localhost:1337/1', + verifyUserEmails: true, + preventLoginWithUnverifiedEmail: true, + preventSignupWithUnverifiedEmail: true, + emailAdapter, + }); + const newUser = new Parse.User(); + newUser.setPassword('asdf'); + newUser.setUsername('zxcv'); + newUser.set('email', 'test@example.com'); + await expectAsync(newUser.signUp()).toBeRejectedWith( + new Parse.Error(Parse.Error.EMAIL_NOT_FOUND, 'User email is not verified.') + ); + const user = await new Parse.Query(Parse.User).first({ useMasterKey: true }); + expect(user).toBeDefined(); + expect(sendEmailOptions).toBeDefined(); + }); + it('fails if you include an emailAdapter, set a publicServerURL, but have no appName and send a password reset email', done => { reconfigureServer({ appName: undefined, diff --git a/spec/VerifyUserPassword.spec.js b/spec/VerifyUserPassword.spec.js index 6734dcdb71..eef2485815 100644 --- a/spec/VerifyUserPassword.spec.js +++ b/spec/VerifyUserPassword.spec.js @@ -353,8 +353,9 @@ describe('Verify User Password', () => { done(); }); }); - it('fails to verify password when preventLoginWithUnverifiedEmail is set to true REST API', done => { - reconfigureServer({ + + it('fails to verify password when preventLoginWithUnverifiedEmail is set to true REST API', async () => { + await reconfigureServer({ publicServerURL: 'http://localhost:8378/', appName: 'emailVerify', verifyUserEmails: true, @@ -364,28 +365,21 @@ describe('Verify User Password', () => { apiKey: 'k', domain: 'd', }), - }) - .then(() => { - const user = new Parse.User(); - return user.save({ - username: 'unverified-user', - password: 'mypass', - email: 'unverified-email@user.com', - }); - }) - .then(() => { - return verifyPassword('unverified-email@user.com', 'mypass', true); - }) - .then(res => { - expect(res.status).toBe(400); - expect(res.text).toMatch('{"code":205,"error":"User email is not verified."}'); - done(); - }) - .catch(err => { - fail(err); - done(); - }); + }); + const user = new Parse.User(); + await user.save({ + username: 'unverified-user', + password: 'mypass', + email: 'unverified-email@example.com', + }); + const res = await verifyPassword('unverified-email@example.com', 'mypass', true); + expect(res.status).toBe(400); + expect(res.data).toEqual({ + code: Parse.Error.EMAIL_NOT_FOUND, + error: 'User email is not verified.', + }); }); + it('verify password lock account if failed verify password attempts are above threshold', done => { reconfigureServer({ appName: 'lockout threshold', diff --git a/src/Options/Definitions.js b/src/Options/Definitions.js index b0cf602bab..31700b4cc2 100644 --- a/src/Options/Definitions.js +++ b/src/Options/Definitions.js @@ -412,6 +412,13 @@ module.exports.ParseServerOptions = { action: parsers.booleanParser, default: false, }, + preventSignupWithUnverifiedEmail: { + env: 'PARSE_SERVER_PREVENT_SIGNUP_WITH_UNVERIFIED_EMAIL', + help: + "If set to `true` it prevents a user from signing up if the email has not yet been verified and email verification is required. In that case the server responds to the sign-up with HTTP status 400 and a Parse Error 205 `EMAIL_NOT_FOUND`. If set to `false` the server responds with HTTP status 200, and client SDKs return an unauthenticated Parse User without session token. In that case subsequent requests fail until the user's email address is verified.

Default is `false`.
Requires option `verifyUserEmails: true`.", + action: parsers.booleanParser, + default: false, + }, protectedFields: { env: 'PARSE_SERVER_PROTECTED_FIELDS', help: 'Protected fields that should be treated with extra security when fetching details.', diff --git a/src/Options/docs.js b/src/Options/docs.js index 6e4d7671eb..b1bf31a5e7 100644 --- a/src/Options/docs.js +++ b/src/Options/docs.js @@ -77,6 +77,7 @@ * @property {Number} port The port to run the ParseServer, defaults to 1337. * @property {Boolean} preserveFileName Enable (or disable) the addition of a unique hash to the file names * @property {Boolean} preventLoginWithUnverifiedEmail Set to `true` to prevent a user from logging in if the email has not yet been verified and email verification is required.

Default is `false`.
Requires option `verifyUserEmails: true`. + * @property {Boolean} preventSignupWithUnverifiedEmail If set to `true` it prevents a user from signing up if the email has not yet been verified and email verification is required. In that case the server responds to the sign-up with HTTP status 400 and a Parse Error 205 `EMAIL_NOT_FOUND`. If set to `false` the server responds with HTTP status 200, and client SDKs return an unauthenticated Parse User without session token. In that case subsequent requests fail until the user's email address is verified.

Default is `false`.
Requires option `verifyUserEmails: true`. * @property {ProtectedFields} protectedFields Protected fields that should be treated with extra security when fetching details. * @property {String} publicServerURL Public URL to your parse server with http:// or https://. * @property {Any} push Configuration for push, as stringified JSON. See http://docs.parseplatform.org/parse-server/guide/#push-notifications diff --git a/src/Options/index.js b/src/Options/index.js index 8588a1f7fe..492f4323e9 100644 --- a/src/Options/index.js +++ b/src/Options/index.js @@ -165,6 +165,13 @@ export interface ParseServerOptions { Requires option `verifyUserEmails: true`. :DEFAULT: false */ preventLoginWithUnverifiedEmail: ?boolean; + /* If set to `true` it prevents a user from signing up if the email has not yet been verified and email verification is required. In that case the server responds to the sign-up with HTTP status 400 and a Parse Error 205 `EMAIL_NOT_FOUND`. If set to `false` the server responds with HTTP status 200, and client SDKs return an unauthenticated Parse User without session token. In that case subsequent requests fail until the user's email address is verified. +

+ Default is `false`. +
+ Requires option `verifyUserEmails: true`. + :DEFAULT: false */ + preventSignupWithUnverifiedEmail: ?boolean; /* Set the validity duration of the email verification token in seconds after which the token expires. The token is used in the link that is set in the email. After the token expires, the link becomes invalid and a new link has to be sent. If the option is not set or set to `undefined`, then the token never expires.

For example, to expire the token after 2 hours, set a value of 7200 seconds (= 60 seconds * 60 minutes * 2 hours). diff --git a/src/RestWrite.js b/src/RestWrite.js index c703ee50bb..f7c6a53592 100644 --- a/src/RestWrite.js +++ b/src/RestWrite.js @@ -160,6 +160,9 @@ RestWrite.prototype.execute = function () { this.response.response.authDataResponse = this.authDataResponse; } } + if (this.storage.rejectSignup && this.config.preventSignupWithUnverifiedEmail) { + throw new Parse.Error(Parse.Error.EMAIL_NOT_FOUND, 'User email is not verified.'); + } return this.response; }); }; @@ -879,7 +882,8 @@ RestWrite.prototype.createSessionTokenIfNeeded = function () { this.config.verifyUserEmails ) { // verification is on - return; // do not create the session token in that case! + this.storage.rejectSignup = true; + return; } return this.createSessionToken(); }; From b01d4f0abb974647a008557f59a71aa35153e92f Mon Sep 17 00:00:00 2001 From: semantic-release-bot Date: Wed, 7 Jun 2023 19:53:02 +0000 Subject: [PATCH 28/32] chore(release): 6.1.0-alpha.17 [skip ci] # [6.1.0-alpha.17](https://github.com/parse-community/parse-server/compare/6.1.0-alpha.16...6.1.0-alpha.17) (2023-06-07) ### Features * Add new Parse Server option `preventSignupWithUnverifiedEmail` to prevent returning a user without session token on sign-up with unverified email address ([#8451](https://github.com/parse-community/parse-server/issues/8451)) ([82da308](https://github.com/parse-community/parse-server/commit/82da30842a55980aa90cb7680fbf6db37ee16dab)) --- changelogs/CHANGELOG_alpha.md | 7 +++++++ package-lock.json | 4 ++-- package.json | 2 +- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/changelogs/CHANGELOG_alpha.md b/changelogs/CHANGELOG_alpha.md index 3002b21d26..b16a0daac2 100644 --- a/changelogs/CHANGELOG_alpha.md +++ b/changelogs/CHANGELOG_alpha.md @@ -1,3 +1,10 @@ +# [6.1.0-alpha.17](https://github.com/parse-community/parse-server/compare/6.1.0-alpha.16...6.1.0-alpha.17) (2023-06-07) + + +### Features + +* Add new Parse Server option `preventSignupWithUnverifiedEmail` to prevent returning a user without session token on sign-up with unverified email address ([#8451](https://github.com/parse-community/parse-server/issues/8451)) ([82da308](https://github.com/parse-community/parse-server/commit/82da30842a55980aa90cb7680fbf6db37ee16dab)) + # [6.1.0-alpha.16](https://github.com/parse-community/parse-server/compare/6.1.0-alpha.15...6.1.0-alpha.16) (2023-05-28) diff --git a/package-lock.json b/package-lock.json index 5ddc19b436..ae2c1bdf3c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "parse-server", - "version": "6.1.0-alpha.16", + "version": "6.1.0-alpha.17", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "parse-server", - "version": "6.1.0-alpha.16", + "version": "6.1.0-alpha.17", "hasInstallScript": true, "license": "Apache-2.0", "dependencies": { diff --git a/package.json b/package.json index 5d30586d4a..785845e7f0 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "parse-server", - "version": "6.1.0-alpha.16", + "version": "6.1.0-alpha.17", "description": "An express module providing a Parse-compatible API server", "main": "lib/index.js", "repository": { From 656d673cf5dea354e4f2b3d4dc2b29a41d311b3e Mon Sep 17 00:00:00 2001 From: Corey Date: Wed, 7 Jun 2023 22:04:58 -0400 Subject: [PATCH 29/32] feat: Add support for `$eq` query constraint in LiveQuery (#8614) --- spec/QueryTools.spec.js | 29 +++++++++++++++++++++++++++++ src/LiveQuery/QueryTools.js | 5 +++++ 2 files changed, 34 insertions(+) diff --git a/spec/QueryTools.spec.js b/spec/QueryTools.spec.js index dbd3c9a5d3..8dbda98b0a 100644 --- a/spec/QueryTools.spec.js +++ b/spec/QueryTools.spec.js @@ -125,6 +125,35 @@ describe('matchesQuery', function () { expect(matchesQuery(obj, q)).toBe(false); }); + it('matches queries with eq constraint', function () { + const obj = { + objectId: 'Person2', + score: 12, + name: 'Tom', + }; + + const q1 = { + objectId: { + $eq: 'Person2', + }, + }; + + const q2 = { + score: { + $eq: 12, + }, + }; + + const q3 = { + name: { + $eq: 'Tom', + }, + }; + expect(matchesQuery(obj, q1)).toBe(true); + expect(matchesQuery(obj, q2)).toBe(true); + expect(matchesQuery(obj, q3)).toBe(true); + }); + it('matches on equality queries', function () { const day = new Date(); const location = new Parse.GeoPoint({ diff --git a/src/LiveQuery/QueryTools.js b/src/LiveQuery/QueryTools.js index 50d8d3394a..1607278f46 100644 --- a/src/LiveQuery/QueryTools.js +++ b/src/LiveQuery/QueryTools.js @@ -247,6 +247,11 @@ function matchesKeyConstraints(object, key, constraints) { return false; } break; + case '$eq': + if (!equalObjects(object[key], compareTo)) { + return false; + } + break; case '$ne': if (equalObjects(object[key], compareTo)) { return false; From 3ea1ace631ed4ccb6ff38c906cfde02f4e3c74b8 Mon Sep 17 00:00:00 2001 From: semantic-release-bot Date: Thu, 8 Jun 2023 02:06:02 +0000 Subject: [PATCH 30/32] chore(release): 6.1.0-alpha.18 [skip ci] # [6.1.0-alpha.18](https://github.com/parse-community/parse-server/compare/6.1.0-alpha.17...6.1.0-alpha.18) (2023-06-08) ### Features * Add support for `$eq` query constraint in LiveQuery ([#8614](https://github.com/parse-community/parse-server/issues/8614)) ([656d673](https://github.com/parse-community/parse-server/commit/656d673cf5dea354e4f2b3d4dc2b29a41d311b3e)) --- changelogs/CHANGELOG_alpha.md | 7 +++++++ package-lock.json | 4 ++-- package.json | 2 +- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/changelogs/CHANGELOG_alpha.md b/changelogs/CHANGELOG_alpha.md index b16a0daac2..718c2e41b6 100644 --- a/changelogs/CHANGELOG_alpha.md +++ b/changelogs/CHANGELOG_alpha.md @@ -1,3 +1,10 @@ +# [6.1.0-alpha.18](https://github.com/parse-community/parse-server/compare/6.1.0-alpha.17...6.1.0-alpha.18) (2023-06-08) + + +### Features + +* Add support for `$eq` query constraint in LiveQuery ([#8614](https://github.com/parse-community/parse-server/issues/8614)) ([656d673](https://github.com/parse-community/parse-server/commit/656d673cf5dea354e4f2b3d4dc2b29a41d311b3e)) + # [6.1.0-alpha.17](https://github.com/parse-community/parse-server/compare/6.1.0-alpha.16...6.1.0-alpha.17) (2023-06-07) diff --git a/package-lock.json b/package-lock.json index ae2c1bdf3c..1333a85173 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "parse-server", - "version": "6.1.0-alpha.17", + "version": "6.1.0-alpha.18", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "parse-server", - "version": "6.1.0-alpha.17", + "version": "6.1.0-alpha.18", "hasInstallScript": true, "license": "Apache-2.0", "dependencies": { diff --git a/package.json b/package.json index 785845e7f0..2d0a0b4493 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "parse-server", - "version": "6.1.0-alpha.17", + "version": "6.1.0-alpha.18", "description": "An express module providing a Parse-compatible API server", "main": "lib/index.js", "repository": { From 967700bdbc94c74f75ba84d2b3f4b9f3fd2dca0b Mon Sep 17 00:00:00 2001 From: Daniel Date: Thu, 8 Jun 2023 19:04:49 +1000 Subject: [PATCH 31/32] fix: LiveQuery server is not shut down properly when `handleShutdown` is called (#8491) --- spec/ParseLiveQuery.spec.js | 35 +++++++++++++++++++ .../Storage/Mongo/MongoStorageAdapter.js | 7 ++-- .../Postgres/PostgresStorageAdapter.js | 4 ++- src/LiveQuery/ParseLiveQueryServer.js | 15 ++++++++ src/ParseServer.js | 6 ++++ 5 files changed, 63 insertions(+), 4 deletions(-) diff --git a/spec/ParseLiveQuery.spec.js b/spec/ParseLiveQuery.spec.js index 959df18cf9..015725ac46 100644 --- a/spec/ParseLiveQuery.spec.js +++ b/spec/ParseLiveQuery.spec.js @@ -2,6 +2,7 @@ const Auth = require('../lib/Auth'); const UserController = require('../lib/Controllers/UserController').UserController; const Config = require('../lib/Config'); +const ParseServer = require('../lib/index').ParseServer; const triggers = require('../lib/triggers'); const validatorFail = () => { throw 'you are not authorized'; @@ -1214,6 +1215,40 @@ describe('ParseLiveQuery', function () { await object.save(); }); + it('does shutdown liveQuery server', async () => { + await reconfigureServer({ appId: 'test_app_id' }); + const config = { + appId: 'hello_test', + masterKey: 'world', + port: 1345, + mountPath: '/1', + serverURL: 'http://localhost:1345/1', + liveQuery: { + classNames: ['Yolo'], + }, + startLiveQueryServer: true, + }; + if (process.env.PARSE_SERVER_TEST_DB === 'postgres') { + config.databaseAdapter = new databaseAdapter.constructor({ + uri: databaseURI, + collectionPrefix: 'test_', + }); + config.filesAdapter = defaultConfiguration.filesAdapter; + } + const server = await ParseServer.startApp(config); + const client = await Parse.CoreManager.getLiveQueryController().getDefaultLiveQueryClient(); + client.serverURL = 'ws://localhost:1345/1'; + const query = await new Parse.Query('Yolo').subscribe(); + await Promise.all([ + server.handleShutdown(), + new Promise(resolve => query.on('close', resolve)), + ]); + await new Promise(resolve => setTimeout(resolve, 100)); + expect(server.liveQueryServer.server.address()).toBeNull(); + expect(server.liveQueryServer.subscriber.isOpen).toBeFalse(); + await new Promise(resolve => server.server.close(resolve)); + }); + it('prevent afterSave trigger if not exists', async () => { await reconfigureServer({ liveQuery: { diff --git a/src/Adapters/Storage/Mongo/MongoStorageAdapter.js b/src/Adapters/Storage/Mongo/MongoStorageAdapter.js index 78833a026b..2f59819895 100644 --- a/src/Adapters/Storage/Mongo/MongoStorageAdapter.js +++ b/src/Adapters/Storage/Mongo/MongoStorageAdapter.js @@ -212,11 +212,12 @@ export class MongoStorageAdapter implements StorageAdapter { throw error; } - handleShutdown() { + async handleShutdown() { if (!this.client) { - return Promise.resolve(); + return; } - return this.client.close(false); + await this.client.close(false); + delete this.connectionPromise; } _adaptiveCollection(name: string) { diff --git a/src/Adapters/Storage/Postgres/PostgresStorageAdapter.js b/src/Adapters/Storage/Postgres/PostgresStorageAdapter.js index 82ac0c20dc..3e8e867799 100644 --- a/src/Adapters/Storage/Postgres/PostgresStorageAdapter.js +++ b/src/Adapters/Storage/Postgres/PostgresStorageAdapter.js @@ -1194,7 +1194,9 @@ export class PostgresStorageAdapter implements StorageAdapter { const now = new Date().getTime(); const helpers = this._pgp.helpers; debug('deleteAllClasses'); - + if (this._client?.$pool.ended) { + return; + } await this._client .task('delete-all-classes', async t => { try { diff --git a/src/LiveQuery/ParseLiveQueryServer.js b/src/LiveQuery/ParseLiveQueryServer.js index 1105a2a6b7..d0b535f3a1 100644 --- a/src/LiveQuery/ParseLiveQueryServer.js +++ b/src/LiveQuery/ParseLiveQueryServer.js @@ -93,6 +93,21 @@ class ParseLiveQueryServer { } this._createSubscribers(); } + + async shutdown() { + if (this.subscriber.isOpen) { + await Promise.all([ + ...[...this.clients.values()].map(client => client.parseWebSocket.ws.close()), + this.parseWebSocketServer.close(), + ...Array.from(this.subscriber.subscriptions.keys()).map(key => + this.subscriber.unsubscribe(key) + ), + this.subscriber.close?.(), + ]); + } + this.subscriber.isOpen = false; + } + _createSubscribers() { const messageRecieved = (channel, messageStr) => { logger.verbose('Subscribe message %j', messageStr); diff --git a/src/ParseServer.js b/src/ParseServer.js index 04379ecfd3..192ad9c40c 100644 --- a/src/ParseServer.js +++ b/src/ParseServer.js @@ -168,6 +168,12 @@ class ParseServer { if (cacheAdapter && typeof cacheAdapter.handleShutdown === 'function') { promises.push(cacheAdapter.handleShutdown()); } + if (this.liveQueryServer?.server?.close) { + promises.push(new Promise(resolve => this.liveQueryServer.server.close(resolve))); + } + if (this.liveQueryServer) { + promises.push(this.liveQueryServer.shutdown()); + } return (promises.length > 0 ? Promise.all(promises) : Promise.resolve()).then(() => { if (this.config.serverCloseComplete) { this.config.serverCloseComplete(); From e2a7218f74a4c6603f224c665acc5ba6c0838572 Mon Sep 17 00:00:00 2001 From: semantic-release-bot Date: Thu, 8 Jun 2023 09:05:50 +0000 Subject: [PATCH 32/32] chore(release): 6.1.0-alpha.19 [skip ci] # [6.1.0-alpha.19](https://github.com/parse-community/parse-server/compare/6.1.0-alpha.18...6.1.0-alpha.19) (2023-06-08) ### Bug Fixes * LiveQuery server is not shut down properly when `handleShutdown` is called ([#8491](https://github.com/parse-community/parse-server/issues/8491)) ([967700b](https://github.com/parse-community/parse-server/commit/967700bdbc94c74f75ba84d2b3f4b9f3fd2dca0b)) --- changelogs/CHANGELOG_alpha.md | 7 +++++++ package-lock.json | 4 ++-- package.json | 2 +- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/changelogs/CHANGELOG_alpha.md b/changelogs/CHANGELOG_alpha.md index 718c2e41b6..9b96e60b47 100644 --- a/changelogs/CHANGELOG_alpha.md +++ b/changelogs/CHANGELOG_alpha.md @@ -1,3 +1,10 @@ +# [6.1.0-alpha.19](https://github.com/parse-community/parse-server/compare/6.1.0-alpha.18...6.1.0-alpha.19) (2023-06-08) + + +### Bug Fixes + +* LiveQuery server is not shut down properly when `handleShutdown` is called ([#8491](https://github.com/parse-community/parse-server/issues/8491)) ([967700b](https://github.com/parse-community/parse-server/commit/967700bdbc94c74f75ba84d2b3f4b9f3fd2dca0b)) + # [6.1.0-alpha.18](https://github.com/parse-community/parse-server/compare/6.1.0-alpha.17...6.1.0-alpha.18) (2023-06-08) diff --git a/package-lock.json b/package-lock.json index 1333a85173..befd4f9bd5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "parse-server", - "version": "6.1.0-alpha.18", + "version": "6.1.0-alpha.19", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "parse-server", - "version": "6.1.0-alpha.18", + "version": "6.1.0-alpha.19", "hasInstallScript": true, "license": "Apache-2.0", "dependencies": { diff --git a/package.json b/package.json index 2d0a0b4493..78b43b769b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "parse-server", - "version": "6.1.0-alpha.18", + "version": "6.1.0-alpha.19", "description": "An express module providing a Parse-compatible API server", "main": "lib/index.js", "repository": {