Skip to content

Commit 4386152

Browse files
authored
Merge branch 'alpha' into forgotPassword
2 parents ed15b95 + 0eac5dc commit 4386152

20 files changed

+238
-307
lines changed

.github/workflows/ci.yml

Lines changed: 20 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
name: ci
22
on:
33
push:
4-
branches: [ release, alpha, beta ]
4+
branches: [ release*, alpha, beta ]
55
pull_request:
6-
branches: [ release, alpha, beta ]
6+
branches: [ release*, alpha, beta ]
77
env:
8-
NODE_VERSION: 18.12.1
8+
NODE_VERSION: 19.3.0
99
PARSE_SERVER_TEST_TIMEOUT: 20000
1010
jobs:
1111
check-code-analysis:
@@ -145,24 +145,24 @@ jobs:
145145
- name: MongoDB 4.2, ReplicaSet
146146
MONGODB_VERSION: 4.2.19
147147
MONGODB_TOPOLOGY: replicaset
148-
NODE_VERSION: 18.12.1
148+
NODE_VERSION: 19.3.0
149149
- name: MongoDB 4.4, ReplicaSet
150150
MONGODB_VERSION: 4.4.13
151151
MONGODB_TOPOLOGY: replicaset
152-
NODE_VERSION: 18.12.1
152+
NODE_VERSION: 19.3.0
153153
- name: MongoDB 5, ReplicaSet
154154
MONGODB_VERSION: 5.3.2
155155
MONGODB_TOPOLOGY: replicaset
156-
NODE_VERSION: 18.12.1
156+
NODE_VERSION: 19.3.0
157157
- name: MongoDB 6, ReplicaSet
158158
MONGODB_VERSION: 6.0.2
159159
MONGODB_TOPOLOGY: replicaset
160-
NODE_VERSION: 18.12.1
160+
NODE_VERSION: 19.3.0
161161
- name: Redis Cache
162162
PARSE_SERVER_TEST_CACHE: redis
163163
MONGODB_VERSION: 4.4.13
164164
MONGODB_TOPOLOGY: standalone
165-
NODE_VERSION: 18.12.1
165+
NODE_VERSION: 19.3.0
166166
- name: Node 14
167167
MONGODB_VERSION: 4.4.13
168168
MONGODB_TOPOLOGY: standalone
@@ -171,6 +171,10 @@ jobs:
171171
MONGODB_VERSION: 4.4.13
172172
MONGODB_TOPOLOGY: standalone
173173
NODE_VERSION: 16.18.1
174+
- name: Node 18
175+
MONGODB_VERSION: 4.4.13
176+
MONGODB_TOPOLOGY: standalone
177+
NODE_VERSION: 18.12.1
174178
fail-fast: false
175179
name: ${{ matrix.name }}
176180
timeout-minutes: 15
@@ -214,28 +218,28 @@ jobs:
214218
include:
215219
- name: PostgreSQL 11, PostGIS 3.0
216220
POSTGRES_IMAGE: postgis/postgis:11-3.0
217-
NODE_VERSION: 18.12.1
221+
NODE_VERSION: 19.3.0
218222
- name: PostgreSQL 11, PostGIS 3.1
219223
POSTGRES_IMAGE: postgis/postgis:11-3.1
220-
NODE_VERSION: 18.12.1
224+
NODE_VERSION: 19.3.0
221225
- name: PostgreSQL 11, PostGIS 3.2
222226
POSTGRES_IMAGE: postgis/postgis:11-3.2
223-
NODE_VERSION: 18.12.1
227+
NODE_VERSION: 19.3.0
224228
- name: PostgreSQL 11, PostGIS 3.3
225229
POSTGRES_IMAGE: postgis/postgis:11-3.3
226-
NODE_VERSION: 18.12.1
230+
NODE_VERSION: 19.3.0
227231
- name: PostgreSQL 12, PostGIS 3.3
228232
POSTGRES_IMAGE: postgis/postgis:12-3.3
229-
NODE_VERSION: 18.12.1
233+
NODE_VERSION: 19.3.0
230234
- name: PostgreSQL 13, PostGIS 3.3
231235
POSTGRES_IMAGE: postgis/postgis:13-3.3
232-
NODE_VERSION: 18.12.1
236+
NODE_VERSION: 19.3.0
233237
- name: PostgreSQL 14, PostGIS 3.3
234238
POSTGRES_IMAGE: postgis/postgis:14-3.3
235-
NODE_VERSION: 18.12.1
239+
NODE_VERSION: 19.3.0
236240
- name: PostgreSQL 15, PostGIS 3.3
237241
POSTGRES_IMAGE: postgis/postgis:15-3.3
238-
NODE_VERSION: 18.12.1
242+
NODE_VERSION: 19.3.0
239243
fail-fast: false
240244
name: ${{ matrix.name }}
241245
timeout-minutes: 15

