Skip to content

Commit a11f91c

Browse files
authored
Merge branch 'alpha' into remove-mongo-4
2 parents f7ce7cc + ccb1497 commit a11f91c

37 files changed

+2782
-601
lines changed

.babelrc

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

.github/workflows/ci.yml

-8
Original file line numberDiff line numberDiff line change
@@ -142,10 +142,6 @@ jobs:
142142
MONGODB_VERSION: 4.4.13
143143
MONGODB_TOPOLOGY: standalone
144144
NODE_VERSION: 18.1.0
145-
- name: Node 12
146-
MONGODB_VERSION: 4.4.13
147-
MONGODB_TOPOLOGY: standalone
148-
NODE_VERSION: 12.22.11
149145
- name: Node 14
150146
MONGODB_VERSION: 4.4.13
151147
MONGODB_TOPOLOGY: standalone
@@ -154,10 +150,6 @@ jobs:
154150
MONGODB_VERSION: 4.4.13
155151
MONGODB_TOPOLOGY: standalone
156152
NODE_VERSION: 16.14.2
157-
- name: Node 17
158-
MONGODB_VERSION: 4.4.13
159-
MONGODB_TOPOLOGY: standalone
160-
NODE_VERSION: 17.9.0
161153
fail-fast: false
162154
name: ${{ matrix.name }}
163155
timeout-minutes: 15

.github/workflows/release-automated.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
persist-credentials: false
1818
- uses: actions/setup-node@v2
1919
with:
20-
node-version: 14
20+
node-version: 18.1.0
2121
registry-url: https://registry.npmjs.org/
2222
- name: Cache Node.js modules
2323
uses: actions/cache@v2
@@ -93,7 +93,7 @@ jobs:
9393
- name: Use Node.js
9494
uses: actions/setup-node@v1
9595
with:
96-
node-version: 14
96+
node-version: 18.1.0
9797
- name: Cache Node.js modules
9898
uses: actions/cache@v2
9999
with:

DEPRECATIONS.md

+3-2
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,13 @@ The following is a list of deprecations, according to the [Deprecation Policy](h
55
| ID | Change | Issue | Deprecation [ℹ️][i_deprecation] | Planned Removal [ℹ️][i_removal] | Status [ℹ️][i_status] | Notes |
66
|--------|-------------------------------------------------|----------------------------------------------------------------------|---------------------------------|---------------------------------|-----------------------|-------|
77
| 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) | deprecated | - |
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) | deprecated | - |
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 | - |
99
| 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) | deprecated | - |
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) | deprecated | - |
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 | - |
1111
| 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) | deprecated | - |
1212
| DEPPS6 | Auth providers disabled by default | [#7953](https://github.com/parse-community/parse-server/pull/7953) | 5.3.0 (2022) | 7.0.0 (2024) | deprecated | - |
1313
| 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 | - |
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) | deprecated | - |
1415

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

