Commit Graph

560 Commits

Author SHA1 Message Date
Drew
234d0093ff Cleanup delete schema (#1604)
* Some cleanup for deleting one schema

* tidyness

* Remove _allCollections as Parse Server doesn't need it.
2016-04-25 14:47:57 -04:00
Drew
d14d451028 Move acl adding into parse server (#1601)
* Move writeACL knowledge out of mongoAdapter

* Remove write ACL from mongo adapter

* Remove readACL from Mongo Transform
2016-04-22 21:44:03 -04:00
Drew
d33dd68cc5 Add revokeSessionOnPasswordReset option. Closes #1584 (#1597)
* Add revokeSessionOnPasswordReset option

* Fix nits
2016-04-22 18:21:50 -04:00
Drew
0d094767cf Cleanup update (#1590)
* destructuring in DB controller

* deleteObject in db adapter

* Turns out we can't have delete by object ID because of ACLs...

* Fix tests

* destructure acl

* Don't reject with object
2016-04-22 17:05:21 -04:00
Florent Vilmart
ab827e3c2f Forces delete resolution (#1595) 2016-04-22 08:46:27 -07:00
Florent Vilmart
d49d539a81 _PushStatus uses proper Parse format (#1580)
* removes mongo style props from _PushStatus

* removes log

* Update MongoTransform.js

Removes _id case
2016-04-21 21:36:15 -04:00
Blayne Chard
6e9529f81c Exposes the loggerAdapter as log to Cloud Functions and Triggers (#1565)
This allows access to logging inside cloud code and triggers via
    request.log.info
    request.log.error
2016-04-21 16:20:14 -04:00
Florent Vilmart
b7b57f7ea7 Adds support for Pointer Permissions
* WIP: Initial pointer permissions

* Process Pointer perms when no matching CLP are found

* Additional tests with read lockdown

* Create operation lockdown with pointer permissions,

on parse.com, when an class is locked down with write pointer perm, users can't create objects even if they set their own as the pointer permission key

* Adds test case for multiple write PointerPerms

* Adds validation for pointer permissions when setting

* Adds tests for validating pointer permissions column types

* Adds tests for complex ACL/CLP/PP hierarchy

* Restores power of the master

* Adds validation of borked fields

* Adds complex test for find

* Adds more variations around PointerPermissions tests
2016-04-20 21:51:11 -04:00
Drew
7b91ee98ed Fixes #1568 (#1574) 2016-04-20 18:42:18 -04:00
Drew
9776362ab2 Begin isolating object creation code into an externalizable API. (#1569)
* Tidy up transformKeyValue

* Specialize transformKeyValue for object creation

* remove keys that never appear in creation requests

* rename function

* remove local var

* early exit for simple keys

* Refactor create

* Force class creation when creating an object

* Pass parameters to key value transformer

* No need to check for array in this func

* start using Parse Format schema in MongoTransform

* Remove call to getExpectedType

* add tests to ensure client can't see _PushStatus
2016-04-20 13:35:48 -07:00
Florent Vilmart
59b4047de8 Defers the session creation after DB operation (#1561) 2016-04-20 11:57:38 -04:00
Blayne Chard
54b21c2f73 Compress the ACL queries into a single $in query (#1566) 2016-04-20 09:03:44 -04:00
Florent Vilmart
ddd01181be Safely require babel-polyfill (#1558)
(https://github.com/shakacode/bootstrap-loader/pull/29/files)
2016-04-19 22:29:00 -07:00
Drew
bf47a0b2b6 Remove acceptor parameter (#1553) 2016-04-19 14:29:05 -07:00
Florent Vilmart
3945e0c680 Update pushStatusHandler.js (#1543)
Fixes error thrown by #1526
2016-04-18 19:30:19 -07:00
Drew
61b62e4e9f Rename Schema => SchemaController (#1542)
* Rename Schema to SchemaController

* Rename Schema => SchemaController

* Move to controllers folder

* Move SchemasController to Controllers folder

* remove ./..
2016-04-18 18:59:57 -07:00
Drew
0708af17d7 Move "No two geopoints" logic into mongo adapter (#1491)
* Move "No two geopoints" logic into mongo adapter

* Semicolon
2016-04-18 17:10:30 -07:00
Drew
cecb2a1cb1 Move 'ns not found' into mongo adapter. (#1541) 2016-04-18 17:06:51 -07:00
Drew
ab0ea09067 Schema.js cleanup (#1540)
* Tidy up schemas router

* de-duplicate logic for injecting default schemas

* Remove no-op promise

* use hasClass

* Make getAllSchemas part of SchemaController

* Move getOneSchema logic onto schema controller

* remove log
2016-04-18 17:06:00 -07:00
Drew
ac839f75c7 Remove mongo object create format from Parse Server (#1516) 2016-04-18 12:45:48 -04:00
Seiji Akiyama
a727e1ccd3 Adds limit = 0 as a valid parameter for queries (#1493)
* Remove results if limit = 0;

* Adds tests for limit=0 and count=1.

* Improves readability.
2016-04-15 11:17:53 -07:00
Drew
3f66c302b7 Enable logs (#1502) 2016-04-14 17:44:50 -07:00
Florent Vilmart
1023baf20d DBController refactoring (#1228)
* Moves transform to MongoTransform

- Adds ACL query injection in MongoTransform

* Removes adaptiveCollection from DatabaseController

- All collections manipulations are now handled by a DBController
- Adds optional flags to configure an unsafe databaseController for direct
  access
- Adds ability to configure RestWrite with multiple writes
- Moves some transfirmations to MongoTransform as they output specific code

* Renames Unsafe to WithoutValidation
2016-04-14 19:24:56 -04:00
Tyler Brock
51970fb470 Do some triple equals for great justice (#1499) 2016-04-14 15:44:22 -07:00
Tyler Brock
d57e384dcb Apply credential stripping to all untransforms for _User (#1498) 2016-04-14 14:50:16 -07:00
Florent Vilmart
34851c0ae5 Makes sure we don't delete Installations at large when updating a token (#1475) (#1486) 2016-04-14 12:59:59 -07:00
Simonas Karuzas
686cc4ab95 Checking if object has defined key for Pointer constraints in liveQuery
* Removing sessionToken and authData from _User objects included in a query

This bug caused sessionToken to be replaced on client side to some old
sessionToken from DB.

* Removing dangling variable that is never used

* Checking if object has defined key for Pointer constraints in liveQuery

If there is a liveQuery subscription, with Pointer type constrains (e.g
query.equalTo('user', Parse.User.current())), and new object has
undefined value for that field, we get this error:

    error: Uncaught internal server error. [TypeError: Cannot read
property 'className' of undefined] TypeError: Cannot read property
'className' of undefined
    at matchesKeyConstraints
(…/node_modules/parse-server/lib/LiveQuery/QueryTools.js:145:51)
2016-04-14 10:24:04 -04:00
Drew
fc1cdd4408 Remove collection prefix and default mongo URI (#1479)
* Remove collection prefix from DB Controller

* Remove collection prefix from cache

* Revert "Remove collection prefix from cache"

This reverts commit 529d67dd617b64c69c36a8a63382456e95edcab8.

* Remove knowledge of default mongo URI from Parse Server

* Remove adaptive collection paramater from deleteFields

* Tidy up DBAdapter.js
2016-04-13 19:45:07 -04:00
Drew
3fb3ce1ab7 Store collection prefix in mongo adapter, and clean up adapter interface (#1472) 2016-04-13 08:21:53 -04:00
Drew
512251eb58 Move field deletion logic into mongo adapter (#1471) 2016-04-12 22:06:58 -04:00
Florent Vilmart
f312f81cbd Adds support for Long and Double mongodb types (fixes #1316) (#1470)
* Adds support for Long and Double mongodb types (fixes #1316)

* Use bigger numbers
2016-04-12 21:19:47 -04:00
Florent Vilmart
af30f669cc Push status nits (#1462)
* Sets _id to objectId in _PushStatus (fixes #1457)

* _PushStatus stores serialized payload (fixes #1458)
2016-04-12 17:43:46 -04:00
Florent Vilmart
c050a65d49 Schema.js database agnostic (#1468)
* Schema.js database agnostic

* nits
2016-04-12 17:39:27 -04:00
Drew
c419106a38 Remove console.log (#1465) 2016-04-12 10:46:33 -07:00
Drew
99ecbb39f5 Move mongo field type logic into mongoadapter (#1432) 2016-04-12 08:06:00 -04:00
Simonas Karuzas
e9e561f5e8 Removing sessionToken and authData from _User objects included in a query (#1450)
* Removing sessionToken and authData from _User objects included in a query

This bug caused sessionToken to be replaced on client side to some old
sessionToken from DB.

* Removing dangling variable that is never used
2016-04-12 07:57:31 -04:00
Florent Vilmart
73a3db44ab Fixes #1444 (#1451) 2016-04-11 11:27:55 -07:00
Drew
281568edd2 Fixes #1417
* Fixes #1417

* Cleanup

* Perf improvement

* Hoist constant array

* Improve tests
2016-04-08 19:06:52 -04:00
Florent Vilmart
b433fb9b4e Prevents _User lock out when setting ACL on signup or afterwards (#1429) 2016-04-08 13:19:41 -04:00
Steven Shipton
30197a7d84 Expose DatabaseAdapter to simplify application tests (#1121)
* Move helper.clearData to DatabaseAdapter. Expose DatabaseAdapter in index

* fix indentation

* Export DatabaseAdapter in index.js

* Rename clearData to destroyAllDataPermanently. Only export destroyAllDataPermanently from DatabaseAdapter. Update helper

* Expose wrapped TestUtils from index.js. TestUtils exposed select functions from other modules, only in test environment
2016-04-08 10:00:16 -07:00
Florent Vilmart
a770c4cba8 Adds relation fields to objects 2016-04-08 07:42:02 -04:00
Florent Vilmart
c22bafb951 Sets the defaultSchemas keys in the SchemaCollection (#1421)
* Sets the defaultSchemas keys in the SchemaCollection

* Moves defaultSchema injection logic to router

* maps outside the function

* fixes test

* conciseness
2016-04-07 22:13:07 -04:00
Florent Vilmart
bc96f0beb1 Adds X-Parse-Push-Status-Id header (#1412)
* Adds X-Parse-Push-Status-Id header

* Waits for _PushStatus to be stored
2016-04-07 18:08:09 -04:00
Florent Vilmart
cedac3fda6 Adds support for --verbose and verbose option when running ParseServer (#1414) 2016-04-07 18:07:52 -04:00
Blayne Chard
616ac71623 Untransform should treat Array's as nested objects (#1416) 2016-04-07 14:43:48 -07:00
Drew
325d09ca4c Schema format cleanup 2016-04-07 07:47:47 -04:00
Drew
91ace4e718 Progres towards moving mongo logic into its adapter 2016-04-05 21:16:39 -07:00
Florent Vilmart
cbbd66964a Huge performance improvement on roles queries 2016-04-05 20:44:26 -04:00
0xA455
1bd804693c Fix exception with non-expiring session tokens.
Session tokens generated by Parse with with "Expire inactive session" set

to No leave the the expiresAt field undefined. This fixes the TypeError

"Cannot read property 'iso' of undefined'" exception thrown when trying

to use a session token with undefined expiresAt.
2016-04-05 16:12:15 -07:00
Florent Vilmart
1eb2a87f9f Removes GCS Adapter from provided adapters
* 💣 removes exposed GCS files adapter

- Should fix problems with GCS
- Throws error that shows the right repo
2016-04-05 18:18:49 -04:00