Commit Graph

53 Commits

Author SHA1 Message Date
Drew Gross
71ae7bee94 better names and comments 2016-04-26 13:08:58 -07:00
Drew Gross
449ca115b1 Break object deletions's dependency on schemaController 2016-04-26 10:23:14 -07:00
Drew Gross
d4bd21fcbc remove schema from transformWhere 2016-04-26 10:20:17 -07:00
Drew Gross
a926712951 Start using parse format schema in transformQueryKeyValue 2016-04-26 10:12:45 -07:00
Drew Gross
874d10fc74 Check expected type is array from Parse Format Schema 2016-04-25 23:36:25 -07:00
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
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
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
Nikita Lutsenko
a163327ac9 Remove usages of non-adaptive collection inside DatabaseController. 2016-03-08 00:53:51 -08:00
Nikita Lutsenko
f2ead46580 Remove .rawCollection method from DatabaseController. 2016-03-07 17:22:27 -08:00
Nikita Lutsenko
fa6954169e Migrate ParseGlobalConfig.spec to new database storage API. 2016-03-07 14:11:43 -08:00
Nikita Lutsenko
172da3aaa3 Move HooksController to use MongoCollection instead of direct Mongo access. 2016-03-04 19:21:34 -08:00
Nikita Lutsenko
244009923f Add findOneAndUpdate to MongoCollection. 2016-03-02 00:29:18 -08:00
Nikita Lutsenko
e39286d88b Implement findAndDelete in MongoCollection and move SchemasRouter to it. 2016-03-02 00:28:37 -08:00
Nikita Lutsenko
9538a7dab5 Make parts of SchemasRouter use adaptiveCollection. 2016-03-01 22:36:23 -08:00
Nikita Lutsenko
49994b6e87 Add MongoCollection and adaptiveCollection abstraction to MongoAdapter. 2016-03-01 22:36:23 -08:00
Nikita Lutsenko
2733c0924b Remove direct mongo access from Schema.spec.js. 2016-02-29 19:47:08 -08:00