Commit Graph

106 Commits

Author SHA1 Message Date
Drew Gross
4371ca164c Pass parse format schema to transformWhere 2016-04-25 22:45:16 -07:00
Drew Gross
5cbf3eb8dd Tidy up db controller 2016-04-25 22:01:50 -07:00
Drew Gross
37953d146b some cleanup 2016-04-25 21:53:57 -07:00
Drew Gross
a3179e43fb No need to handle object or reject arrays when transforming queries 2016-04-25 21:13:34 -07:00
Drew Gross
7b431ad064 nits 2016-04-25 20:54:47 -07:00
Drew Gross
ee8a3c94d5 No need to transform post-transform keys in mongo adapter 2016-04-25 20:42:19 -07:00
Drew Gross
e2a3213351 Remove update logic from query 2016-04-25 19:34:07 -07:00
Drew Gross
5c7b346292 Remove unnecessary logic 2016-04-25 18:48:22 -07:00
Drew Gross
e0a9f19895 Split logic for transforming queries into it's own function 2016-04-25 18:22:20 -07:00
Drew Gross
21e73ac276 Destructuring 2016-04-25 17:21:24 -07:00
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
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
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
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
Blayne Chard
54b21c2f73 Compress the ACL queries into a single $in query (#1566) 2016-04-20 09:03:44 -04: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
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
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
c050a65d49 Schema.js database agnostic (#1468)
* Schema.js database agnostic

* nits
2016-04-12 17:39:27 -04:00
Drew
99ecbb39f5 Move mongo field type logic into mongoadapter (#1432) 2016-04-12 08:06:00 -04: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
5c1fe3a325 Better logging with winston 2016-03-28 20:16:58 -04:00
Florent Vilmart
8731337677 removes onesignal 2016-03-25 14:20:12 -04:00
Florent Vilmart
f2f7c8bad3 ParsePushAdapter is a package 2016-03-25 13:36:52 -04:00
Drew Gross
b4ee31322e Fix tests 2016-03-24 14:42:45 -07:00
Drew Gross
152c7e88b8 Move mailgun adapter to it's own repo 2016-03-24 14:42:10 -07:00
Drew Gross
2f00a02936 Document email adapter 2016-03-24 14:41:13 -07:00
Florent Vilmart
83f5207d44 remove inaccurate comment 2016-03-24 14:15:00 -04:00
Florent Vilmart
1e45ac753a Moves Files adapters to external packages 2016-03-24 00:48:34 -04:00
Tsolis Dimitris Sotiris
e4e7e42c65 Add FileSystemAdapter file adapter 2016-03-20 21:35:42 +02:00
Benjamin Woodruff
14d3062602 Merge pull request #986 from ParsePlatform/mongo-uri-encode-auth
Add URI encoding to mongo auth parameters
2016-03-17 09:46:21 -07:00
Benjamin Woodruff
530fad5a58 Move mongoUrl to src/vendor
And add a README to src/vendor
2016-03-16 14:54:52 -07:00
Benjamin Woodruff
836582fdb1 Fix failing tests for uri encoding auth
This uses a *slightly* patched version of node's uri module to allow
commas and colons in hostnames, which causes the parsed representation
of replica sets to be less-awful.

Hostname are still somewhat broken in this representation, because we
have an array of hosts expressed as a list, but this is the
minimum-effort solution to getting format to be able to reprint a parsed
replica set correctly.

I understand that we probably don't want to merge this (for a lot of
reasons), but at least this shows exactly where the issue is, and yields
some useful discussion.
2016-03-16 14:31:44 -07:00
Benjamin Woodruff
a30c81745a Add URI encoding to mongo auth parameters
The mongodb driver requires auth values be URI encoded:
044063097d

This uses node's built-in url module to encode the auth portion, by
parsing and re-formatting it, which causes special characters to get URI
encoded properly:
https://nodejs.org/api/url.html#url_escaped_characters

This is all a bit silly since mongodb just takes our passed uri, and
runs it through the same url parser again, but not before explicitly
erroring on '@' characters in the uri.

This is similiar to #148 (reverted by #297), but with much less code,
and hopefully less breakage. Also, note that `uri_decode_auth` is no
longer needed. That was removed in the above referenced
node-mongodb-native commit.

I've tested this on usernames and passwords with @, !, +, and a space.

Presumably this would also work with usernames and passwords that are
already URI encoded (since parseUrl will simply unescape it, and
formatUrl will escape it again).
2016-03-16 14:31:44 -07:00
Florent Vilmart
7c387e1ee9 Adds support to store push results 2016-03-13 23:37:13 -04:00
Florent Vilmart
dad50d12f5 Upgrade APNS to use HTTP/2
- uses universal certificate
- removes tests logs
- standardized returned promises from APNS and GCM to something usable in _PushStatus
2016-03-13 18:15:15 -04:00
Florent Vilmart
a392c088d8 Uses the resolved promise from the adapter 2016-03-12 15:30:12 -05:00
Florent Vilmart
4d401d9daa Stores the _PushStatus when sending push, set pending, and running states 2016-03-12 14:32:39 -05:00
steven-supersolid
dbf2afc5ea Add database options to ParseServer constructor and pass to MongoStorageAdapter 2016-03-10 16:49:45 +00:00
Nikita Lutsenko
d86f0a8c69 Use schema collection instead of adaptive collection for all schema operations. 2016-03-09 15:21:29 -08:00
Nikita Lutsenko
2730398b92 Add new MongoSchemaCollection class that manages schemas for all collections. 2016-03-09 15:20:59 -08:00
Nikita Lutsenko
fb5b8fb58f Migrate Schema.js to adaptive mongo collection. 2016-03-08 00:53:51 -08:00