Skip to content

Commit 7ca29fc

Browse files
committed
deprecatioin
1 parent 20a58fd commit 7ca29fc

File tree

4 files changed

+31
-25
lines changed

4 files changed

+31
-25
lines changed

DEPRECATIONS.md

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,20 @@
22

33
The following is a list of deprecations, according to the [Deprecation Policy](https://github.com/parse-community/parse-server/blob/master/CONTRIBUTING.md#deprecation-policy). After a feature becomes deprecated, and giving developers time to adapt to the change, the deprecated feature will eventually be removed, leading to a breaking change. Developer feedback during the deprecation period may postpone or even revoke the introduction of the breaking change.
44

5-
| ID | Change | Issue | Deprecation [ℹ️][i_deprecation] | Planned Removal [ℹ️][i_removal] | Status [ℹ️][i_status] | Notes |
6-
|--------|-------------------------------------------------|----------------------------------------------------------------------|---------------------------------|---------------------------------|-----------------------|-------|
7-
| DEPPS1 | Native MongoDB syntax in aggregation pipeline | [#7338](https://github.com/parse-community/parse-server/issues/7338) | 5.0.0 (2022) | 6.0.0 (2023) | removed | - |
8-
| DEPPS2 | Config option `directAccess` defaults to `true` | [#6636](https://github.com/parse-community/parse-server/pull/6636) | 5.0.0 (2022) | 6.0.0 (2023) | removed | - |
9-
| DEPPS3 | Config option `enforcePrivateUsers` defaults to `true` | [#7319](https://github.com/parse-community/parse-server/pull/7319) | 5.0.0 (2022) | 6.0.0 (2023) | removed | - |
10-
| DEPPS4 | Remove convenience method for http request `Parse.Cloud.httpRequest` | [#7589](https://github.com/parse-community/parse-server/pull/7589) | 5.0.0 (2022) | 6.0.0 (2023) | removed | - |
11-
| DEPPS5 | Config option `allowClientClassCreation` defaults to `false` | [#7925](https://github.com/parse-community/parse-server/pull/7925) | 5.3.0 (2022) | 7.0.0 (2024) | removed | - |
12-
| DEPPS6 | Auth providers disabled by default | [#7953](https://github.com/parse-community/parse-server/pull/7953) | 5.3.0 (2022) | 7.0.0 (2024) | removed | - |
13-
| 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) | removed | - |
14-
| 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) | removed | - |
15-
| 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) | removed | - |
16-
| DEPPS10 | Encode `Parse.Object` in Cloud Function and remove option `encodeParseObjectInCloudFunction` | [#8634](https://github.com/parse-community/parse-server/issues/8634) | 6.2.0 (2023) | 9.0.0 (2026) | deprecated | - |
17-
| DEPPS11 | Replace `PublicAPIRouter` with `PagesRouter` | [#7625](https://github.com/parse-community/parse-server/issues/7625) | 8.0.0 (2025) | 9.0.0 (2026) | deprecated | - |
5+
| ID | Change | Issue | Deprecation [ℹ️][i_deprecation] | Planned Removal [ℹ️][i_removal] | Status [ℹ️][i_status] | Notes |
6+
|---------|----------------------------------------------------------------------------------------------|----------------------------------------------------------------------|---------------------------------|---------------------------------|-----------------------|-------|
7+
| DEPPS1 | Native MongoDB syntax in aggregation pipeline | [#7338](https://github.com/parse-community/parse-server/issues/7338) | 5.0.0 (2022) | 6.0.0 (2023) | removed | - |
8+
| DEPPS2 | Config option `directAccess` defaults to `true` | [#6636](https://github.com/parse-community/parse-server/pull/6636) | 5.0.0 (2022) | 6.0.0 (2023) | removed | - |
9+
| DEPPS3 | Config option `enforcePrivateUsers` defaults to `true` | [#7319](https://github.com/parse-community/parse-server/pull/7319) | 5.0.0 (2022) | 6.0.0 (2023) | removed | - |
10+
| DEPPS4 | Remove convenience method for http request `Parse.Cloud.httpRequest` | [#7589](https://github.com/parse-community/parse-server/pull/7589) | 5.0.0 (2022) | 6.0.0 (2023) | removed | - |
11+
| DEPPS5 | Config option `allowClientClassCreation` defaults to `false` | [#7925](https://github.com/parse-community/parse-server/pull/7925) | 5.3.0 (2022) | 7.0.0 (2024) | removed | - |
12+
| DEPPS6 | Auth providers disabled by default | [#7953](https://github.com/parse-community/parse-server/pull/7953) | 5.3.0 (2022) | 7.0.0 (2024) | removed | - |
13+
| 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) | removed | - |
14+
| 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) | removed | - |
15+
| 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) | removed | - |
16+
| DEPPS10 | Encode `Parse.Object` in Cloud Function and remove option `encodeParseObjectInCloudFunction` | [#8634](https://github.com/parse-community/parse-server/issues/8634) | 6.2.0 (2023) | 9.0.0 (2026) | deprecated | - |
17+
| DEPPS11 | Replace `PublicAPIRouter` with `PagesRouter` | [#7625](https://github.com/parse-community/parse-server/issues/7625) | 8.0.0 (2025) | 9.0.0 (2026) | deprecated | - |
18+
| DEPPS12 | Database option `allowPublicExplain` will default to `true` | [#7519](https://github.com/parse-community/parse-server/issues/7519) | 8.5.0 (2025) | 9.0.0 (2026) | deprecated | - |
1819

1920
[i_deprecation]: ## "The version and date of the deprecation."
2021
[i_removal]: ## "The version and date of the planned removal."

spec/ParseQuery.spec.js

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ const Parse = require('parse/node');
88
const request = require('../lib/request');
99
const ParseServerRESTController = require('../lib/ParseServerRESTController').ParseServerRESTController;
1010
const ParseServer = require('../lib/ParseServer').default;
11+
const Deprecator = require('../lib/Deprecator/Deprecator').default;
1112

1213
const masterKeyHeaders = {
1314
'X-Parse-Application-Id': 'test',
@@ -5447,34 +5448,38 @@ describe('Parse.Query testing', () => {
54475448
);
54485449

54495450
it_id('c3d4e5f6-a7b8-4c9d-0e1f-2a3b4c5d6e7f')(it_only_db('mongo'))(
5450-
'explain works only with master key by default',
5451+
'explain works with and without master key by default',
54515452
async () => {
5453+
const logger = require('../lib/logger').logger;
5454+
const logSpy = spyOn(logger, 'warn').and.callFake(() => {});
5455+
54525456
await reconfigureServer({
54535457
databaseAdapter: undefined,
54545458
databaseURI: 'mongodb://localhost:27017/parse',
54555459
databaseOptions: {
5456-
allowPublicExplain: false,
5460+
allowPublicExplain: undefined,
54575461
},
54585462
});
54595463

5464+
// Verify deprecation warning is logged when allowPublicExplain is not explicitly set
5465+
expect(logSpy).toHaveBeenCalledWith(
5466+
jasmine.stringMatching(/DeprecationWarning.*databaseOptions\.allowPublicExplain.*false/)
5467+
);
5468+
54605469
const obj = new TestObject({ foo: 'bar' });
54615470
await obj.save();
54625471

54635472
// Without master key
54645473
const query = new Parse.Query(TestObject);
54655474
query.explain();
5466-
await expectAsync(query.find()).toBeRejectedWith(
5467-
new Parse.Error(
5468-
Parse.Error.INVALID_QUERY,
5469-
'Using the explain query parameter requires the master key'
5470-
)
5471-
);
5475+
const resultWithoutMasterKey = await query.find();
5476+
expect(resultWithoutMasterKey).toBeDefined();
54725477

54735478
// With master key
54745479
const queryWithMasterKey = new Parse.Query(TestObject);
54755480
queryWithMasterKey.explain();
5476-
const result = await queryWithMasterKey.find({ useMasterKey: true });
5477-
expect(result).toBeDefined();
5481+
const resultWithMasterKey = await queryWithMasterKey.find({ useMasterKey: true });
5482+
expect(resultWithMasterKey).toBeDefined();
54785483
}
54795484
);
54805485
});

src/Options/Definitions.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1142,7 +1142,7 @@ module.exports.DatabaseOptions = {
11421142
help:
11431143
'Set to `true` to allow `Parse.Query.explain` without master key.<br><br>\u26A0\uFE0F Enabling this option may expose sensitive query performance data to unauthorized users and could potentially be exploited for malicious purposes.',
11441144
action: parsers.booleanParser,
1145-
default: false,
1145+
default: true,
11461146
},
11471147
appName: {
11481148
env: 'PARSE_SERVER_DATABASE_APP_NAME',

src/Options/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -752,7 +752,7 @@ export interface DatabaseOptions {
752752
/* Set to `true` to disable validation of index fields. When disabled, indexes can be created even if the fields do not exist in the schema. This can be useful when creating indexes on fields that will be added later. */
753753
disableIndexFieldValidation: ?boolean;
754754
/* Set to `true` to allow `Parse.Query.explain` without master key.<br><br>⚠️ Enabling this option may expose sensitive query performance data to unauthorized users and could potentially be exploited for malicious purposes.
755-
:DEFAULT: false */
755+
:DEFAULT: true */
756756
allowPublicExplain: ?boolean;
757757
/* An array of MongoDB client event configurations to enable logging of specific events. */
758758
logClientEvents: ?(LogClientEvent[]);

0 commit comments

Comments
 (0)