Skip to content

Commit 4b27848

Browse files
authored
Merge branch 'master' into fixSelectExclude
2 parents b829b96 + 70e1347 commit 4b27848

File tree

16 files changed

+321
-33
lines changed

16 files changed

+321
-33
lines changed

.babelrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"presets": [
77
["@babel/preset-env", {
88
"targets": {
9-
"node": "8"
9+
"node": "12"
1010
}
1111
}]
1212
],

.github/workflows/ci.yml

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ on:
88
- '**'
99
env:
1010
COVERAGE_OPTION: ./node_modules/.bin/nyc
11-
NODE_VERSION: 10
11+
NODE_VERSION: 14.16.0
1212
PARSE_SERVER_TEST_TIMEOUT: 20000
1313
jobs:
1414
check-ci:
@@ -82,21 +82,16 @@ jobs:
8282
MONGODB_TOPOLOGY: standalone
8383
MONGODB_STORAGE_ENGINE: wiredTiger
8484
NODE_VERSION: 14.16.0
85-
- name: Node 10
86-
MONGODB_VERSION: 4.4.4
87-
MONGODB_TOPOLOGY: standalone
88-
MONGODB_STORAGE_ENGINE: wiredTiger
89-
NODE_VERSION: 10.24.0
9085
- name: Node 12
9186
MONGODB_VERSION: 4.4.4
9287
MONGODB_TOPOLOGY: standalone
9388
MONGODB_STORAGE_ENGINE: wiredTiger
94-
NODE_VERSION: 12.21.0
89+
NODE_VERSION: 12.22.0
9590
- name: Node 15
9691
MONGODB_VERSION: 4.4.4
9792
MONGODB_TOPOLOGY: standalone
9893
MONGODB_STORAGE_ENGINE: wiredTiger
99-
NODE_VERSION: 15.12.0
94+
NODE_VERSION: 15.13.0
10095
fail-fast: false
10196
name: ${{ matrix.name }}
10297
timeout-minutes: 15

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ ___
9595
- Added Parse Server Security Check to report weak security settings (Manuel Trezza, dblythy) [#7247](https://github.com/parse-community/parse-server/issues/7247)
9696
- EXPERIMENTAL: Added new page router with placeholder rendering and localization of custom and feature pages such as password reset and email verification (Manuel Trezza) [#6891](https://github.com/parse-community/parse-server/issues/6891)
9797
- EXPERIMENTAL: Added custom routes to easily customize flows for password reset, email verification or build entirely new flows (Manuel Trezza) [#7231](https://github.com/parse-community/parse-server/issues/7231)
98+
- Remove support for Node 10 which has reached its End-of-Life support date (Manuel Trezza) [#7314](https://github.com/parse-community/parse-server/pull/7314)
9899
### Other Changes
99100
- Fix error when a not yet inserted job is updated (Antonio Davi Macedo Coelho de Castro) [#7196](https://github.com/parse-community/parse-server/pull/7196)
100101
- request.context for afterFind triggers (dblythy) [#7078](https://github.com/parse-community/parse-server/pull/7078)
@@ -119,6 +120,9 @@ ___
119120
- LDAP: Properly unbind client on group search error (Diamond Lewis) [#7265](https://github.com/parse-community/parse-server/pull/7265)
120121
- Improve data consistency in Push and Job Status update (Diamond Lewis) [#7267](https://github.com/parse-community/parse-server/pull/7267)
121122
- Excluding keys that have trailing edges.node when performing GraphQL resolver (Chris Bland) [#7273](https://github.com/parse-community/parse-server/pull/7273)
123+
- Added centralized feature deprecation with standardized warning logs (Manuel Trezza) [#7303](https://github.com/parse-community/parse-server/pull/7303)
124+
- Use Node.js 15.13.0 in CI (Olle Jonsson) [#7312](https://github.com/parse-community/parse-server/pull/7312)
125+
- Fix file upload issue for S3 compatible storage (Linode, DigitalOcean) by avoiding empty tags property when creating a file (Ali Oguzhan Yildiz) [#7300](https://github.com/parse-community/parse-server/pull/7300)
122126
- Fix select and excludeKey queries to properly accept JSON string arrays. Also allow nested fields in exclude. [#7242](https://github.com/parse-community/parse-server/pull/7242). Thanks to [Corey Baker](https://github.com/cbaker6).
123127

124128
___

README.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
<a href="https://www.npmjs.com/package/parse-server"><img alt="npm version" src="https://img.shields.io/npm/v/parse-server.svg?style=flat"></a>
1818
<a href="https://community.parseplatform.org/"><img alt="Join the conversation" src="https://img.shields.io/discourse/https/community.parseplatform.org/topics.svg"></a>
1919
<a href="https://snyk.io/test/github/parse-community/parse-server"><img alt="Snyk badge" src="https://snyk.io/test/github/parse-community/parse-server/badge.svg"></a>
20-
<a href="https://nodejs.org/"><img alt="Node.js 10,12,14,15" src="https://img.shields.io/badge/nodejs-10,_12,_14,_15-green.svg?logo=node.js&style=flat"></a>
20+
<a href="https://nodejs.org/"><img alt="Node.js 12,14,15" src="https://img.shields.io/badge/nodejs-12,_14,_15-green.svg?logo=node.js&style=flat"></a>
2121
<a href="https://www.mongodb.com/"><img alt="MongoDB 3.6,4.0,4.2,4.4" src="https://img.shields.io/badge/mongodb-3.6,_4.0,_4.2,_4.4-green.svg?logo=mongodb&style=flat"></a>
2222
<a href="https://www.postgresql.org"> <img alt="PostgreSQL 10,11,12,13" src="https://img.shields.io/badge/postgresql-10,_11,_12,_13-green.svg?logo=postgresql&style=flat"></a>
2323
</p>
@@ -112,10 +112,9 @@ Parse Server is continuously tested with the most recent releases of Node.js to
112112

113113
| Version | Latest Patch Version | End-of-Life Date | Compatibility |
114114
|------------|----------------------|------------------|--------------------|
115-
| Node.js 10 | 10.24.0 | April 2021 | ✅ Fully compatible |
116-
| Node.js 12 | 12.21.0 | April 2022 | ✅ Fully compatible |
115+
| Node.js 12 | 12.22.0 | April 2022 | ✅ Fully compatible |
117116
| Node.js 14 | 14.16.0 | April 2023 | ✅ Fully compatible |
118-
| Node.js 15 | 15.12.0 | June 2021 | ✅ Fully compatible |
117+
| Node.js 15 | 15.13.0 | June 2021 | ✅ Fully compatible |
119118

120119
#### MongoDB
121120
Parse Server is continuously tested with the most recent releases of MongoDB to ensure compatibility. We follow the [MongoDB support schedule](https://www.mongodb.com/support-policy) and only test against versions that are officially supported and have not reached their end-of-life date.
@@ -300,7 +299,7 @@ For the full list of available options, run `parse-server --help` or take a look
300299
* `port` - The default port is 1337, specify this parameter to use a different port.
301300
* `serverURL` - URL to your Parse Server (don't forget to specify http:// or https://). This URL will be used when making requests to Parse Server from Cloud Code.
302301
* `cloud` - The absolute path to your cloud code `main.js` file.
303-
* `push` - Configuration options for APNS and GCM push. See the [Push Notifications quick start](http://docs.parseplatform.org/parse-server/guide/#push-notifications_push-notifications-quick-start).
302+
* `push` - Configuration options for APNS and GCM push. See the [Push Notifications quick start](https://docs.parseplatform.org/parse-server/guide/#push-notifications-quick-start).
304303

305304
## Client Key Options
306305

package-lock.json

Lines changed: 9 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,15 +34,15 @@
3434
"cors": "2.8.5",
3535
"deepcopy": "2.1.0",
3636
"express": "4.17.1",
37-
"follow-redirects": "1.13.2",
37+
"follow-redirects": "1.13.3",
3838
"graphql": "15.5.0",
3939
"graphql-list-fields": "2.0.2",
4040
"graphql-relay": "0.6.0",
4141
"graphql-tag": "2.12.1",
4242
"graphql-upload": "11.0.0",
4343
"intersect": "1.0.1",
4444
"jsonwebtoken": "8.5.1",
45-
"jwks-rsa": "1.12.2",
45+
"jwks-rsa": "1.12.3",
4646
"ldapjs": "2.2.4",
4747
"lodash": "4.17.21",
4848
"lru-cache": "5.1.1",
@@ -60,7 +60,7 @@
6060
"uuid": "8.3.2",
6161
"winston": "3.3.3",
6262
"winston-daily-rotate-file": "4.5.0",
63-
"ws": "7.4.3"
63+
"ws": "7.4.4"
6464
},
6565
"devDependencies": {
6666
"@actions/core": "1.2.6",

resources/ci/ciCheck.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,7 @@ async function checkNodeVersions() {
5959
releasedVersions,
6060
latestComponent: CiVersionCheck.versionComponents.minor,
6161
ignoreReleasedVersions: [
62-
'<10.0.0', // These versions have reached their end-of-life support date
63-
'>=11.0.0 <12.0.0', // These versions have reached their end-of-life support date
62+
'<12.0.0', // These versions have reached their end-of-life support date
6463
'>=13.0.0 <14.0.0', // These versions have reached their end-of-life support date
6564
'>=16.0.0', // This version has not been officially released yet
6665
],

spec/Deprecator.spec.js

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
'use strict';
2+
3+
const Deprecator = require('../lib/Deprecator/Deprecator');
4+
5+
describe('Deprecator', () => {
6+
let deprecations = [];
7+
8+
beforeEach(async () => {
9+
deprecations = [{ optionKey: 'exampleKey', changeNewDefault: 'exampleNewDefault' }];
10+
});
11+
12+
it('deprecations are an array', async () => {
13+
expect(Deprecator._getDeprecations()).toBeInstanceOf(Array);
14+
});
15+
16+
it('logs deprecation for new default', async () => {
17+
deprecations = [{ optionKey: 'exampleKey', changeNewDefault: 'exampleNewDefault' }];
18+
19+
spyOn(Deprecator, '_getDeprecations').and.callFake(() => deprecations);
20+
const logger = require('../lib/logger').logger;
21+
const logSpy = spyOn(logger, 'warn').and.callFake(() => {});
22+
23+
await reconfigureServer();
24+
expect(logSpy.calls.all()[0].args[0]).toContain(deprecations[0].optionKey);
25+
expect(logSpy.calls.all()[0].args[0]).toContain(deprecations[0].changeNewDefault);
26+
});
27+
28+
it('does not log deprecation for new default if option is set manually', async () => {
29+
deprecations = [{ optionKey: 'exampleKey', changeNewDefault: 'exampleNewDefault' }];
30+
31+
spyOn(Deprecator, '_getDeprecations').and.callFake(() => deprecations);
32+
const logSpy = spyOn(Deprecator, '_log').and.callFake(() => {});
33+
await reconfigureServer({ [deprecations[0].optionKey]: 'manuallySet' });
34+
expect(logSpy).not.toHaveBeenCalled();
35+
});
36+
});

spec/ParseFile.spec.js

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
'use strict';
55

6+
const { FilesController } = require('../lib/Controllers/FilesController');
67
const request = require('../lib/request');
78

89
const str = 'Hello World!';
@@ -205,6 +206,34 @@ describe('Parse.File testing', () => {
205206
notEqual(file.name(), 'hello.txt');
206207
});
207208

209+
it('saves the file with tags', async () => {
210+
spyOn(FilesController.prototype, 'createFile').and.callThrough();
211+
const file = new Parse.File('hello.txt', data, 'text/plain');
212+
const tags = { hello: 'world' };
213+
file.setTags(tags);
214+
expect(file.url()).toBeUndefined();
215+
const result = await file.save();
216+
expect(file.name()).toBeDefined();
217+
expect(file.url()).toBeDefined();
218+
expect(result.tags()).toEqual(tags);
219+
expect(FilesController.prototype.createFile.calls.argsFor(0)[4]).toEqual({
220+
tags: tags,
221+
metadata: {},
222+
});
223+
});
224+
225+
it('does not pass empty file tags while saving', async () => {
226+
spyOn(FilesController.prototype, 'createFile').and.callThrough();
227+
const file = new Parse.File('hello.txt', data, 'text/plain');
228+
expect(file.url()).toBeUndefined();
229+
expect(file.name()).toBeDefined();
230+
await file.save();
231+
expect(file.url()).toBeDefined();
232+
expect(FilesController.prototype.createFile.calls.argsFor(0)[4]).toEqual({
233+
metadata: {},
234+
});
235+
});
236+
208237
it('save file in object', async done => {
209238
const file = new Parse.File('hello.txt', data, 'text/plain');
210239
ok(!file.url());

spec/ParseGraphQLServer.spec.js

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7083,6 +7083,77 @@ describe('ParseGraphQLServer', () => {
70837083
expect(result.data.resetPassword.clientMutationId).toEqual(clientMutationId);
70847084
expect(result.data.resetPassword.ok).toBeTruthy();
70857085
});
7086+
7087+
it('should reset password', async () => {
7088+
const clientMutationId = uuidv4();
7089+
let resetPasswordToken;
7090+
const emailAdapter = {
7091+
sendVerificationEmail: () => {},
7092+
sendPasswordResetEmail: ({ link }) => {
7093+
resetPasswordToken = link.split('token=')[1].split('&')[0];
7094+
},
7095+
sendMail: () => {},
7096+
};
7097+
parseServer = await global.reconfigureServer({
7098+
appName: 'test',
7099+
emailAdapter: emailAdapter,
7100+
publicServerURL: 'http://localhost:13377/parse',
7101+
auth: {
7102+
myAuth: {
7103+
module: global.mockCustomAuthenticator('parse', 'graphql'),
7104+
},
7105+
},
7106+
});
7107+
const user = new Parse.User();
7108+
user.setUsername('user1');
7109+
user.setPassword('user1');
7110+
user.setEmail('[email protected]');
7111+
await user.signUp();
7112+
await Parse.User.logOut();
7113+
await Parse.User.requestPasswordReset('[email protected]');
7114+
await apolloClient.mutate({
7115+
mutation: gql`
7116+
mutation ConfirmResetPassword($input: ConfirmResetPasswordInput!) {
7117+
confirmResetPassword(input: $input) {
7118+
clientMutationId
7119+
ok
7120+
}
7121+
}
7122+
`,
7123+
variables: {
7124+
input: {
7125+
clientMutationId,
7126+
username: 'user1',
7127+
password: 'newPassword',
7128+
token: resetPasswordToken,
7129+
},
7130+
},
7131+
});
7132+
const result = await apolloClient.mutate({
7133+
mutation: gql`
7134+
mutation LogInUser($input: LogInInput!) {
7135+
logIn(input: $input) {
7136+
clientMutationId
7137+
viewer {
7138+
sessionToken
7139+
}
7140+
}
7141+
}
7142+
`,
7143+
variables: {
7144+
input: {
7145+
clientMutationId,
7146+
username: 'user1',
7147+
password: 'newPassword',
7148+
},
7149+
},
7150+
});
7151+
7152+
expect(result.data.logIn.clientMutationId).toEqual(clientMutationId);
7153+
expect(result.data.logIn.viewer.sessionToken).toBeDefined();
7154+
expect(typeof result.data.logIn.viewer.sessionToken).toBe('string');
7155+
});
7156+
70867157
it('should send verification email again', async () => {
70877158
const clientMutationId = uuidv4();
70887159
const emailAdapter = {

src/Deprecator/Deprecations.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
/**
2+
* The deprecations.
3+
*
4+
* Add deprecations to the array using the following keys:
5+
* - `optionKey`: The option key incl. its path, e.g. `security.enableCheck`.
6+
* - `envKey`: The environment key, e.g. `PARSE_SERVER_SECURITY`.
7+
* - `changeNewKey`: Set the new key name if the current key will be replaced,
8+
* or set to an empty string if the current key will be removed without replacement.
9+
* - `changeNewDefault`: Set the new default value if the key's default value
10+
* will change in a future version.
11+
*
12+
* If there are no deprecations this must return an empty array anyway.
13+
*/
14+
module.exports = [];

0 commit comments

Comments
 (0)