Skip to content

pull update from ParsePlatform #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 52 commits into from
May 23, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
21e73ac
Destructuring
drew-gross Apr 26, 2016
e0a9f19
Split logic for transforming queries into it's own function
drew-gross Apr 26, 2016
5c7b346
Remove unnecessary logic
drew-gross Apr 26, 2016
e2a3213
Remove update logic from query
drew-gross Apr 26, 2016
ee8a3c9
No need to transform post-transform keys in mongo adapter
drew-gross Apr 26, 2016
7b431ad
nits
drew-gross Apr 26, 2016
a3179e4
No need to handle object or reject arrays when transforming queries
drew-gross Apr 26, 2016
37953d1
some cleanup
drew-gross Apr 26, 2016
5cbf3eb
Tidy up db controller
drew-gross Apr 26, 2016
608cba9
Clearer names in DatabaseController
drew-gross Apr 26, 2016
4371ca1
Pass parse format schema to transformWhere
drew-gross Apr 26, 2016
874d10f
Check expected type is array from Parse Format Schema
drew-gross Apr 26, 2016
5f564f3
simplify a little
drew-gross Apr 26, 2016
a926712
Start using parse format schema in transformQueryKeyValue
drew-gross Apr 26, 2016
d4bd21f
remove schema from transformWhere
drew-gross Apr 26, 2016
449ca11
Break object deletions's dependency on schemaController
drew-gross Apr 26, 2016
71ae7be
better names and comments
drew-gross Apr 26, 2016
90df784
Update issue template
hramos May 3, 2016
7c850fc
Fix for #1642 - copy query parameters to request body (#1687)
steven-supersolid May 6, 2016
da5b5cc
Update ISSUE_TEMPLATE.md
hramos May 6, 2016
b00572d
Merge pull request #1696 from ParsePlatform/issue-template
hramos May 6, 2016
37c502b
Add config.expireInactiveSession to add support for non-expiring inac…
steven-supersolid May 6, 2016
10d2988
Pass dates to cloud code functions (#655) (#1697)
andrewchae May 9, 2016
b2f36e1
Merge pull request #1644 from drew-gross/refactor-query-transform
gfosco May 9, 2016
e60901d
Version 2.2.8 (#1738)
drew-gross May 9, 2016
e698f61
Handle null param in cloud code. Fixes #1472 (#1746)
drew-gross May 10, 2016
26df509
Update to 2.2.9 (#1747)
drew-gross May 10, 2016
1291f70
Fix malformed config.json in bootstrap.sh
sbalay May 10, 2016
10ee229
Update dependencies and support node 6.1 (#1754)
drew-gross May 11, 2016
6cfcb4d
Fix #1755 (#1756)
ssk7833 May 11, 2016
19e7407
Return correct error when violating unique index (#1763)
Marco129 May 12, 2016
c2cfa14
Tell dashboard that the feature exits
drew-gross May 12, 2016
d0c3535
Fix error when unset user email (#1778)
Marco129 May 13, 2016
4bfe2c5
Merge pull request #1774 from drew-gross/pointer-perms-in-dash
peterdotjs May 13, 2016
e4998c2
Move field name validation logic out of mongo (#1752)
drew-gross May 13, 2016
1854928
Add test to ensure you can set ACL in beforeSave (#1772)
TylerBrock May 14, 2016
3b4ae2d
Write old ACL format in _acl in addition to new format (#1810)
TylerBrock May 16, 2016
b40e166
Changelog for version 2.2.10
drew-gross May 16, 2016
4096518
Mask sensitive information when logging (#1790)
Marco129 May 17, 2016
5d887e1
FIX #1572 - Accepting LOGS_FOLDER as env variable (#1757)
KartikeyaRokde May 18, 2016
8c09c3d
Adding Caching Adapter, allows caching of _Role and _User queries (fi…
blacha May 18, 2016
d7d4699
Fix logic for missing geo index error message check (#1824)
TylerBrock May 18, 2016
4d43614
Refactor MongoTransform.js (#1823)
drew-gross May 19, 2016
03108e6
add support for http basic auth (#1706)
hmoqhim May 19, 2016
fece2a4
change logger.error to logger.info to prevent pm2 from crashing (#1830)
benishak May 19, 2016
b218368
Refactor cloud code tests (#1837)
drew-gross May 19, 2016
9bad879
Add MongoDB 3.2 to test matrix (#1842)
TylerBrock May 20, 2016
fab8cfd
Add additional default fields to _Installation class (#1852)
JeremyPlease May 21, 2016
eefa2cc
Handle "bytes" type in DB. Fixes #1821. (#1866)
drew-gross May 22, 2016
392102e
Cache users by objectID, and clear cache when updated via master key …
drew-gross May 22, 2016
e93a1ad
Pin mongodb package
drew-gross May 23, 2016
361d4a3
Merge pull request #1876 from ParsePlatform/pin-mongodb
peterdotjs May 23, 2016
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 16 additions & 5 deletions .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,30 @@
Check out [this issue](https://github.com/ParsePlatform/parse-server/issues/1271) for an ideal bug report. The closer your issue report is to that one, the more likely we are to be able to help, and the more likely we will be to fix the issue quickly!
Check out https://github.com/ParsePlatform/parse-server/issues/1271 for an ideal bug report. The closer your issue report is to that one, the more likely we are to be able to help, and the more likely we will be to fix the issue quickly!

For implementation related questions or technical support, please refer to the [Stack Overflow](http://stackoverflow.com/questions/tagged/parse.com) and [Server Fault](https://serverfault.com/tags/parse) communities. For database migration help, please [file a bug report](https://parse.com/help#report).
Many members of the community use Stack Overflow and Server Fault to ask questions. Read through the existing questions or ask your own!

- Stack Overflow: http://stackoverflow.com/questions/tagged/parse.com
- Server Fault: https://serverfault.com/tags/parse

For database migration help, please file a bug report at https://parse.com/help#report

Make sure these boxes are checked before submitting your issue -- thanks for reporting issues back to Parse Server!

- [ ] You've met the [prerequisites](https://github.com/ParsePlatform/parse-server/wiki/Parse-Server-Guide#prerequisites).
- [ ] You've met the prerequisites: https://github.com/ParsePlatform/parse-server/wiki/Parse-Server-Guide#prerequisites.

- [ ] You're running the [latest version](https://github.com/ParsePlatform/parse-server/releases) of Parse Server.
- [ ] You're running the latest version of Parse Server: https://github.com/ParsePlatform/parse-server/releases

- [ ] You've searched through [existing issues](https://github.com/ParsePlatform/parse-server/issues?utf8=%E2%9C%93&q=). Chances are that your issue has been reported or resolved before.
- [ ] You've searched through existing issues: https://github.com/ParsePlatform/Parse-Server/issues?utf8=%E2%9C%93&q=is%3Aissue Chances are that your issue has been reported or resolved before.

#### Environment Setup

- Server: parse-server version, operating system, hardware, local or remote?
- Database: version, storage engine, hardware, local or remote?

#### Steps to reproduce

- Can this issue be reproduced using the Parse Server REST API? Include curl commands when applicable.
- What was the expected result? What is the actual outcome?

#### Logs/Trace

- You can turn on additional logging by configuring VERBOSE=1 in your environment.
2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
language: node_js
node_js:
- '4.3'
- '6.1'
env:
global:
- COVERAGE_OPTION='./node_modules/babel-istanbul/lib/cli.js cover -x **/spec/**'
matrix:
- MONGODB_VERSION=2.6.11
- MONGODB_VERSION=3.0.8
- MONGODB_VERSION=3.2.6
branches:
only:
- master
Expand Down
29 changes: 29 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,34 @@
## Parse Server Changelog

### 2.2.10 (5/15/2016)

* Fix: Write legacy ACLs to Mongo so that clients that still go through Parse.com can read them, thanks to [Tyler Brock](https://github.com/TylerBrock) and [carmenlau](https://github.com/carmenlau)
* Fix: Querying installations with limit = 0 and count = 1 now works, thanks to [ssk7833](https://github.com/ssk7833)
* Fix: Return correct error when violating unique index, thanks to [Marco Cheung](https://github.com/Marco129)
* Fix: Allow unsetting user's email, thanks to [Marco Cheung](https://github.com/Marco129)
* New: Support for Node 6.1

### 2.2.9 (5/9/2016)

* Fix: Fix a regression that caused Parse Server to crash when a null parameter is passed to a Cloud function

### 2.2.8 (5/8/2016)

* New: Support for Pointer Permissions
* New: Expose logger in Cloud Code
* New: Option to revoke sessions on password reset
* New: Option to expire inactive sessions
* Perf: Improvements in ACL checking query
* Fix: Issues when sending pushes to list of devices that contains invalid values
* Fix: Issues caused by using babel-polyfill outside of Parse Server, but in the same express app
* Fix: Remove creation of extra session tokens
* Fix: Return authData when querying with master key
* Fix: Bugs when deleting webhooks
* Fix: Ignore _RevocableSession header, which might be sent by the JS SDK
* Fix: Issues with querying via URL params
* Fix: Properly encode "Date" parameters to cloud code functions


### 2.2.7 (4/15/2016)

* Adds support for --verbose and verbose option when running ParseServer [\#1414](https://github.com/ParsePlatform/parse-server/pull/1414) ([flovilmart](https://github.com/flovilmart))
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ That's it! You are now running a standalone version of Parse Server on your mach

**Using a remote MongoDB?** Pass the `--databaseURI DATABASE_URI` parameter when starting `parse-server`. Learn more about configuring Parse Server [here](#configuration). For a full list of available options, run `parse-server --help`.

**Want logs to be in placed in other folder?** Pass the `PARSE_SERVER_LOGS_FOLDER` environment variable when starting `parse-server`. Usage :- `PARSE_SERVER_LOGS_FOLDER='<path-to-logs-folder>' parse-server --appId APPLICATION_ID --masterKey MASTER_KEY`

### Saving your first object

Now that you're running Parse Server, it is time to save your first object. We'll use the [REST API](https://parse.com/docs/rest/guide), but you can easily do the same using any of the [Parse SDKs](https://parseplatform.github.io/#sdks). Run the following:
Expand Down
2 changes: 1 addition & 1 deletion bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ cat > ./config.json << EOF
"masterKey": "$MASTER_KEY",
"appName": "$APP_NAME",
"cloud": "./cloud/main",
"mongodbURI": "$MONGODB_URI"
"databaseURI": "$MONGODB_URI"
}
EOF
echo "${CHECK} Created config.json"
Expand Down
14 changes: 6 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "parse-server",
"version": "2.2.7",
"version": "2.2.10",
"description": "An express module providing a Parse-compatible API server",
"main": "lib/index.js",
"repository": {
Expand Down Expand Up @@ -31,7 +31,7 @@
"lru-cache": "^4.0.0",
"mailgun-js": "^0.7.7",
"mime": "^1.3.4",
"mongodb": "~2.1.0",
"mongodb": "2.1.18",
"multer": "^1.1.0",
"parse": "^1.8.0",
"parse-server-fs-adapter": "^1.0.0",
Expand All @@ -57,17 +57,15 @@
"codecov": "^1.0.1",
"cross-env": "^1.0.7",
"deep-diff": "^0.3.3",
"flow-bin": "^0.22.0",
"gaze": "^0.5.2",
"gaze": "^1.0.0",
"jasmine": "^2.3.2",
"mongodb-runner": "3.1.15",
"nodemon": "^1.8.1",
"parse-server-gcs-adapter": "^1.0.0"
"mongodb-runner": "^3.3.2",
"nodemon": "^1.8.1"
},
"scripts": {
"dev": "npm run build && node bin/dev",
"build": "./node_modules/.bin/babel src/ -d lib/",
"pretest": "cross-env MONGODB_VERSION=${MONGODB_VERSION:=3.0.8} ./node_modules/.bin/mongodb-runner start",
"pretest": "cross-env MONGODB_VERSION=${MONGODB_VERSION:=3.2.6} MONGODB_STORAGE_ENGINE=mmapv1 ./node_modules/.bin/mongodb-runner start",
"test": "cross-env NODE_ENV=test TESTING=1 ./node_modules/.bin/babel-node $COVERAGE_OPTION ./node_modules/jasmine/bin/jasmine.js",
"test:win": "npm run pretest && cross-env NODE_ENV=test TESTING=1 ./node_modules/.bin/babel-node ./node_modules/babel-istanbul/lib/cli.js cover -x **/spec/** ./node_modules/jasmine/bin/jasmine.js && npm run posttest",
"posttest": "./node_modules/.bin/mongodb-runner stop",
Expand Down
10 changes: 0 additions & 10 deletions spec/AdapterLoader.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
var loadAdapter = require("../src/Adapters/AdapterLoader").loadAdapter;
var FilesAdapter = require("parse-server-fs-adapter").default;
var S3Adapter = require("parse-server-s3-adapter").default;
var GCSAdapter = require("parse-server-gcs-adapter").default;
var ParsePushAdapter = require("parse-server-push-adapter").default;

describe("AdapterLoader", ()=>{
Expand Down Expand Up @@ -114,13 +113,4 @@ describe("AdapterLoader", ()=>{
}).not.toThrow();
done();
})

it("should load GCSAdapter from direct passing", (done) => {
var gcsAdapter = new GCSAdapter("projectId", "path/to/keyfile", "bucket")
expect(() => {
var adapter = loadAdapter(gcsAdapter, FilesAdapter);
expect(adapter).toBe(gcsAdapter);
}).not.toThrow();
done();
})
});
74 changes: 74 additions & 0 deletions spec/CacheController.spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
var CacheController = require('../src/Controllers/CacheController.js').default;

describe('CacheController', function() {
var FakeCacheAdapter;
var FakeAppID = 'foo';
var KEY = 'hello';

beforeEach(() => {
FakeCacheAdapter = {
get: () => Promise.resolve(null),
put: jasmine.createSpy('put'),
del: jasmine.createSpy('del'),
clear: jasmine.createSpy('clear')
}

spyOn(FakeCacheAdapter, 'get').and.callThrough();
});


it('should expose role and user caches', (done) => {
var cache = new CacheController(FakeCacheAdapter, FakeAppID);

expect(cache.role).not.toEqual(null);
expect(cache.role.get).not.toEqual(null);
expect(cache.user).not.toEqual(null);
expect(cache.user.get).not.toEqual(null);

done();
});


['role', 'user'].forEach((cacheName) => {
it('should prefix ' + cacheName + ' cache', () => {
var cache = new CacheController(FakeCacheAdapter, FakeAppID)[cacheName];

cache.put(KEY, 'world');
var firstPut = FakeCacheAdapter.put.calls.first();
expect(firstPut.args[0]).toEqual([FakeAppID, cacheName, KEY].join(':'));

cache.get(KEY);
var firstGet = FakeCacheAdapter.get.calls.first();
expect(firstGet.args[0]).toEqual([FakeAppID, cacheName, KEY].join(':'));

cache.del(KEY);
var firstDel = FakeCacheAdapter.del.calls.first();
expect(firstDel.args[0]).toEqual([FakeAppID, cacheName, KEY].join(':'));
});
});

it('should clear the entire cache', () => {
var cache = new CacheController(FakeCacheAdapter, FakeAppID);

cache.clear();
expect(FakeCacheAdapter.clear.calls.count()).toEqual(1);

cache.user.clear();
expect(FakeCacheAdapter.clear.calls.count()).toEqual(2);

cache.role.clear();
expect(FakeCacheAdapter.clear.calls.count()).toEqual(3);
});

it('should handle cache rejections', (done) => {

FakeCacheAdapter.get = () => Promise.reject();

var cache = new CacheController(FakeCacheAdapter, FakeAppID);

cache.get('foo').then(done, () => {
fail('Promise should not be rejected.');
});
});

});
Loading