Commit Graph

751 Commits

Author SHA1 Message Date
Felix Dumit
a87ab6f1c4 Support for validating LinkedIn SDK access_tokens (#2486) 2016-08-09 08:38:22 -04:00
Florent Vilmart
fc3ebd0bd0 Style improvements (#2475)
* HooksRouter is enabled by default

* Adds middleswares on PromiseRouter, fixes #2410

* Move testing line to helper

* Modernize middlewares.js

* Moves DB uniqueness initialization to DBController, modernize

* Moves testing related code to spec folder

* remove unused _removeHook function

* Adds tests, docs for Analytics and improvements

* nit

* moves back TestUtils
2016-08-07 20:02:53 -07:00
Jeremy Louie
f27dff0ae6 Handle queries with equalTo on objectId and relation conditions (#2472)
* Add test for notEqualTo on relation with equalTo on objectId

* Properly handles queries with equalTo on objectId and relation conditions

This is done by converting shorthand $eq condition to $eq condition instead of clobbering.
2016-08-07 18:58:32 -07:00
Vitaly Tomilov
39078e8a2b Improving use of query methods. (#2353)
Improving use of query methods.
2016-08-06 13:24:42 -04:00
Arthur Cinader
fa736f1df7 Allow logger to add transports (#2363)
- Move all of the winston logic from FileLoggerAdapter to WinstonLoggerAdapter
- Export WinstonLoggerAdapter so it can be sublcassed
- Expost the ability to add adittional transports to logger
- Import FirehoseLoggerAdapter alongside other adapters so it can be configured.
2016-08-06 08:29:19 -04:00
Andrew Lane
1a661b73a6 Fix copy/paste error in linked in auth provider (#2468) 2016-08-05 12:11:05 -04:00
sud
e4c2e65263 Non trivial before save pointer clobber (#2406)
* test case to check beforeSave changes clobbers fetched pointer fields
Basically if beforeSave makes any changes to the object it is trying to save, the fetched pointer fields on the client gets clobbered to only pointer.

* propogate only changed fields to response.
Earlier we were returning all fields even if any changes happened in beforeSave. This causes the fetched pointer fields on the client to get clobbered to only pointers.
This fix returns only the changed fields thus avoiding pointer clobber.

* The goal of this comparision seems to be checking that the all returns the user correctly.
Also it is consistent with the hosted parse that user.username not returned from PUT request.
2016-08-05 08:53:54 -04:00
Dharam Gollapudi
115fd7278c Remove unused imports (#2403)
Remove the unused imports, as they are now part of logger.js
2016-08-04 10:31:03 -07:00
Dharam Gollapudi
eee11a7acb Remove unused imports (#2404)
Remove unused imports, as it is now part of ClassesRouter.js
2016-08-04 10:30:00 -07:00
Steven Van Bael
8d8192bbcc Add Content-Length header to HTTP response in FilesRouter (#2408) 2016-08-04 10:29:10 -07:00
Florent Vilmart
946f8a3872 fix typo when logging result (#2443) 2016-08-04 10:27:47 -07:00
Florent Vilmart
15a07859b0 Make sure _PushStatus operations are run in order (#2367) 2016-07-23 12:20:04 -07:00
Florent Vilmart
7964d0a999 Adds support for multiple twitter auths options (#2256)
* Adds support for multiple twitter auths options

* Adds user test
2016-07-23 12:02:45 -07:00
Florent Vilmart
c9fc80984a Makes sure we don't strip authData or session token from users using masterKey (#2348)
* Makes sure we don't strip auth data or session token from users queried with masterKey (#2342))

* nit: test title
2016-07-23 11:14:53 -07:00
Florent Vilmart
3b2da1d734 Cloud code logs (#2370)
* Adds logging (info/error) when running cloudCode triggers

* Adds logs for cloud-function calls

- Match parse.com original logging
2016-07-23 11:10:06 -07:00
Simonas Karuzas
93b41170fd LiveQuery constrains matching fix (#2357)
* 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)

* LiveQuery constrains matching fix

When constrains == null, we get “Uncaught internal server error”
2016-07-22 21:27:52 -07:00
Andrew Lane
a60c3f48ce Typo fix for error message when can't ensure uniqueness of user email addresses (#2360) 2016-07-22 21:27:01 -07:00
Florent Vilmart
09bd9e3b2c Adds schema caching capabilities (5s by default) (#2286)
* Adds schema caching capabilities (off by default)

* Use InMemoryCacheAdapter

* Uses proper adapter to generate a cache

* Fix bugs when running disabled cache

* nits

* nits

* Use options object instead of boolean

* Imrpove concurrency of loadSchema

* Adds testing with SCHEMA_CACHE_ON

* Use CacheController instead of generator

- Makes caching SchemaCache use a generated prefix
- Makes clearing the SchemaCache clear only the cached schema keys
- Enable cache by default (ttl 5s)
2016-07-22 21:23:59 -07:00
Andrew Lane
397e6bc976 Fix typo in logging for commander parseConfigFile (#2352) 2016-07-20 16:08:22 -04:00
Blayne Chard
c8e1ab851f Run next() after successfully sending data to the client (#2338)
This allows developers to add express handlers for successful completion of parse-server requests.
ie Analytics or Logging.
2016-07-20 09:28:20 -04:00
Marek Mikołajczyk
d1a6caeee3 Allow usage of analytics adapter (#2327)
* Allow usage of analytics adapter

* Use promises in controller
2016-07-20 09:27:15 -04:00
Florent Vilmart
dfac9725dd Update Mongodb client to 2.2.4 (#2329)
* chore(package): update mongodb to version 2.2.4

https://greenkeeper.io/

* fix for mongo 2.2.4

* Delete schema promise on error...

- Just because this way we can let the adapter an opportunity to yield a new error....
OR A SUCCESS

* Fixes test

* Restore fix
2016-07-19 21:40:01 -04:00
Florent Vilmart
8719afdc1b Parses correctly Parse.Files and Dates when sent to Cloud Code Functions (#2297)
* fix for #2294

* fail tests

* Makes sure dates are compatible with Parse.com CloudCode #2214

* Adds regression tests for #2204
2016-07-18 23:14:32 -07:00
Florent Vilmart
4f89ec39cd Uses one query for installation dedup (#2281) 2016-07-18 23:12:29 -07:00
Diwakar Cherukumilli
6f292059ba Adds ability to expire email verify token (#2216) 2016-07-18 23:10:36 -07:00
Florent Vilmart
033bc317e6 Report validation errors with correct error code (#2299) 2016-07-18 23:03:43 -07:00
Dan Huang
c81f48aae6 don't serve null authData values (#2320) 2016-07-18 23:00:16 -07:00
Florent Vilmart
025482ea1a Fix null relation problem (#2319)
* Add null check for relation type map.

For relations that are not explicitly defined in the schema, we need a null check here.

* Making change to force rebuild.

* Reverting change.

* Adds test
2016-07-18 22:58:37 -07:00
Mihai Iorga
676d2e28de pushStatusHandler wrong payload md5, PushController send pushId to adapter also (#2067) 2016-07-18 19:39:28 -04:00
Florent Vilmart
bae19f2c76 Clear the connectionPromise upon close or error (#2314) 2016-07-18 11:51:50 -04:00
Vitaly Tomilov
fa96f0c389 Adding proper generic Not Implemented. (#2292)
Proper way to generate common Promise rejects.
2016-07-15 20:32:06 -04:00
Sen Palanisami
7d234e054b Log objects rather than JSON strings and option for single line logs (#2028)
* Log objects rather than JSON strings and option for single line logs

This reverts commit fcd914bdfd.

* Better password stripping tests
2016-07-15 16:18:50 -04:00
Florent Vilmart
069275d3df Fix for #1840, Strip operations from results, forwards delete operations to SDKs (#1946)
* Adding a test demonstrating issue #1840.

* Fixes #1840

* Adds failing test with other use case

- That test fails on parse.com as well

* Bumps parse to 1.9.0

* exclude pg db

* Exclude pg on other test

* Adds clientSDK compatibility check for forward deletion

- Mark js1.9.0 as compatible

* Strips all operations from result

- fix for #1606
2016-07-15 09:24:53 -04:00
Ran Hassid
fcfe2a0376 add digits oauth provider (#2284) 2016-07-15 09:23:42 -04:00
Blayne Chard
1125c88f56 Adding request headers to cloud functions fixes #1461 (#2274) 2016-07-13 19:41:05 -04:00
Florent Vilmart
9bf21ef093 Restores ability to include non pointer keys (#2263)
- Matches the behaviour on parse.com
- fixes #2262
2016-07-13 09:14:54 -04:00
Florent Vilmart
32f7230aca Creates a new sessionToken when updating password (#2266)
* Creates a new sessionToken when updating password

* Adds test ensuring email is properly sent when upgrading from anon
2016-07-13 07:18:24 -04:00
Nikita Lutsenko
18235352c4 Merge pull request #2259 from ParsePlatform/client-sdk-info
Exposes the ClientSDK infos if available
2016-07-12 11:17:52 -07:00
Magda Wiśniewska
3c1da3cc2a Allow next middleware handle error in handleParseErrors (#2260) 2016-07-12 12:32:10 -04:00
Greenkeeper
868ad5bdfd Update parse to version 1.9.0 🚀 (#2233)
* chore(package): update parse to version 1.9.0

https://greenkeeper.io/

* Removes Hooks client API as provided by node SDK
2016-07-12 10:09:16 -04:00
Florent Vilmart
2498a954ce Exposes clientSDK into RestQuery, RestWrite and rest 2016-07-12 10:06:13 -04:00
Florent Vilmart
a040aafcd8 Adds parser for SDK version 2016-07-12 09:20:00 -04:00
Valery Vaskabovich
7a2e906202 validate_purchase fix for SANDBOX requests (#2253)
* Fixed routing for validate_purchase method

* Fixed validate_purchase endpoint
2016-07-11 19:38:42 -04:00
OzgeAkin
6dc8d287d6 Option to ignore parse file storage (#2222)
* flag in configurations to use only files adapter

* added lib folder

* remove lib

* alignment edit

* replace comma with semicolon

* ignore parse file storage if fileKey is not provided (undefined)
2016-07-10 10:15:30 -07:00
Drew
6ca1351b8f Revert "Update PostgresStorageAdapter.js" (#2241) 2016-07-08 22:52:14 -07:00
Vitaly Tomilov
a92b23b97d Update PostgresStorageAdapter.js (#2093)
If it really needs to reject with `undefined`, then this is the right way. Usually one just returns the result, let the caller provide the `.catch` ;)

This way real errors can be swallowed, not very good ;)
2016-07-08 22:51:22 -07:00
Florent Vilmart
a55466fde8 Fixes #2221: Nested Or queries (#2231)
* Adds repro for #2221

* Fixes nested or queries

* not for PG yet
2016-07-08 22:03:13 -07:00
Florent Vilmart
61aa5a8d62 Let auth data be updated on login (#2219)
* Let user update authData token upon login

* Adds tests that ensures linked authData isnt overriden

* fixes focused testing problem
2016-07-08 21:49:46 -07:00
Blayne Chard
8338783075 Adding more information to the permission denied error (#2210) 2016-07-07 11:30:29 -04:00
Tyler Brock
2f2ff377eb Better e-mail adapter testing (#2208) 2016-07-05 12:08:46 -07:00