DEPRECATIONS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ The following is a list of deprecations, according to the [Deprecation Policy](h
44

55
| ID | Change | Issue | Deprecation [ℹ️][i_deprecation] | Planned Removal [ℹ️][i_removal] | Status [ℹ️][i_status] | Notes |
66
|--------|-------------------------------------------------|----------------------------------------------------------------------|---------------------------------|---------------------------------|-----------------------|-------|
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) | deprecated | - |
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 | - |
88
| 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) | removed | - |
1010
| 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 | - |

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,8 @@ Parse Server is continuously tested with the most recent releases of Node.js to
132132
|------------|----------------|-------------|------------|
133133
| Node.js 14 | 14.19.1 | April 2023 | ✅ Yes |
134134
| Node.js 16 | 16.14.2 | April 2024 | ✅ Yes |
135-
| Node.js 18 | 18.1.0 | April 2025 | ✅ Yes |
135+
| Node.js 18 | 18.12.1 | April 2025 | ✅ Yes |
136+
| Node.js 19 | 19.3.0 | June 2023 | ✅ Yes |
136137

137138
#### MongoDB
138139

changelogs/CHANGELOG_alpha.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,34 @@
1+
# [6.0.0-alpha.20](https://github.com/parse-community/parse-server/compare/6.0.0-alpha.19...6.0.0-alpha.20) (2023-01-06)
2+
3+
4+
### Features
5+
6+
* Add Node 19 support ([#8363](https://github.com/parse-community/parse-server/issues/8363)) ([a4990dc](https://github.com/parse-community/parse-server/commit/a4990dcd29abcb4442f3c424aff482a0a116160f))
7+
8+
# [6.0.0-alpha.19](https://github.com/parse-community/parse-server/compare/6.0.0-alpha.18...6.0.0-alpha.19) (2023-01-05)
9+
10+
11+
### Features
12+
13+
* Remove deprecation `DEPPS1`: Native MongoDB syntax in aggregation pipeline ([#8362](https://github.com/parse-community/parse-server/issues/8362)) ([d0d30c4](https://github.com/parse-community/parse-server/commit/d0d30c4f1394f563724644a8fc81734be538a2c0))
14+
15+
16+
### BREAKING CHANGES
17+
18+
* The MongoDB aggregation pipeline requires native MongoDB syntax instead of the custom Parse Server syntax; for example pipeline stage names require a leading dollar sign like `$match` and the MongoDB document ID is referenced using `_id` instead of `objectId` (#8362) ([d0d30c4](d0d30c4))
19+
20+
# [6.0.0-alpha.18](https://github.com/parse-community/parse-server/compare/6.0.0-alpha.17...6.0.0-alpha.18) (2023-01-05)
21+
22+
23+
### Bug Fixes
24+
25+
* The client IP address may be determined incorrectly in some cases; this fixes a security vulnerability in which the Parse Server option `masterKeyIps` may be circumvented, see [GHSA-vm5r-c87r-pf6x](https://github.com/parse-community/parse-server/security/advisories/GHSA-vm5r-c87r-pf6x) ([#8372](https://github.com/parse-community/parse-server/issues/8372)) ([892040d](https://github.com/parse-community/parse-server/commit/892040dc2f82a3e2abe2824e4b553521b6f894de))
26+
27+
28+
### BREAKING CHANGES
29+
30+
* The mechanism to determine the client IP address has been rewritten; to correctly determine the IP address it is now required to set the Parse Server option `trustProxy` accordingly if Parse Server runs behind a proxy server, see the express framework's [trust proxy](https://expressjs.com/en/guide/behind-proxies.html) setting (#8372) ([892040d](892040d))
31+
132
# [6.0.0-alpha.17](https://github.com/parse-community/parse-server/compare/6.0.0-alpha.16...6.0.0-alpha.17) (2022-12-22)
233

334

package-lock.json

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

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "parse-server",
3-
"version": "6.0.0-alpha.17",
3+
"version": "6.0.0-alpha.20",
44
"description": "An express module providing a Parse-compatible API server",
55
"main": "lib/index.js",
66
"repository": {

spec/AggregateRouter.spec.js

Lines changed: 42 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,31 @@
11
const AggregateRouter = require('../lib/Routers/AggregateRouter').AggregateRouter;
22

33
describe('AggregateRouter', () => {
4-
// TODO: update pipeline syntax. See [#7339](https://bit.ly/3incnWx)
54
it('get pipeline from Array', () => {
65
const body = [
76
{
8-
group: { objectId: {} },
7+
$group: { _id: {} },
98
},
109
];
1110
const expected = [{ $group: { _id: {} } }];
1211
const result = AggregateRouter.getPipeline(body);
1312
expect(result).toEqual(expected);
1413
});
1514

16-
// TODO: update pipeline syntax. See [#7339](https://bit.ly/3incnWx)
1715
it('get pipeline from Object', () => {
1816
const body = {
19-
group: { objectId: {} },
17+
$group: { _id: {} },
2018
};
2119
const expected = [{ $group: { _id: {} } }];
2220
const result = AggregateRouter.getPipeline(body);
2321
expect(result).toEqual(expected);
2422
});
2523

26-
// TODO: update pipeline syntax. See [#7339](https://bit.ly/3incnWx)
2724
it('get pipeline from Pipeline Operator (Array)', () => {
2825
const body = {
2926
pipeline: [
3027
{
31-
group: { objectId: {} },
28+
$group: { _id: {} },
3229
},
3330
],
3431
};
@@ -37,55 +34,53 @@ describe('AggregateRouter', () => {
3734
expect(result).toEqual(expected);
3835
});
3936

40-
// TODO: update pipeline syntax. See [#7339](https://bit.ly/3incnWx)
4137
it('get pipeline from Pipeline Operator (Object)', () => {
4238
const body = {
4339
pipeline: {
44-
group: { objectId: {} },
40+
$group: { _id: {} },
4541
},
4642
};
4743
const expected = [{ $group: { _id: {} } }];
4844
const result = AggregateRouter.getPipeline(body);
4945
expect(result).toEqual(expected);
5046
});
5147

52-
// TODO: update pipeline syntax. See [#7339](https://bit.ly/3incnWx)
5348
it('get pipeline fails multiple keys in Array stage ', () => {
5449
const body = [
5550
{
56-
group: { objectId: {} },
57-
match: { name: 'Test' },
51+
$group: { _id: {} },
52+
$match: { name: 'Test' },
5853
},
5954
];
60-
try {
61-
AggregateRouter.getPipeline(body);
62-
} catch (e) {
63-
expect(e.message).toBe('Pipeline stages should only have one key found group, match');
64-
}
55+
expect(() => AggregateRouter.getPipeline(body)).toThrow(
56+
new Parse.Error(
57+
Parse.Error.INVALID_QUERY,
58+
'Pipeline stages should only have one key but found $group, $match.'
59+
)
60+
);
6561
});
6662

67-
// TODO: update pipeline syntax. See [#7339](https://bit.ly/3incnWx)
6863
it('get pipeline fails multiple keys in Pipeline Operator Array stage ', () => {
6964
const body = {
7065
pipeline: [
7166
{
72-
group: { objectId: {} },
73-
match: { name: 'Test' },
67+
$group: { _id: {} },
68+
$match: { name: 'Test' },
7469
},
7570
],
7671
};
77-
try {
78-
AggregateRouter.getPipeline(body);
79-
} catch (e) {
80-
expect(e.message).toBe('Pipeline stages should only have one key found group, match');
81-
}
72+
expect(() => AggregateRouter.getPipeline(body)).toThrow(
73+
new Parse.Error(
74+
Parse.Error.INVALID_QUERY,
75+
'Pipeline stages should only have one key but found $group, $match.'
76+
)
77+
);
8278
});
8379

84-
// TODO: update pipeline syntax. See [#7339](https://bit.ly/3incnWx)
8580
it('get search pipeline from Pipeline Operator (Array)', () => {
8681
const body = {
8782
pipeline: {
88-
search: {},
83+
$search: {},
8984
},
9085
};
9186
const expected = [{ $search: {} }];
@@ -105,7 +100,7 @@ describe('AggregateRouter', () => {
105100
it('support nested stage names starting with `$`', () => {
106101
const body = [
107102
{
108-
lookup: {
103+
$lookup: {
109104
from: 'ACollection',
110105
let: { id: '_id' },
111106
as: 'results',
@@ -145,11 +140,11 @@ describe('AggregateRouter', () => {
145140

146141
it('support the use of `_id` in stages', () => {
147142
const body = [
148-
{ match: { _id: 'randomId' } },
149-
{ sort: { _id: -1 } },
150-
{ addFields: { _id: 1 } },
151-
{ group: { _id: {} } },
152-
{ project: { _id: 0 } },
143+
{ $match: { _id: 'randomId' } },
144+
{ $sort: { _id: -1 } },
145+
{ $addFields: { _id: 1 } },
146+
{ $group: { _id: {} } },
147+
{ $project: { _id: 0 } },
153148
];
154149
const expected = [
155150
{ $match: { _id: 'randomId' } },
@@ -161,4 +156,19 @@ describe('AggregateRouter', () => {
161156
const result = AggregateRouter.getPipeline(body);
162157
expect(result).toEqual(expected);
163158
});
159+
160+
it('should throw with invalid stage', () => {
161+
expect(() => AggregateRouter.getPipeline([{ foo: 'bar' }])).toThrow(
162+
new Parse.Error(Parse.Error.INVALID_QUERY, `Invalid aggregate stage 'foo'.`)
163+
);
164+
});
165+
166+
it('should throw with invalid group', () => {
167+
expect(() => AggregateRouter.getPipeline([{ $group: { objectId: 'bar' } }])).toThrow(
168+
new Parse.Error(
169+
Parse.Error.INVALID_QUERY,
170+
`Cannot use 'objectId' in aggregation stage $group.`
171+
)
172+
);
173+
});
164174
});

0 commit comments

Comments
 (0)