README.md

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
![parse-repository-header-server](https://user-images.githubusercontent.com/5673677/138278489-7d0cebc5-1e31-4d3c-8ffb-53efcda6f29d.png)
22

33
---
4-
4+
55
[![Build Status](https://github.com/parse-community/parse-server/workflows/ci/badge.svg?branch=alpha)](https://github.com/parse-community/parse-server/actions?query=workflow%3Aci+branch%3Aalpha)
6+
[![Build Status](https://github.com/parse-community/parse-server/workflows/ci/badge.svg?branch=beta)](https://github.com/parse-community/parse-server/actions?query=workflow%3Aci+branch%3Abeta)
7+
[![Build Status](https://github.com/parse-community/parse-server/workflows/ci/badge.svg?branch=release)](https://github.com/parse-community/parse-server/actions?query=workflow%3Aci+branch%3Arelease)
68
[![Snyk Badge](https://snyk.io/test/github/parse-community/parse-server/badge.svg)](https://snyk.io/test/github/parse-community/parse-server)
79
[![Coverage](https://img.shields.io/codecov/c/github/parse-community/parse-server/alpha.svg)](https://codecov.io/github/parse-community/parse-server?branch=alpha)
810
[![auto-release](https://img.shields.io/badge/%F0%9F%9A%80-auto--release-9e34eb.svg)](https://github.com/parse-community/parse-dashboard/releases)
911

10-
[![Node Version](https://img.shields.io/badge/nodejs-12,_14,_16,_17,_18-green.svg?logo=node.js&style=flat)](https://nodejs.org)
12+
[![Node Version](https://img.shields.io/badge/nodejs-14,_16,_18-green.svg?logo=node.js&style=flat)](https://nodejs.org)
1113
[![MongoDB Version](https://img.shields.io/badge/mongodb-4.0,_4.2,_4.4,_5,_6-green.svg?logo=mongodb&style=flat)](https://www.mongodb.com)
1214
[![Postgres Version](https://img.shields.io/badge/postgresql-11,_12,_13,_14,_15-green.svg?logo=postgresql&style=flat)](https://www.postgresql.org)
1315

@@ -126,10 +128,8 @@ Parse Server is continuously tested with the most recent releases of Node.js to
126128

127129
| Version | Latest Version | End-of-Life | Compatible |
128130
|------------|----------------|-------------|------------|
129-
| Node.js 12 | 12.22.11 | April 2022 | ✅ Yes |
130131
| Node.js 14 | 14.19.1 | April 2023 | ✅ Yes |
131132
| Node.js 16 | 16.14.2 | April 2024 | ✅ Yes |
132-
| Node.js 17 | 17.9.0 | June 2022 | ✅ Yes |
133133
| Node.js 18 | 18.1.0 | April 2025 | ✅ Yes |
134134

135135
#### MongoDB
@@ -389,7 +389,7 @@ const server = ParseServer({
389389
},
390390

391391
// The password policy
392-
passwordPolicy: {
392+
passwordPolicy: {
393393
// Enforce a password of at least 8 characters which contain at least 1 lower case, 1 upper case and 1 digit
394394
validatorPattern: /^(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.{8,})/,
395395
// Do not allow the username as part of the password
@@ -430,7 +430,7 @@ const api = new ParseServer({
430430
431431
The above route can be invoked by sending a `GET` request to:
432432
`https://[parseServerPublicUrl]/[parseMount]/[pagesEndpoint]/[appId]/[customRoute]`
433-
433+
434434
The `handler` receives the `request` and returns a `custom_page.html` webpage from the `pages.pagesPath` directory as response. The advantage of building a custom route this way is that it automatically makes use of Parse Server's built-in capabilities, such as [page localization](#pages) and [dynamic placeholders](#dynamic-placeholders).
435435
436436
### Reserved Paths
@@ -518,7 +518,7 @@ Parse Server allows developers to choose from several options when hosting files
518518
`GridFSBucketAdapter` is used by default and requires no setup, but if you're interested in using Amazon S3, Google Cloud Storage, or local file storage, additional configuration information is available in the [Parse Server guide](http://docs.parseplatform.org/parse-server/guide/#configuring-file-adapters).
519519
520520
## Idempotency Enforcement
521-
521+
522522
**Caution, this is an experimental feature that may not be appropriate for production.**
523523
524524
This feature deduplicates identical requests that are received by Parse Server multiple times, typically due to network issues or network adapter access restrictions on mobile operating systems.

changelogs/CHANGELOG_alpha.md

+55
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,58 @@
1+
# [6.0.0-alpha.5](https://github.com/parse-community/parse-server/compare/6.0.0-alpha.4...6.0.0-alpha.5) (2022-11-10)
2+
3+
4+
### Bug Fixes
5+
6+
* Throwing error in Cloud Code Triggers `afterLogin`, `afterLogout` crashes server ([#8280](https://github.com/parse-community/parse-server/issues/8280)) ([130d290](https://github.com/parse-community/parse-server/commit/130d29074e3f763460e5685d0b9059e5a333caff))
7+
8+
9+
### BREAKING CHANGES
10+
11+
* Throwing an error in Cloud Code Triggers `afterLogin`, `afterLogout` returns a rejected promise; in previous releases it crashed the server if you did not handle the error on the Node.js process level; consider adapting your code if your app currently handles these errors on the Node.js process level with `process.on('unhandledRejection', ...)` ([130d290](130d290))
12+
13+
# [6.0.0-alpha.4](https://github.com/parse-community/parse-server/compare/6.0.0-alpha.3...6.0.0-alpha.4) (2022-11-10)
14+
15+
16+
### Features
17+
18+
* Remove deprecation `DEPPS2`: Config option `directAccess` defaults to true ([#8284](https://github.com/parse-community/parse-server/issues/8284)) ([f535ee6](https://github.com/parse-community/parse-server/commit/f535ee6ec2abba63f702127258ca49fa5b4e08c9))
19+
20+
21+
### BREAKING CHANGES
22+
23+
* Config option `directAccess` defaults to true; set this to `false` in environments where multiple Parse Server instances run behind a load balancer and Parse requests within the current Node.js environment should be routed via the load balancer and distributed as HTTP requests among all instances via the `serverURL`. ([f535ee6](f535ee6))
24+
25+
# [6.0.0-alpha.3](https://github.com/parse-community/parse-server/compare/6.0.0-alpha.2...6.0.0-alpha.3) (2022-11-10)
26+
27+
28+
### Features
29+
30+
* Remove deprecation `DEPPS4`: Remove convenience method for http request `Parse.Cloud.httpRequest` ([#8287](https://github.com/parse-community/parse-server/issues/8287)) ([2d79c08](https://github.com/parse-community/parse-server/commit/2d79c0835b6a9acaf20d5c943d9b4619bb96831c))
31+
32+
33+
### BREAKING CHANGES
34+
35+
* The convenience method for HTTP requests `Parse.Cloud.httpRequest` is removed; use your preferred 3rd party library for making HTTP requests ([2d79c08](2d79c08))
36+
37+
# [6.0.0-alpha.2](https://github.com/parse-community/parse-server/compare/6.0.0-alpha.1...6.0.0-alpha.2) (2022-11-10)
38+
39+
40+
### Features
41+
42+
* Improve authentication adapter interface to support multi-factor authentication (MFA), authentication challenges, and provide a more powerful interface for writing custom authentication adapters ([#8156](https://github.com/parse-community/parse-server/issues/8156)) ([5bbf9ca](https://github.com/parse-community/parse-server/commit/5bbf9cade9a527787fd1002072d4013ab5d8db2b))
43+
44+
# [6.0.0-alpha.1](https://github.com/parse-community/parse-server/compare/5.4.0-alpha.1...6.0.0-alpha.1) (2022-11-10)
45+
46+
47+
### Bug Fixes
48+
49+
* Remove Node 12 and Node 17 support ([#8279](https://github.com/parse-community/parse-server/issues/8279)) ([2546cc8](https://github.com/parse-community/parse-server/commit/2546cc8572bea6610cb9b3c7401d9afac0e3c1d6))
50+
51+
52+
### BREAKING CHANGES
53+
54+
* This release removes Node 12 and Node 17 support ([2546cc8](2546cc8))
55+
156
# [5.4.0-alpha.1](https://github.com/parse-community/parse-server/compare/5.3.0...5.4.0-alpha.1) (2022-10-31)
257

358

package-lock.json

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "parse-server",
3-
"version": "5.4.0-alpha.1",
3+
"version": "6.0.0-alpha.5",
44
"description": "An express module providing a Parse-compatible API server",
55
"main": "lib/index.js",
66
"repository": {
@@ -133,7 +133,7 @@
133133
"madge:circular": "node_modules/.bin/madge ./src --circular"
134134
},
135135
"engines": {
136-
"node": ">=12.22.10 <19"
136+
"node": ">=14.21.0 <17 || >=18 <19"
137137
},
138138
"bin": {
139139
"parse-server": "bin/parse-server"

spec/.babelrc

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"presets": [
66
["env", {
77
"targets": {
8-
"node": "8"
8+
"node": "14"
99
}
1010
}]
1111
],

spec/AuthenticationAdapters.spec.js

+62-11
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,49 @@ describe('AuthenticationProviders', function () {
256256
.catch(done.fail);
257257
});
258258

259+
it('should support loginWith with session token and with/without mutated authData', async () => {
260+
const fakeAuthProvider = {
261+
validateAppId: () => Promise.resolve(),
262+
validateAuthData: () => Promise.resolve(),
263+
};
264+
const payload = { authData: { id: 'user1', token: 'fakeToken' } };
265+
const payload2 = { authData: { id: 'user1', token: 'fakeToken2' } };
266+
await reconfigureServer({ auth: { fakeAuthProvider } });
267+
const user = await Parse.User.logInWith('fakeAuthProvider', payload);
268+
const user2 = await Parse.User.logInWith('fakeAuthProvider', payload, {
269+
sessionToken: user.getSessionToken(),
270+
});
271+
const user3 = await Parse.User.logInWith('fakeAuthProvider', payload2, {
272+
sessionToken: user2.getSessionToken(),
273+
});
274+
expect(user.id).toEqual(user2.id);
275+
expect(user.id).toEqual(user3.id);
276+
});
277+
278+
it('should support sync/async validateAppId', async () => {
279+
const syncProvider = {
280+
validateAppId: () => true,
281+
appIds: 'test',
282+
validateAuthData: () => Promise.resolve(),
283+
};
284+
const asyncProvider = {
285+
appIds: 'test',
286+
validateAppId: () => Promise.resolve(true),
287+
validateAuthData: () => Promise.resolve(),
288+
};
289+
const payload = { authData: { id: 'user1', token: 'fakeToken' } };
290+
const syncSpy = spyOn(syncProvider, 'validateAppId');
291+
const asyncSpy = spyOn(asyncProvider, 'validateAppId');
292+
293+
await reconfigureServer({ auth: { asyncProvider, syncProvider } });
294+
const user = await Parse.User.logInWith('asyncProvider', payload);
295+
const user2 = await Parse.User.logInWith('syncProvider', payload);
296+
expect(user.getSessionToken()).toBeDefined();
297+
expect(user2.getSessionToken()).toBeDefined();
298+
expect(syncSpy).toHaveBeenCalledTimes(1);
299+
expect(asyncSpy).toHaveBeenCalledTimes(1);
300+
});
301+
259302
it('unlink and link with custom provider', async () => {
260303
const provider = getMockMyOauthProvider();
261304
Parse.User._registerAuthenticationProvider(provider);
@@ -339,10 +382,10 @@ describe('AuthenticationProviders', function () {
339382
});
340383

341384
validateAuthenticationHandler(authenticationHandler);
342-
const validator = authenticationHandler.getValidatorForProvider('customAuthentication');
385+
const { validator } = authenticationHandler.getValidatorForProvider('customAuthentication');
343386
validateValidator(validator);
344387

345-
validator(validAuthData).then(
388+
validator(validAuthData, {}, {}).then(
346389
() => {
347390
expect(authDataSpy).toHaveBeenCalled();
348391
// AppIds are not provided in the adapter, should not be called
@@ -362,12 +405,15 @@ describe('AuthenticationProviders', function () {
362405
});
363406

364407
validateAuthenticationHandler(authenticationHandler);
365-
const validator = authenticationHandler.getValidatorForProvider('customAuthentication');
408+
const { validator } = authenticationHandler.getValidatorForProvider('customAuthentication');
366409
validateValidator(validator);
367-
368-
validator({
369-
token: 'my-token',
370-
}).then(
410+
validator(
411+
{
412+
token: 'my-token',
413+
},
414+
{},
415+
{}
416+
).then(
371417
() => {
372418
done();
373419
},
@@ -387,12 +433,16 @@ describe('AuthenticationProviders', function () {
387433
});
388434

389435
validateAuthenticationHandler(authenticationHandler);
390-
const validator = authenticationHandler.getValidatorForProvider('customAuthentication');
436+
const { validator } = authenticationHandler.getValidatorForProvider('customAuthentication');
391437
validateValidator(validator);
392438

393-
validator({
394-
token: 'valid-token',
395-
}).then(
439+
validator(
440+
{
441+
token: 'valid-token',
442+
},
443+
{},
444+
{}
445+
).then(
396446
() => {
397447
done();
398448
},
@@ -541,6 +591,7 @@ describe('AuthenticationProviders', function () {
541591
});
542592

543593
it('can depreciate', async () => {
594+
await reconfigureServer();
544595
const Deprecator = require('../lib/Deprecator/Deprecator');
545596
const spy = spyOn(Deprecator, 'logRuntimeDeprecation').and.callFake(() => {});
546597
const provider = getMockMyOauthProvider();

0 commit comments

Comments
 (0)