From ccd8763161fa49c164a88a3190c41d1c24abd6c3 Mon Sep 17 00:00:00 2001 From: dblythy Date: Mon, 19 Jun 2023 15:27:52 +1000 Subject: [PATCH 01/10] refactor: Add option to convert Parse.Pointer in Cloud Function payload --- spec/CloudCode.spec.js | 20 ++++++++++++++++++++ src/Options/Definitions.js | 6 ++++++ src/Options/docs.js | 1 + src/Options/index.js | 3 +++ src/Routers/FunctionsRouter.js | 14 +++++++------- 5 files changed, 37 insertions(+), 7 deletions(-) diff --git a/spec/CloudCode.spec.js b/spec/CloudCode.spec.js index a8795a4e84..1a993fd3c3 100644 --- a/spec/CloudCode.spec.js +++ b/spec/CloudCode.spec.js @@ -1353,7 +1353,27 @@ describe('Cloud Code', () => { }); }); + it('should not enode 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).not.toBeTrue(); + return 'Object deleted'; + }, + { + requireMaster: true, + } + ); + await Parse.Cloud.run('deleteAccount', { object: user.toPointer() }, { useMasterKey: true }); + }); + it('allow cloud to encode Parse Objects', async () => { + await reconfigureServer({ encodeCloudPointers: true }); const user = new Parse.User(); user.setUsername('username'); user.setPassword('password'); diff --git a/src/Options/Definitions.js b/src/Options/Definitions.js index 3815902c51..8cf33667f1 100644 --- a/src/Options/Definitions.js +++ b/src/Options/Definitions.js @@ -210,6 +210,12 @@ module.exports.ParseServerOptions = { action: parsers.booleanParser, default: false, }, + encodeCloudPointers: { + env: 'PARSE_SERVER_ENCODE_CLOUD_POINTERS', + help: 'Whether Parse Pointers should be encoded in Cloud Code.', + action: parsers.booleanParser, + default: false, + }, encryptionKey: { env: 'PARSE_SERVER_ENCRYPTION_KEY', help: 'Key for encrypting your files', diff --git a/src/Options/docs.js b/src/Options/docs.js index 847e7df944..8c447368a2 100644 --- a/src/Options/docs.js +++ b/src/Options/docs.js @@ -40,6 +40,7 @@ * @property {Number} emailVerifyTokenValidityDuration 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).

Default is `undefined`.
Requires option `verifyUserEmails: true`. * @property {Boolean} enableAnonymousUsers Enable (or disable) anonymous users, defaults to true * @property {Boolean} enableExpressErrorHandler Enables the default express error handler for all errors + * @property {Boolean} encodeCloudPointers Whether Parse Pointers should be encoded in Cloud Code. * @property {String} encryptionKey Key for encrypting your files * @property {Boolean} enforcePrivateUsers Set to true if new users should be created without public read and write access. * @property {Boolean} expireInactiveSessions Sets whether we should expire the inactive sessions, defaults to true. If false, all new sessions are created with no expiration date. diff --git a/src/Options/index.js b/src/Options/index.js index 87813147f7..e339b5978d 100644 --- a/src/Options/index.js +++ b/src/Options/index.js @@ -196,6 +196,9 @@ export interface ParseServerOptions { cacheAdapter: ?Adapter; /* Adapter module for email sending */ emailAdapter: ?Adapter; + /* Whether Parse Pointers should be encoded in Cloud Code. + :DEFAULT: false */ + encodeCloudPointers: ?boolean; /* Public URL to your parse server with http:// or https://. :ENV: PARSE_PUBLIC_SERVER_URL */ publicServerURL: ?string; diff --git a/src/Routers/FunctionsRouter.js b/src/Routers/FunctionsRouter.js index da69d54e0c..de61893c03 100644 --- a/src/Routers/FunctionsRouter.js +++ b/src/Routers/FunctionsRouter.js @@ -9,7 +9,7 @@ import { jobStatusHandler } from '../StatusHandler'; import _ from 'lodash'; import { logger } from '../logger'; -function parseObject(obj) { +function parseObject(obj, config) { if (Array.isArray(obj)) { return obj.map(item => { return parseObject(item); @@ -18,21 +18,21 @@ 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') { + } else if (obj && obj.__type == 'Pointer' && config.encodeCloudPointers) { return Parse.Object.fromJSON({ __type: 'Pointer', className: obj.className, objectId: obj.objectId, }); } else if (obj && typeof obj === 'object') { - return parseParams(obj); + return parseParams(obj, config); } else { return obj; } } -function parseParams(params) { - return _.mapValues(params, parseObject); +function parseParams(params, config) { + return _.mapValues(params, item => parseObject(item, config)); } export class FunctionsRouter extends PromiseRouter { @@ -66,7 +66,7 @@ export class FunctionsRouter extends PromiseRouter { throw new Parse.Error(Parse.Error.SCRIPT_FAILED, 'Invalid job.'); } let params = Object.assign({}, req.body, req.query); - params = parseParams(params); + params = parseParams(params, req.config); const request = { params: params, log: req.config.loggerController, @@ -126,7 +126,7 @@ export class FunctionsRouter extends PromiseRouter { throw new Parse.Error(Parse.Error.SCRIPT_FAILED, `Invalid function: "${functionName}"`); } let params = Object.assign({}, req.body, req.query); - params = parseParams(params); + params = parseParams(params, req.config); const request = { params: params, master: req.auth && req.auth.isMaster, From 2333a59f683bf47f6c2503f8628f6cef65d48076 Mon Sep 17 00:00:00 2001 From: Manuel <5673677+mtrezza@users.noreply.github.com> Date: Mon, 19 Jun 2023 22:38:14 +0200 Subject: [PATCH 02/10] Update spec/CloudCode.spec.js Signed-off-by: Manuel <5673677+mtrezza@users.noreply.github.com> --- spec/CloudCode.spec.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/CloudCode.spec.js b/spec/CloudCode.spec.js index 1a993fd3c3..939f373924 100644 --- a/spec/CloudCode.spec.js +++ b/spec/CloudCode.spec.js @@ -1353,7 +1353,7 @@ describe('Cloud Code', () => { }); }); - it('should not enode Parse Objects', async () => { + it('should not encode Parse Objects', async () => { const user = new Parse.User(); user.setUsername('username'); user.setPassword('password'); From dc466087561c6e0181281ee4d49f161db41368b6 Mon Sep 17 00:00:00 2001 From: Daniel Date: Thu, 22 Jun 2023 12:46:40 +1000 Subject: [PATCH 03/10] Update src/Options/index.js Co-authored-by: Manuel <5673677+mtrezza@users.noreply.github.com> Signed-off-by: Daniel --- src/Options/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Options/index.js b/src/Options/index.js index e339b5978d..bd320d549a 100644 --- a/src/Options/index.js +++ b/src/Options/index.js @@ -196,9 +196,9 @@ export interface ParseServerOptions { cacheAdapter: ?Adapter; /* Adapter module for email sending */ emailAdapter: ?Adapter; - /* Whether Parse Pointers should be encoded in Cloud Code. + /* If set to `true`, a `Parse.Pointer` that is in the payload when calling a Cloud Function will be converted to an instance of a `Parse.Pointer`. If `false`, the object will not be converted and instead be a plain JavaScript object, which contains the raw data of a `Parse.Pointer` but is not an actual instance of a `Parse.Pointer`. Default is `false`.

ℹ️ The expected behavior would be that the object is converted to an instance of `Parse.Pointer`, so you would normally set this option to `true`. The default is `false` because this is a temporary option that has been introduced to avoid a breaking change when fixing a bug where `Parse.Pointer` objects are not converted to actual instances of `Parse.Pointer`. :DEFAULT: false */ - encodeCloudPointers: ?boolean; + encodePointerInCloudFunction: ?boolean; /* Public URL to your parse server with http:// or https://. :ENV: PARSE_PUBLIC_SERVER_URL */ publicServerURL: ?string; From aa241ae8db03e55ab8aa38c100a4ef4d4a722761 Mon Sep 17 00:00:00 2001 From: dblythy Date: Thu, 22 Jun 2023 12:47:04 +1000 Subject: [PATCH 04/10] definitions --- src/Options/Definitions.js | 7 ++++--- src/Options/docs.js | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/Options/Definitions.js b/src/Options/Definitions.js index 8cf33667f1..c9c0161cac 100644 --- a/src/Options/Definitions.js +++ b/src/Options/Definitions.js @@ -210,9 +210,10 @@ module.exports.ParseServerOptions = { action: parsers.booleanParser, default: false, }, - encodeCloudPointers: { - env: 'PARSE_SERVER_ENCODE_CLOUD_POINTERS', - help: 'Whether Parse Pointers should be encoded in Cloud Code.', + encodePointerInCloudFunction: { + env: 'PARSE_SERVER_ENCODE_POINTER_IN_CLOUD_FUNCTION', + help: + 'If set to `true`, a `Parse.Pointer` that is in the payload when calling a Cloud Function will be converted to an instance of a `Parse.Pointer`. If `false`, the object will not be converted and instead be a plain JavaScript object, which contains the raw data of a `Parse.Pointer` but is not an actual instance of a `Parse.Pointer`. Default is `false`.

\u2139\uFE0F The expected behavior would be that the object is converted to an instance of `Parse.Pointer`, so you would normally set this option to `true`. The default is `false` because this is a temporary option that has been introduced to avoid a breaking change when fixing a bug where `Parse.Pointer` objects are not converted to actual instances of `Parse.Pointer`.', action: parsers.booleanParser, default: false, }, diff --git a/src/Options/docs.js b/src/Options/docs.js index 8c447368a2..31bf198daf 100644 --- a/src/Options/docs.js +++ b/src/Options/docs.js @@ -40,7 +40,7 @@ * @property {Number} emailVerifyTokenValidityDuration 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).

Default is `undefined`.
Requires option `verifyUserEmails: true`. * @property {Boolean} enableAnonymousUsers Enable (or disable) anonymous users, defaults to true * @property {Boolean} enableExpressErrorHandler Enables the default express error handler for all errors - * @property {Boolean} encodeCloudPointers Whether Parse Pointers should be encoded in Cloud Code. + * @property {Boolean} encodePointerInCloudFunction If set to `true`, a `Parse.Pointer` that is in the payload when calling a Cloud Function will be converted to an instance of a `Parse.Pointer`. If `false`, the object will not be converted and instead be a plain JavaScript object, which contains the raw data of a `Parse.Pointer` but is not an actual instance of a `Parse.Pointer`. Default is `false`.

ℹ️ The expected behavior would be that the object is converted to an instance of `Parse.Pointer`, so you would normally set this option to `true`. The default is `false` because this is a temporary option that has been introduced to avoid a breaking change when fixing a bug where `Parse.Pointer` objects are not converted to actual instances of `Parse.Pointer`. * @property {String} encryptionKey Key for encrypting your files * @property {Boolean} enforcePrivateUsers Set to true if new users should be created without public read and write access. * @property {Boolean} expireInactiveSessions Sets whether we should expire the inactive sessions, defaults to true. If false, all new sessions are created with no expiration date. From ff3cbb36f0a5c74abe70f129a4d5497a529d2afe Mon Sep 17 00:00:00 2001 From: dblythy Date: Fri, 23 Jun 2023 11:32:51 +1000 Subject: [PATCH 05/10] add deprecated --- DEPRECATIONS.md | 1 + src/Deprecator/Deprecations.js | 1 + 2 files changed, 2 insertions(+) diff --git a/DEPRECATIONS.md b/DEPRECATIONS.md index 56359c937e..ebffe36f20 100644 --- a/DEPRECATIONS.md +++ b/DEPRECATIONS.md @@ -13,6 +13,7 @@ The following is a list of deprecations, according to the [Deprecation Policy](h | DEPPS7 | Remove file trigger syntax `Parse.Cloud.beforeSaveFile((request) => {})` | [#7966](https://github.com/parse-community/parse-server/pull/7966) | 5.3.0 (2022) | 7.0.0 (2024) | deprecated | - | | DEPPS8 | Login with expired 3rd party authentication token defaults to `false` | [#7079](https://github.com/parse-community/parse-server/pull/7079) | 5.3.0 (2022) | 7.0.0 (2024) | deprecated | - | | DEPPS9 | Rename LiveQuery `fields` option to `keys` | [#8389](https://github.com/parse-community/parse-server/issues/8389) | 6.0.0 (2023) | 7.0.0 (2024) | deprecated | - | +| DEPPS10 | `encodePointerInCloudFunction` defaults to `true` | [#8634](https://github.com/parse-community/parse-server/issues/8634) | 6.2.0 (2023) | 7.0.0 (2024) | deprecated | - | [i_deprecation]: ## "The version and date of the deprecation." [i_removal]: ## "The version and date of the planned removal." diff --git a/src/Deprecator/Deprecations.js b/src/Deprecator/Deprecations.js index 0afd98ff0c..4980853d8d 100644 --- a/src/Deprecator/Deprecations.js +++ b/src/Deprecator/Deprecations.js @@ -18,4 +18,5 @@ module.exports = [ { optionKey: 'allowClientClassCreation', changeNewDefault: 'false' }, { optionKey: 'allowExpiredAuthDataToken', changeNewDefault: 'false' }, + { optionKey: 'encodePointerInCloudFunction', changeNewDefault: 'true' }, ]; From 755e967cf5953071a6066f994e513c5b3914aa96 Mon Sep 17 00:00:00 2001 From: dblythy Date: Fri, 23 Jun 2023 12:33:41 +1000 Subject: [PATCH 06/10] rename --- DEPRECATIONS.md | 2 +- spec/CloudCode.spec.js | 2 +- src/Deprecator/Deprecations.js | 2 +- src/Options/Definitions.js | 2 +- src/Options/docs.js | 2 +- src/Options/index.js | 2 +- src/Routers/FunctionsRouter.js | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/DEPRECATIONS.md b/DEPRECATIONS.md index ebffe36f20..6674c18808 100644 --- a/DEPRECATIONS.md +++ b/DEPRECATIONS.md @@ -13,7 +13,7 @@ The following is a list of deprecations, according to the [Deprecation Policy](h | DEPPS7 | Remove file trigger syntax `Parse.Cloud.beforeSaveFile((request) => {})` | [#7966](https://github.com/parse-community/parse-server/pull/7966) | 5.3.0 (2022) | 7.0.0 (2024) | deprecated | - | | DEPPS8 | Login with expired 3rd party authentication token defaults to `false` | [#7079](https://github.com/parse-community/parse-server/pull/7079) | 5.3.0 (2022) | 7.0.0 (2024) | deprecated | - | | DEPPS9 | Rename LiveQuery `fields` option to `keys` | [#8389](https://github.com/parse-community/parse-server/issues/8389) | 6.0.0 (2023) | 7.0.0 (2024) | deprecated | - | -| DEPPS10 | `encodePointerInCloudFunction` defaults to `true` | [#8634](https://github.com/parse-community/parse-server/issues/8634) | 6.2.0 (2023) | 7.0.0 (2024) | deprecated | - | +| DEPPS10 | `encodeParseObjectInCloudFunction` defaults to `true` | [#8634](https://github.com/parse-community/parse-server/issues/8634) | 6.2.0 (2023) | 7.0.0 (2024) | deprecated | - | [i_deprecation]: ## "The version and date of the deprecation." [i_removal]: ## "The version and date of the planned removal." diff --git a/spec/CloudCode.spec.js b/spec/CloudCode.spec.js index 939f373924..a2e623551a 100644 --- a/spec/CloudCode.spec.js +++ b/spec/CloudCode.spec.js @@ -1373,7 +1373,7 @@ describe('Cloud Code', () => { }); it('allow cloud to encode Parse Objects', async () => { - await reconfigureServer({ encodeCloudPointers: true }); + await reconfigureServer({ encodeParseObjectInCloudFunction: true }); const user = new Parse.User(); user.setUsername('username'); user.setPassword('password'); diff --git a/src/Deprecator/Deprecations.js b/src/Deprecator/Deprecations.js index 4980853d8d..2f698ad33e 100644 --- a/src/Deprecator/Deprecations.js +++ b/src/Deprecator/Deprecations.js @@ -18,5 +18,5 @@ module.exports = [ { optionKey: 'allowClientClassCreation', changeNewDefault: 'false' }, { optionKey: 'allowExpiredAuthDataToken', changeNewDefault: 'false' }, - { optionKey: 'encodePointerInCloudFunction', changeNewDefault: 'true' }, + { optionKey: 'encodeParseObjectInCloudFunction', changeNewDefault: 'true' }, ]; diff --git a/src/Options/Definitions.js b/src/Options/Definitions.js index d514901448..7fa7f10362 100644 --- a/src/Options/Definitions.js +++ b/src/Options/Definitions.js @@ -210,7 +210,7 @@ module.exports.ParseServerOptions = { action: parsers.booleanParser, default: false, }, - encodePointerInCloudFunction: { + encodeParseObjectInCloudFunction: { env: 'PARSE_SERVER_ENCODE_POINTER_IN_CLOUD_FUNCTION', help: 'If set to `true`, a `Parse.Pointer` that is in the payload when calling a Cloud Function will be converted to an instance of a `Parse.Pointer`. If `false`, the object will not be converted and instead be a plain JavaScript object, which contains the raw data of a `Parse.Pointer` but is not an actual instance of a `Parse.Pointer`. Default is `false`.

\u2139\uFE0F The expected behavior would be that the object is converted to an instance of `Parse.Pointer`, so you would normally set this option to `true`. The default is `false` because this is a temporary option that has been introduced to avoid a breaking change when fixing a bug where `Parse.Pointer` objects are not converted to actual instances of `Parse.Pointer`.', diff --git a/src/Options/docs.js b/src/Options/docs.js index 6d24eb6d34..b0a7f24126 100644 --- a/src/Options/docs.js +++ b/src/Options/docs.js @@ -40,7 +40,7 @@ * @property {Number} emailVerifyTokenValidityDuration 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).

Default is `undefined`.
Requires option `verifyUserEmails: true`. * @property {Boolean} enableAnonymousUsers Enable (or disable) anonymous users, defaults to true * @property {Boolean} enableExpressErrorHandler Enables the default express error handler for all errors - * @property {Boolean} encodePointerInCloudFunction If set to `true`, a `Parse.Pointer` that is in the payload when calling a Cloud Function will be converted to an instance of a `Parse.Pointer`. If `false`, the object will not be converted and instead be a plain JavaScript object, which contains the raw data of a `Parse.Pointer` but is not an actual instance of a `Parse.Pointer`. Default is `false`.

ℹ️ The expected behavior would be that the object is converted to an instance of `Parse.Pointer`, so you would normally set this option to `true`. The default is `false` because this is a temporary option that has been introduced to avoid a breaking change when fixing a bug where `Parse.Pointer` objects are not converted to actual instances of `Parse.Pointer`. + * @property {Boolean} encodeParseObjectInCloudFunction If set to `true`, a `Parse.Pointer` that is in the payload when calling a Cloud Function will be converted to an instance of a `Parse.Pointer`. If `false`, the object will not be converted and instead be a plain JavaScript object, which contains the raw data of a `Parse.Pointer` but is not an actual instance of a `Parse.Pointer`. Default is `false`.

ℹ️ The expected behavior would be that the object is converted to an instance of `Parse.Pointer`, so you would normally set this option to `true`. The default is `false` because this is a temporary option that has been introduced to avoid a breaking change when fixing a bug where `Parse.Pointer` objects are not converted to actual instances of `Parse.Pointer`. * @property {String} encryptionKey Key for encrypting your files * @property {Boolean} enforcePrivateUsers Set to true if new users should be created without public read and write access. * @property {Boolean} expireInactiveSessions Sets whether we should expire the inactive sessions, defaults to true. If false, all new sessions are created with no expiration date. diff --git a/src/Options/index.js b/src/Options/index.js index 7f7fea47e7..201a703854 100644 --- a/src/Options/index.js +++ b/src/Options/index.js @@ -204,7 +204,7 @@ export interface ParseServerOptions { emailAdapter: ?Adapter; /* If set to `true`, a `Parse.Pointer` that is in the payload when calling a Cloud Function will be converted to an instance of a `Parse.Pointer`. If `false`, the object will not be converted and instead be a plain JavaScript object, which contains the raw data of a `Parse.Pointer` but is not an actual instance of a `Parse.Pointer`. Default is `false`.

ℹ️ The expected behavior would be that the object is converted to an instance of `Parse.Pointer`, so you would normally set this option to `true`. The default is `false` because this is a temporary option that has been introduced to avoid a breaking change when fixing a bug where `Parse.Pointer` objects are not converted to actual instances of `Parse.Pointer`. :DEFAULT: false */ - encodePointerInCloudFunction: ?boolean; + encodeParseObjectInCloudFunction: ?boolean; /* Public URL to your parse server with http:// or https://. :ENV: PARSE_PUBLIC_SERVER_URL */ publicServerURL: ?string; diff --git a/src/Routers/FunctionsRouter.js b/src/Routers/FunctionsRouter.js index de61893c03..bb4b959ebe 100644 --- a/src/Routers/FunctionsRouter.js +++ b/src/Routers/FunctionsRouter.js @@ -18,7 +18,7 @@ function parseObject(obj, config) { 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' && config.encodeCloudPointers) { + } else if (obj && obj.__type == 'Pointer' && config.encodeParseObjectInCloudFunction) { return Parse.Object.fromJSON({ __type: 'Pointer', className: obj.className, From ffdb88231ba7f31999e273682761a73da5b04603 Mon Sep 17 00:00:00 2001 From: dblythy Date: Fri, 23 Jun 2023 13:13:51 +1000 Subject: [PATCH 07/10] Update Definitions.js --- src/Options/Definitions.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Options/Definitions.js b/src/Options/Definitions.js index 7fa7f10362..96bc368718 100644 --- a/src/Options/Definitions.js +++ b/src/Options/Definitions.js @@ -211,7 +211,7 @@ module.exports.ParseServerOptions = { default: false, }, encodeParseObjectInCloudFunction: { - env: 'PARSE_SERVER_ENCODE_POINTER_IN_CLOUD_FUNCTION', + env: 'PARSE_SERVER_ENCODE_PARSE_OBJECT_IN_CLOUD_FUNCTION', help: 'If set to `true`, a `Parse.Pointer` that is in the payload when calling a Cloud Function will be converted to an instance of a `Parse.Pointer`. If `false`, the object will not be converted and instead be a plain JavaScript object, which contains the raw data of a `Parse.Pointer` but is not an actual instance of a `Parse.Pointer`. Default is `false`.

\u2139\uFE0F The expected behavior would be that the object is converted to an instance of `Parse.Pointer`, so you would normally set this option to `true`. The default is `false` because this is a temporary option that has been introduced to avoid a breaking change when fixing a bug where `Parse.Pointer` objects are not converted to actual instances of `Parse.Pointer`.', action: parsers.booleanParser, From ab87a4925b41288cb4ba5a4f0edcb85cdc01bd2d Mon Sep 17 00:00:00 2001 From: Manuel <5673677+mtrezza@users.noreply.github.com> Date: Fri, 23 Jun 2023 11:49:59 +0200 Subject: [PATCH 08/10] Update DEPRECATIONS.md Signed-off-by: Manuel <5673677+mtrezza@users.noreply.github.com> --- DEPRECATIONS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DEPRECATIONS.md b/DEPRECATIONS.md index 6674c18808..59b728a944 100644 --- a/DEPRECATIONS.md +++ b/DEPRECATIONS.md @@ -13,7 +13,7 @@ The following is a list of deprecations, according to the [Deprecation Policy](h | DEPPS7 | Remove file trigger syntax `Parse.Cloud.beforeSaveFile((request) => {})` | [#7966](https://github.com/parse-community/parse-server/pull/7966) | 5.3.0 (2022) | 7.0.0 (2024) | deprecated | - | | DEPPS8 | Login with expired 3rd party authentication token defaults to `false` | [#7079](https://github.com/parse-community/parse-server/pull/7079) | 5.3.0 (2022) | 7.0.0 (2024) | deprecated | - | | DEPPS9 | Rename LiveQuery `fields` option to `keys` | [#8389](https://github.com/parse-community/parse-server/issues/8389) | 6.0.0 (2023) | 7.0.0 (2024) | deprecated | - | -| DEPPS10 | `encodeParseObjectInCloudFunction` defaults to `true` | [#8634](https://github.com/parse-community/parse-server/issues/8634) | 6.2.0 (2023) | 7.0.0 (2024) | deprecated | - | +| DEPPS10 | Config option `encodeParseObjectInCloudFunction` defaults to `true` | [#8634](https://github.com/parse-community/parse-server/issues/8634) | 6.2.0 (2023) | 7.0.0 (2024) | deprecated | - | [i_deprecation]: ## "The version and date of the deprecation." [i_removal]: ## "The version and date of the planned removal." From 1debec23d337646938cb9e83e1c086c047e31107 Mon Sep 17 00:00:00 2001 From: Manuel <5673677+mtrezza@users.noreply.github.com> Date: Fri, 23 Jun 2023 11:50:13 +0200 Subject: [PATCH 09/10] Update src/Options/index.js Signed-off-by: Manuel <5673677+mtrezza@users.noreply.github.com> --- src/Options/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Options/index.js b/src/Options/index.js index 201a703854..a8414c658c 100644 --- a/src/Options/index.js +++ b/src/Options/index.js @@ -202,7 +202,7 @@ export interface ParseServerOptions { cacheAdapter: ?Adapter; /* Adapter module for email sending */ emailAdapter: ?Adapter; - /* If set to `true`, a `Parse.Pointer` that is in the payload when calling a Cloud Function will be converted to an instance of a `Parse.Pointer`. If `false`, the object will not be converted and instead be a plain JavaScript object, which contains the raw data of a `Parse.Pointer` but is not an actual instance of a `Parse.Pointer`. Default is `false`.

ℹ️ The expected behavior would be that the object is converted to an instance of `Parse.Pointer`, so you would normally set this option to `true`. The default is `false` because this is a temporary option that has been introduced to avoid a breaking change when fixing a bug where `Parse.Pointer` objects are not converted to actual instances of `Parse.Pointer`. + /* If set to `true`, a `Parse.Object` that is in the payload when calling a Cloud Function will be converted to an instance of `Parse.Object`. If `false`, the object will not be converted and instead be a plain JavaScript object, which contains the raw data of a `Parse.Object` but is not an actual instance of `Parse.Object`. Default is `false`.

ℹ️ The expected behavior would be that the object is converted to an instance of `Parse.Object`, so you would normally set this option to `true`. The default is `false` because this is a temporary option that has been introduced to avoid a breaking change when fixing a bug where JavaScript objects are not converted to actual instances of `Parse.Object`. :DEFAULT: false */ encodeParseObjectInCloudFunction: ?boolean; /* Public URL to your parse server with http:// or https://. From 101ff16aa80ef767a02d0d444c7a8ce08b70e83a Mon Sep 17 00:00:00 2001 From: Manuel Trezza <5673677+mtrezza@users.noreply.github.com> Date: Fri, 23 Jun 2023 13:39:53 +0200 Subject: [PATCH 10/10] update defs --- src/Options/Definitions.js | 2 +- src/Options/docs.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Options/Definitions.js b/src/Options/Definitions.js index 96bc368718..6477836eed 100644 --- a/src/Options/Definitions.js +++ b/src/Options/Definitions.js @@ -213,7 +213,7 @@ module.exports.ParseServerOptions = { encodeParseObjectInCloudFunction: { env: 'PARSE_SERVER_ENCODE_PARSE_OBJECT_IN_CLOUD_FUNCTION', help: - 'If set to `true`, a `Parse.Pointer` that is in the payload when calling a Cloud Function will be converted to an instance of a `Parse.Pointer`. If `false`, the object will not be converted and instead be a plain JavaScript object, which contains the raw data of a `Parse.Pointer` but is not an actual instance of a `Parse.Pointer`. Default is `false`.

\u2139\uFE0F The expected behavior would be that the object is converted to an instance of `Parse.Pointer`, so you would normally set this option to `true`. The default is `false` because this is a temporary option that has been introduced to avoid a breaking change when fixing a bug where `Parse.Pointer` objects are not converted to actual instances of `Parse.Pointer`.', + 'If set to `true`, a `Parse.Object` that is in the payload when calling a Cloud Function will be converted to an instance of `Parse.Object`. If `false`, the object will not be converted and instead be a plain JavaScript object, which contains the raw data of a `Parse.Object` but is not an actual instance of `Parse.Object`. Default is `false`.

\u2139\uFE0F The expected behavior would be that the object is converted to an instance of `Parse.Object`, so you would normally set this option to `true`. The default is `false` because this is a temporary option that has been introduced to avoid a breaking change when fixing a bug where JavaScript objects are not converted to actual instances of `Parse.Object`.', action: parsers.booleanParser, default: false, }, diff --git a/src/Options/docs.js b/src/Options/docs.js index b0a7f24126..fdb62bb590 100644 --- a/src/Options/docs.js +++ b/src/Options/docs.js @@ -40,7 +40,7 @@ * @property {Number} emailVerifyTokenValidityDuration 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).

Default is `undefined`.
Requires option `verifyUserEmails: true`. * @property {Boolean} enableAnonymousUsers Enable (or disable) anonymous users, defaults to true * @property {Boolean} enableExpressErrorHandler Enables the default express error handler for all errors - * @property {Boolean} encodeParseObjectInCloudFunction If set to `true`, a `Parse.Pointer` that is in the payload when calling a Cloud Function will be converted to an instance of a `Parse.Pointer`. If `false`, the object will not be converted and instead be a plain JavaScript object, which contains the raw data of a `Parse.Pointer` but is not an actual instance of a `Parse.Pointer`. Default is `false`.

ℹ️ The expected behavior would be that the object is converted to an instance of `Parse.Pointer`, so you would normally set this option to `true`. The default is `false` because this is a temporary option that has been introduced to avoid a breaking change when fixing a bug where `Parse.Pointer` objects are not converted to actual instances of `Parse.Pointer`. + * @property {Boolean} encodeParseObjectInCloudFunction If set to `true`, a `Parse.Object` that is in the payload when calling a Cloud Function will be converted to an instance of `Parse.Object`. If `false`, the object will not be converted and instead be a plain JavaScript object, which contains the raw data of a `Parse.Object` but is not an actual instance of `Parse.Object`. Default is `false`.

ℹ️ The expected behavior would be that the object is converted to an instance of `Parse.Object`, so you would normally set this option to `true`. The default is `false` because this is a temporary option that has been introduced to avoid a breaking change when fixing a bug where JavaScript objects are not converted to actual instances of `Parse.Object`. * @property {String} encryptionKey Key for encrypting your files * @property {Boolean} enforcePrivateUsers Set to true if new users should be created without public read and write access. * @property {Boolean} expireInactiveSessions Sets whether we should expire the inactive sessions, defaults to true. If false, all new sessions are created with no expiration date.