Skip to content

Commit 9b777e6

Browse files
authored
Merge branch 'alpha' into specify-createdat
2 parents 4f9f1f8 + 9b9c3a4 commit 9b777e6

22 files changed

+678
-251
lines changed

changelogs/CHANGELOG_alpha.md

+27
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,30 @@
1+
# [6.4.0-alpha.3](https://github.com/parse-community/parse-server/compare/6.4.0-alpha.2...6.4.0-alpha.3) (2023-09-23)
2+
3+
4+
### Bug Fixes
5+
6+
* Parse Server option `fileUpload.fileExtensions` fails to determine file extension if filename contains multiple dots ([#8754](https://github.com/parse-community/parse-server/issues/8754)) ([3d6d50e](https://github.com/parse-community/parse-server/commit/3d6d50e0afff18b95fb906914e2cebd3839b517a))
7+
8+
# [6.4.0-alpha.2](https://github.com/parse-community/parse-server/compare/6.4.0-alpha.1...6.4.0-alpha.2) (2023-09-22)
9+
10+
11+
### Bug Fixes
12+
13+
* Security upgrade graphql from 16.6.0 to 16.8.1 ([#8758](https://github.com/parse-community/parse-server/issues/8758)) ([71dfd8a](https://github.com/parse-community/parse-server/commit/71dfd8a7ece8c0dd1a66d03bb9420cfd39f4f9b1))
14+
15+
# [6.4.0-alpha.1](https://github.com/parse-community/parse-server/compare/6.3.0...6.4.0-alpha.1) (2023-09-20)
16+
17+
### Features
18+
19+
* Add context to Cloud Code Triggers `beforeLogin` and `afterLogin` ([#8724](https://github.com/parse-community/parse-server/issues/8724)) ([a9c34ef](https://github.com/parse-community/parse-server/commit/a9c34ef1e2c78a42fb8b5fa8d569b7677c74919d))
20+
21+
# [6.3.0-alpha.9](https://github.com/parse-community/parse-server/compare/6.3.0-alpha.8...6.3.0-alpha.9) (2023-09-13)
22+
23+
24+
### Performance Improvements
25+
26+
* Improve performance of recursive pointer iterations ([#8741](https://github.com/parse-community/parse-server/issues/8741)) ([45a3ed0](https://github.com/parse-community/parse-server/commit/45a3ed0fcf2c0170607505a1550fb15896e705fd))
27+
128
# [6.3.0-alpha.8](https://github.com/parse-community/parse-server/compare/6.3.0-alpha.7...6.3.0-alpha.8) (2023-08-30)
229

330

changelogs/CHANGELOG_beta.md

+20
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,23 @@
1+
# [6.4.0-beta.1](https://github.com/parse-community/parse-server/compare/6.3.0...6.4.0-beta.1) (2023-09-16)
2+
3+
4+
### Bug Fixes
5+
6+
* Parse Server option `fileUpload.fileExtensions` does not work with an array of extensions ([#8688](https://github.com/parse-community/parse-server/issues/8688)) ([6a4a00c](https://github.com/parse-community/parse-server/commit/6a4a00ca7af1163ea74b047b85cd6817366b824b))
7+
* Redis 4 does not reconnect after unhandled error ([#8706](https://github.com/parse-community/parse-server/issues/8706)) ([2b3d4e5](https://github.com/parse-community/parse-server/commit/2b3d4e5d3c85cd142f85af68dec51a8523548d49))
8+
* Remove config logging when launching Parse Server via CLI ([#8710](https://github.com/parse-community/parse-server/issues/8710)) ([ae68f0c](https://github.com/parse-community/parse-server/commit/ae68f0c31b741eeb83379c905c7ddfaa124436ec))
9+
* Server does not start via CLI when `auth` option is set ([#8666](https://github.com/parse-community/parse-server/issues/8666)) ([4e2000b](https://github.com/parse-community/parse-server/commit/4e2000bc563324389584ace3c090a5c1a7796a64))
10+
11+
### Features
12+
13+
* Add conditional email verification via dynamic Parse Server options `verifyUserEmails`, `sendUserEmailVerification` that now accept functions ([#8425](https://github.com/parse-community/parse-server/issues/8425)) ([44acd6d](https://github.com/parse-community/parse-server/commit/44acd6d9ed157ad4842200c9d01f9c77a05fec3a))
14+
* Add property `Parse.Server.version` to determine current version of Parse Server in Cloud Code ([#8670](https://github.com/parse-community/parse-server/issues/8670)) ([a9d376b](https://github.com/parse-community/parse-server/commit/a9d376b61f5b07806eafbda91c4e36c322f09298))
15+
* Add TOTP authentication adapter ([#8457](https://github.com/parse-community/parse-server/issues/8457)) ([cc079a4](https://github.com/parse-community/parse-server/commit/cc079a40f6849a0e9bc6fdc811e8649ecb67b589))
16+
17+
### Performance Improvements
18+
19+
* Improve performance of recursive pointer iterations ([#8741](https://github.com/parse-community/parse-server/issues/8741)) ([45a3ed0](https://github.com/parse-community/parse-server/commit/45a3ed0fcf2c0170607505a1550fb15896e705fd))
20+
121
# [6.3.0-beta.1](https://github.com/parse-community/parse-server/compare/6.2.0...6.3.0-beta.1) (2023-06-10)
222

323

changelogs/CHANGELOG_release.md

+39
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,42 @@
1+
# [6.3.0](https://github.com/parse-community/parse-server/compare/6.2.2...6.3.0) (2023-09-16)
2+
3+
4+
### Bug Fixes
5+
6+
* Cloud Code Trigger `afterSave` executes even if not set ([#8520](https://github.com/parse-community/parse-server/issues/8520)) ([afd0515](https://github.com/parse-community/parse-server/commit/afd0515e207bd947840579d3f245980dffa6f804))
7+
* GridFS file storage doesn't work with certain `enableSchemaHooks` settings ([#8467](https://github.com/parse-community/parse-server/issues/8467)) ([d4cda4b](https://github.com/parse-community/parse-server/commit/d4cda4b26c9bde8c812549b8780bea1cfabdb394))
8+
* Inaccurate table total row count for PostgreSQL ([#8511](https://github.com/parse-community/parse-server/issues/8511)) ([0823a02](https://github.com/parse-community/parse-server/commit/0823a02fbf80bc88dc403bc47e9f5c6597ea78b4))
9+
* LiveQuery server is not shut down properly when `handleShutdown` is called ([#8491](https://github.com/parse-community/parse-server/issues/8491)) ([967700b](https://github.com/parse-community/parse-server/commit/967700bdbc94c74f75ba84d2b3f4b9f3fd2dca0b))
10+
* Rate limit feature is incompatible with Node 14 ([#8578](https://github.com/parse-community/parse-server/issues/8578)) ([f911f2c](https://github.com/parse-community/parse-server/commit/f911f2cd3a8c45cd326272dcd681532764a3761e))
11+
* Unnecessary log entries by `extendSessionOnUse` ([#8562](https://github.com/parse-community/parse-server/issues/8562)) ([fd6a007](https://github.com/parse-community/parse-server/commit/fd6a0077f2e5cf83d65e52172ae5a950ab0f1eae))
12+
13+
### Features
14+
15+
* `extendSessionOnUse` to automatically renew Parse Sessions ([#8505](https://github.com/parse-community/parse-server/issues/8505)) ([6f885d3](https://github.com/parse-community/parse-server/commit/6f885d36b94902fdfea873fc554dee83589e6029))
16+
* Add new Parse Server option `preventSignupWithUnverifiedEmail` to prevent returning a user without session token on sign-up with unverified email address ([#8451](https://github.com/parse-community/parse-server/issues/8451)) ([82da308](https://github.com/parse-community/parse-server/commit/82da30842a55980aa90cb7680fbf6db37ee16dab))
17+
* Add option to change the log level of logs emitted by Cloud Functions ([#8530](https://github.com/parse-community/parse-server/issues/8530)) ([2caea31](https://github.com/parse-community/parse-server/commit/2caea310be412d82b04a85716bc769ccc410316d))
18+
* Add support for `$eq` query constraint in LiveQuery ([#8614](https://github.com/parse-community/parse-server/issues/8614)) ([656d673](https://github.com/parse-community/parse-server/commit/656d673cf5dea354e4f2b3d4dc2b29a41d311b3e))
19+
* Add zones for rate limiting by `ip`, `user`, `session`, `global` ([#8508](https://github.com/parse-community/parse-server/issues/8508)) ([03fba97](https://github.com/parse-community/parse-server/commit/03fba97e0549bfcaeee9f2fa4c9905dbcc91840e))
20+
* Allow `Parse.Object` pointers in Cloud Code arguments ([#8490](https://github.com/parse-community/parse-server/issues/8490)) ([28aeda3](https://github.com/parse-community/parse-server/commit/28aeda3f160efcbbcf85a85484a8d26567fa9761))
21+
22+
### Reverts
23+
24+
* fix: Inaccurate table total row count for PostgreSQL ([6722110](https://github.com/parse-community/parse-server/commit/6722110f203bc5fdcaa68cdf091cf9e7b48d1cff))
25+
26+
## [6.2.2](https://github.com/parse-community/parse-server/compare/6.2.1...6.2.2) (2023-09-04)
27+
28+
29+
### Bug Fixes
30+
31+
* Parse Pointer allows to access internal Parse Server classes and circumvent `beforeFind` query trigger; fixes security vulnerability [GHSA-fcv6-fg5r-jm9q](https://github.com/parse-community/parse-server/security/advisories/GHSA-fcv6-fg5r-jm9q) ([be4c7e2](https://github.com/parse-community/parse-server/commit/be4c7e23c63a2fb690685665cebed0de26be05c5))
32+
33+
## [6.2.1](https://github.com/parse-community/parse-server/compare/6.2.0...6.2.1) (2023-06-28)
34+
35+
36+
### Bug Fixes
37+
38+
* Remote code execution via MongoDB BSON parser through prototype pollution; fixes security vulnerability [GHSA-462x-c3jw-7vr6](https://github.com/parse-community/parse-server/security/advisories/GHSA-462x-c3jw-7vr6) ([#8674](https://github.com/parse-community/parse-server/issues/8674)) ([3dd99dd](https://github.com/parse-community/parse-server/commit/3dd99dd80e27e5e1d99b42844180546d90c7aa90))
39+
140
# [6.2.0](https://github.com/parse-community/parse-server/compare/6.1.0...6.2.0) (2023-05-20)
241

342

package-lock.json

+9-9
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": "6.3.0-alpha.8",
3+
"version": "6.4.0-alpha.3",
44
"description": "An express module providing a Parse-compatible API server",
55
"main": "lib/index.js",
66
"repository": {
@@ -34,7 +34,7 @@
3434
"express": "4.18.2",
3535
"express-rate-limit": "6.7.0",
3636
"follow-redirects": "1.15.2",
37-
"graphql": "16.6.0",
37+
"graphql": "16.8.1",
3838
"graphql-list-fields": "2.0.2",
3939
"graphql-relay": "0.10.0",
4040
"graphql-tag": "2.12.6",

spec/CloudCode.spec.js

+81-2
Original file line numberDiff line numberDiff line change
@@ -2398,6 +2398,56 @@ describe('beforeFind hooks', () => {
23982398
});
23992399
});
24002400

2401+
it('sets correct beforeFind trigger isGet parameter for Parse.Object.fetch request', async () => {
2402+
const hook = {
2403+
method: req => {
2404+
expect(req.isGet).toEqual(true);
2405+
return Promise.resolve();
2406+
},
2407+
};
2408+
spyOn(hook, 'method').and.callThrough();
2409+
Parse.Cloud.beforeFind('MyObject', hook.method);
2410+
const obj = new Parse.Object('MyObject');
2411+
await obj.save();
2412+
const getObj = await obj.fetch();
2413+
expect(getObj).toBeInstanceOf(Parse.Object);
2414+
expect(hook.method).toHaveBeenCalledTimes(1);
2415+
});
2416+
2417+
it('sets correct beforeFind trigger isGet parameter for Parse.Query.get request', async () => {
2418+
const hook = {
2419+
method: req => {
2420+
expect(req.isGet).toEqual(false);
2421+
return Promise.resolve();
2422+
},
2423+
};
2424+
spyOn(hook, 'method').and.callThrough();
2425+
Parse.Cloud.beforeFind('MyObject', hook.method);
2426+
const obj = new Parse.Object('MyObject');
2427+
await obj.save();
2428+
const query = new Parse.Query('MyObject');
2429+
const getObj = await query.get(obj.id);
2430+
expect(getObj).toBeInstanceOf(Parse.Object);
2431+
expect(hook.method).toHaveBeenCalledTimes(1);
2432+
});
2433+
2434+
it('sets correct beforeFind trigger isGet parameter for Parse.Query.find request', async () => {
2435+
const hook = {
2436+
method: req => {
2437+
expect(req.isGet).toEqual(false);
2438+
return Promise.resolve();
2439+
},
2440+
};
2441+
spyOn(hook, 'method').and.callThrough();
2442+
Parse.Cloud.beforeFind('MyObject', hook.method);
2443+
const obj = new Parse.Object('MyObject');
2444+
await obj.save();
2445+
const query = new Parse.Query('MyObject');
2446+
const findObjs = await query.find();
2447+
expect(findObjs?.[0]).toBeInstanceOf(Parse.Object);
2448+
expect(hook.method).toHaveBeenCalledTimes(1);
2449+
});
2450+
24012451
it('should have request headers', done => {
24022452
Parse.Cloud.beforeFind('MyObject', req => {
24032453
expect(req.headers).toBeDefined();
@@ -2431,6 +2481,35 @@ describe('beforeFind hooks', () => {
24312481
})
24322482
.then(() => done());
24332483
});
2484+
2485+
it('should run beforeFind on pointers and array of pointers from an object', async () => {
2486+
const obj1 = new Parse.Object('TestObject');
2487+
const obj2 = new Parse.Object('TestObject2');
2488+
const obj3 = new Parse.Object('TestObject');
2489+
obj2.set('aField', 'aFieldValue');
2490+
await obj2.save();
2491+
obj1.set('pointerField', obj2);
2492+
obj3.set('pointerFieldArray', [obj2]);
2493+
await obj1.save();
2494+
await obj3.save();
2495+
const spy = jasmine.createSpy('beforeFindSpy');
2496+
Parse.Cloud.beforeFind('TestObject2', spy);
2497+
const query = new Parse.Query('TestObject');
2498+
await query.get(obj1.id);
2499+
// Pointer not included in query so we don't expect beforeFind to be called
2500+
expect(spy).not.toHaveBeenCalled();
2501+
const query2 = new Parse.Query('TestObject');
2502+
query2.include('pointerField');
2503+
const res = await query2.get(obj1.id);
2504+
expect(res.get('pointerField').get('aField')).toBe('aFieldValue');
2505+
// Pointer included in query so we expect beforeFind to be called
2506+
expect(spy).toHaveBeenCalledTimes(1);
2507+
const query3 = new Parse.Query('TestObject');
2508+
query3.include('pointerFieldArray');
2509+
const res2 = await query3.get(obj3.id);
2510+
expect(res2.get('pointerFieldArray')[0].get('aField')).toBe('aFieldValue');
2511+
expect(spy).toHaveBeenCalledTimes(2);
2512+
});
24342513
});
24352514

24362515
describe('afterFind hooks', () => {
@@ -3248,7 +3327,7 @@ describe('beforeLogin hook', () => {
32483327
expect(req.headers).toBeDefined();
32493328
expect(req.ip).toBeDefined();
32503329
expect(req.installationId).toBeDefined();
3251-
expect(req.context).toBeUndefined();
3330+
expect(req.context).toBeDefined();
32523331
});
32533332

32543333
await Parse.User.signUp('tupac', 'shakur');
@@ -3365,7 +3444,7 @@ describe('afterLogin hook', () => {
33653444
expect(req.headers).toBeDefined();
33663445
expect(req.ip).toBeDefined();
33673446
expect(req.installationId).toBeDefined();
3368-
expect(req.context).toBeUndefined();
3447+
expect(req.context).toBeDefined();
33693448
});
33703449

33713450
await Parse.User.signUp('testuser', 'p@ssword');

spec/ParseFile.spec.js

+68
Original file line numberDiff line numberDiff line change
@@ -1364,6 +1364,74 @@ describe('Parse.File testing', () => {
13641364
);
13651365
});
13661366

1367+
it('works with a period in the file name', async () => {
1368+
await reconfigureServer({
1369+
fileUpload: {
1370+
enableForPublic: true,
1371+
fileExtensions: ['^[^hH][^tT][^mM][^lL]?$'],
1372+
},
1373+
});
1374+
const headers = {
1375+
'X-Parse-Application-Id': 'test',
1376+
'X-Parse-REST-API-Key': 'rest',
1377+
};
1378+
1379+
const values = ['file.png.html', 'file.txt.png.html', 'file.png.txt.html'];
1380+
1381+
for (const value of values) {
1382+
await expectAsync(
1383+
request({
1384+
method: 'POST',
1385+
headers: headers,
1386+
url: `http://localhost:8378/1/files/${value}`,
1387+
body: '<html></html>\n',
1388+
}).catch(e => {
1389+
throw new Error(e.data.error);
1390+
})
1391+
).toBeRejectedWith(
1392+
new Parse.Error(Parse.Error.FILE_SAVE_ERROR, `File upload of extension html is disabled.`)
1393+
);
1394+
}
1395+
});
1396+
1397+
it('works to stop invalid filenames', async () => {
1398+
await reconfigureServer({
1399+
fileUpload: {
1400+
enableForPublic: true,
1401+
fileExtensions: ['^[^hH][^tT][^mM][^lL]?$'],
1402+
},
1403+
});
1404+
const headers = {
1405+
'X-Parse-Application-Id': 'test',
1406+
'X-Parse-REST-API-Key': 'rest',
1407+
};
1408+
1409+
const values = [
1410+
'!invalid.png',
1411+
'.png',
1412+
'.html',
1413+
' .html',
1414+
'.png.html',
1415+
'~invalid.png',
1416+
'-invalid.png',
1417+
];
1418+
1419+
for (const value of values) {
1420+
await expectAsync(
1421+
request({
1422+
method: 'POST',
1423+
headers: headers,
1424+
url: `http://localhost:8378/1/files/${value}`,
1425+
body: '<html></html>\n',
1426+
}).catch(e => {
1427+
throw new Error(e.data.error);
1428+
})
1429+
).toBeRejectedWith(
1430+
new Parse.Error(Parse.Error.INVALID_FILE_NAME, `Filename contains invalid characters.`)
1431+
);
1432+
}
1433+
});
1434+
13671435
it('works with array', async () => {
13681436
await reconfigureServer({
13691437
fileUpload: {

spec/ParseGraphQLServer.spec.js

-1
Original file line numberDiff line numberDiff line change
@@ -5275,7 +5275,6 @@ describe('ParseGraphQLServer', () => {
52755275

52765276
it('should only count', async () => {
52775277
await prepareData();
5278-
52795278
await parseGraphQLServer.parseGraphQLSchema.schemaCache.clear();
52805279

52815280
const where = {

spec/ParseRole.spec.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ describe('Parse Role testing', () => {
142142
return Promise.all(promises);
143143
};
144144

145-
const restExecute = spyOn(RestQuery.prototype, 'execute').and.callThrough();
145+
const restExecute = spyOn(RestQuery._UnsafeRestQuery.prototype, 'execute').and.callThrough();
146146

147147
let user, auth, getAllRolesSpy;
148148
createTestUser()

0 commit comments

Comments
 (0)