Skip to content

Commit c732735

Browse files
committed
Merge branch 'master' into push-scaling
2 parents 9c0ce0a + 2b0c39c commit c732735

File tree

165 files changed

+4988
-3866
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

165 files changed

+4988
-3866
lines changed

.eslintignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
lib/*
2+
coverage/*

.eslintrc.json

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"root": true,
3+
"extends": "eslint:recommended",
4+
"env": {
5+
"node": true,
6+
"es6": true
7+
},
8+
"parser": "babel-eslint",
9+
"plugins": [
10+
"flowtype"
11+
],
12+
"parserOptions": {
13+
"ecmaVersion": 6,
14+
"sourceType": "module"
15+
},
16+
"rules": {
17+
"indent": ["error", 2],
18+
"linebreak-style": ["error", "unix"],
19+
"no-trailing-spaces": 2,
20+
"eol-last": 2
21+
}
22+
}

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ lib/
4444

4545
# cache folder
4646
.cache
47+
.eslintcache
4748

4849
# Mac DS_Store files
4950
.DS_Store

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ before_script:
1515
- psql -c 'create database parse_server_postgres_adapter_test_database;' -U postgres
1616
- psql -c 'CREATE EXTENSION postgis;' -U postgres -d parse_server_postgres_adapter_test_database
1717
- psql -c 'CREATE EXTENSION postgis_topology;' -U postgres -d parse_server_postgres_adapter_test_database
18+
- npm run lint
1819
env:
1920
global:
2021
- COVERAGE_OPTION='./node_modules/.bin/istanbul cover'

CHANGELOG.md

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,31 @@
11
## Parse Server Changelog
22

3-
### 2.2.25-beta.1
3+
### 2.2.25
44

55
Postgres support requires v9.5
66

77
#### New Features
8+
* Dockerizing Parse Server, thanks to [Kirill Kravinsky](https://github.com/woyorus)
9+
* Login with qq, wechat, weibo, thanks to [haifeizhang]()
10+
* Password policy, validation and expiration, thanks to [Bhaskar Reddy Yasa](https://github.com/bhaskaryasa)
811
* Health check on /health, thanks to [Kirill Kravinsky](https://github.com/woyorus)
912
* Reuse SchemaCache across requests option, thanks to [Steven Shipton](https://github.com/steven-supersolid)
1013

1114
#### Improvements
15+
* Better support for CLI options, thanks to [Steven Shipton](https://github.com/steven-supersolid)
16+
* Specity a database timeout with maxTimeMS, thanks to [Tyler Brock](https://github.com/TylerBrock)
17+
* Adds the username to reset password success pages, thanks to [Halim Qarroum](https://github.com/HQarroum)
1218
* Better support for Redis cache adapter, thanks to [Tyler Brock](https://github.com/TylerBrock)
1319
* Better coverage of Postgres, thanks to [Kulshekhar Kabra](https://github.com/kulshekhar)
1420

21+
#### Bug Fixes
22+
* Fixes issue when sending push to multiple installations, thanks to [Florent Vilmart](https://github.com/flovilmart)
23+
* Fixes issues with twitter authentication, thanks to [jonas-db](https://github.com/jonas-db)
24+
* Ignore createdAt fields update, thanks to [Yuki Takeichi](https://github.com/yuki-takeichi)
25+
* Improve support for array equality with LiveQuery, thanks to [David Poetzsch-Heffter](https://github.com/dpoetzsch)
26+
* Improve support for batch endpoint when serverURL and publicServerURL have different paths, thanks to [Florent Vilmart](https://github.com/flovilmart)
27+
* Support saving relation objects, thanks to [Yuki Takeichi](https://github.com/yuki-takeichi)
28+
1529
### 2.2.24
1630

1731
#### New Features

CONTRIBUTING.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ We really want Parse to be yours, to see it grow and thrive in the open source c
99
* Take testing seriously! Aim to increase the test coverage with every pull request.
1010
* Run the tests for the file you are working on with `npm test spec/MyFile.spec.js`
1111
* Run the tests for the whole project and look at the coverage report to make sure your tests are exhaustive by running `npm test` and looking at (project-root)/lcov-report/parse-server/FileUnderTest.js.html
12+
* Lint your code by running `npm run lint` to make sure all your code is not gonna be rejected by the CI.
1213

1314
##### Code of Conduct
1415

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -287,6 +287,8 @@ var server = ParseServer({
287287
// 2. a callback function to be invoked to validate the password
288288
validatorCallback: (password) => { return validatePassword(password) },
289289
doNotAllowUsername: true, // optional setting to disallow username in passwords
290+
maxPasswordAge: 90, // optional setting in days for password expiry. Login fails if user does not reset the password within this period after signup/last reset.
291+
maxPasswordHistory: 5, // optional setting to prevent reuse of previous n passwords. Maximum value that can be specified is 20. Not specifying it or specifying 0 will not enforce history.
290292
//optional setting to set a validity duration for password reset links (in seconds)
291293
resetTokenValidityDuration: 24*60*60, // expire after 24 hours
292294
}

package.json

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "parse-server",
3-
"version": "2.2.25-beta.1",
3+
"version": "2.2.25",
44
"description": "An express module providing a Parse-compatible API server",
55
"main": "lib/index.js",
66
"repository": {
@@ -25,7 +25,7 @@
2525
"express": "4.14.0",
2626
"intersect": "1.0.1",
2727
"lodash": "4.17.2",
28-
"lru-cache": "4.0.1",
28+
"lru-cache": "4.0.2",
2929
"mime": "1.3.4",
3030
"mongodb": "2.2.10",
3131
"multer": "1.2.0",
@@ -34,18 +34,19 @@
3434
"parse-server-push-adapter": "1.1.0",
3535
"parse-server-s3-adapter": "1.0.5",
3636
"parse-server-simple-mailgun-adapter": "1.0.0",
37-
"pg-promise": "5.3.5",
37+
"pg-promise": "5.4.5",
3838
"redis": "2.6.3",
3939
"request": "2.79.0",
4040
"semver": "5.2.0",
4141
"tv4": "1.2.7",
4242
"winston": "2.3.0",
43-
"winston-daily-rotate-file": "1.3.1",
43+
"winston-daily-rotate-file": "1.4.0",
4444
"ws": "1.1.1"
4545
},
4646
"devDependencies": {
4747
"babel-cli": "6.18.0",
4848
"babel-core": "6.18.2",
49+
"babel-eslint": "^7.1.1",
4950
"babel-plugin-syntax-flow": "6.13.0",
5051
"babel-plugin-transform-flow-strip-types": "6.18.0",
5152
"babel-preset-es2015": "6.14.0",
@@ -54,6 +55,8 @@
5455
"bcrypt-nodejs": "0.0.3",
5556
"cross-env": "3.1.3",
5657
"deep-diff": "0.3.4",
58+
"eslint": "^3.10.2",
59+
"eslint-plugin-flowtype": "^2.25.0",
5760
"gaze": "1.1.1",
5861
"istanbul": "1.0.0-alpha.1",
5962
"jasmine": "2.5.2",
@@ -64,11 +67,13 @@
6467
},
6568
"scripts": {
6669
"dev": "npm run build && node bin/dev",
70+
"lint": "eslint --cache ./",
6771
"build": "babel src/ -d lib/",
68-
"test": "cross-env MONGODB_VERSION=${MONGODB_VERSION:=3.2.6} MONGODB_STORAGE_ENGINE=mmapv1 NODE_ENV=test TESTING=1 node $COVERAGE_OPTION ./spec/support/runner.js",
69-
"test:win": "npm run pretest && cross-env NODE_ENV=test TESTING=1 node ./node_modules/jasmine/bin/jasmine.js && npm run posttest",
72+
"pretest": "npm run lint",
73+
"test": "cross-env MONGODB_VERSION=${MONGODB_VERSION:=3.2.6} MONGODB_STORAGE_ENGINE=mmapv1 NODE_ENV=test TESTING=1 $COVERAGE_OPTION jasmine",
74+
"test:win": "cross-env MONGODB_VERSION=${MONGODB_VERSION:=3.2.6} MONGODB_STORAGE_ENGINE=mmapv1 NODE_ENV=test TESTING=1 jasmine",
7075
"coverage": "cross-env COVERAGE_OPTION='./node_modules/.bin/istanbul cover' npm test",
71-
"coverage:win": "npm run pretest && cross-env NODE_ENV=test TESTING=1 node ./node_modules/babel-istanbul/lib/cli.js cover ./node_modules/jasmine/bin/jasmine.js && npm run posttest",
76+
"coverage:win": "cross-env MONGODB_VERSION=${MONGODB_VERSION:=3.2.6} MONGODB_STORAGE_ENGINE=mmapv1 NODE_ENV=test TESTING=1 node ./node_modules/istanbul/lib/cli.js cover ./node_modules/jasmine/bin/jasmine.js",
7277
"start": "node ./bin/parse-server",
7378
"prepublish": "npm run build"
7479
},

spec/.eslintrc.json

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
{
2+
"extends": "eslint:recommended",
3+
"env": {
4+
"node": true,
5+
"es6": true,
6+
"jasmine": true
7+
},
8+
"globals": {
9+
"Parse": true,
10+
"reconfigureServer": true,
11+
"createTestUser": true,
12+
"jfail": true,
13+
"ok": true,
14+
"strictEqual": true,
15+
"TestObject": true,
16+
"Item": true,
17+
"Container": true,
18+
"equal": true,
19+
"notEqual": true,
20+
"it_exclude_dbs": true,
21+
"describe_only_db": true,
22+
"on_db": true,
23+
"defaultConfiguration": true,
24+
"expectSuccess": true,
25+
"range": true,
26+
"expectError": true,
27+
"jequal": true,
28+
"create": true,
29+
"arrayContains": true
30+
},
31+
"rules": {
32+
"no-console": [0],
33+
"indent": ["error", 2]
34+
}
35+
}

spec/AccountLockoutPolicy.spec.js

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ const Config = require("../src/Config");
55
var loginWithWrongCredentialsShouldFail = function(username, password) {
66
return new Promise((resolve, reject) => {
77
Parse.User.logIn(username, password)
8-
.then(user => reject('login should have failed'))
8+
.then(() => reject('login should have failed'))
99
.catch(err => {
1010
if (err.message === 'Invalid username/password.') {
1111
resolve();
@@ -20,7 +20,7 @@ var isAccountLockoutError = function(username, password, duration, waitTime) {
2020
return new Promise((resolve, reject) => {
2121
setTimeout(() => {
2222
Parse.User.logIn(username, password)
23-
.then(user => reject('login should have failed'))
23+
.then(() => reject('login should have failed'))
2424
.catch(err => {
2525
if (err.message === 'Your account is locked due to multiple failed login attempts. Please try again after ' + duration + ' minute(s)') {
2626
resolve();
@@ -45,7 +45,7 @@ describe("Account Lockout Policy: ", () => {
4545
user.setPassword('password');
4646
return user.signUp(null);
4747
})
48-
.then(user => {
48+
.then(() => {
4949
return loginWithWrongCredentialsShouldFail('username1', 'incorrect password 1');
5050
})
5151
.then(() => {
@@ -71,7 +71,7 @@ describe("Account Lockout Policy: ", () => {
7171
publicServerURL: "https://my.public.server.com/1"
7272
})
7373
.then(() => {
74-
var config = new Config('test');
74+
new Config('test');
7575
fail('set duration to an invalid number test failed');
7676
done();
7777
})
@@ -95,7 +95,7 @@ describe("Account Lockout Policy: ", () => {
9595
publicServerURL: "https://my.public.server.com/1"
9696
})
9797
.then(() => {
98-
var config = new Config('test');
98+
new Config('test');
9999
fail('set threshold to an invalid number test failed');
100100
done();
101101
})
@@ -119,7 +119,7 @@ describe("Account Lockout Policy: ", () => {
119119
publicServerURL: "https://my.public.server.com/1"
120120
})
121121
.then(() => {
122-
var config = new Config('test');
122+
new Config('test');
123123
fail('threshold value < 1 is invalid test failed');
124124
done();
125125
})
@@ -143,7 +143,7 @@ describe("Account Lockout Policy: ", () => {
143143
publicServerURL: "https://my.public.server.com/1"
144144
})
145145
.then(() => {
146-
var config = new Config('test');
146+
new Config('test');
147147
fail('threshold value > 999 is invalid test failed');
148148
done();
149149
})
@@ -167,7 +167,7 @@ describe("Account Lockout Policy: ", () => {
167167
publicServerURL: "https://my.public.server.com/1"
168168
})
169169
.then(() => {
170-
var config = new Config('test');
170+
new Config('test');
171171
fail('duration value < 1 is invalid test failed');
172172
done();
173173
})
@@ -191,7 +191,7 @@ describe("Account Lockout Policy: ", () => {
191191
publicServerURL: "https://my.public.server.com/1"
192192
})
193193
.then(() => {
194-
var config = new Config('test');
194+
new Config('test');
195195
fail('duration value > 99999 is invalid test failed');
196196
done();
197197
})
@@ -230,7 +230,7 @@ describe("Account Lockout Policy: ", () => {
230230
return isAccountLockoutError('username2', 'wrong password', 1, 1);
231231
})
232232
.then(() => {
233-
done();
233+
done();
234234
})
235235
.catch(err => {
236236
fail('lock account after failed login attempts test failed: ' + JSON.stringify(err));
@@ -301,7 +301,7 @@ describe("Account Lockout Policy: ", () => {
301301
return new Promise((resolve, reject) => {
302302
setTimeout(() => {
303303
Parse.User.logIn('username4', 'correct password')
304-
.then(user => resolve())
304+
.then(() => resolve())
305305
.catch(err => reject(err));
306306
}, 3001);
307307
});

0 commit comments

Comments
 (0)