Commit Graph

1397 Commits

Author SHA1 Message Date
Greenkeeper
0fd6ce35e2 chore(package): update parse-server-s3-adapter to version 1.0.5 (#2536)
https://greenkeeper.io/
2016-08-19 18:11:51 -04:00
Florent Vilmart
3a08ec9ce8 Adds bcrypt native binding for better login performance (#2549)
* Adds bcrypt native binding for better login performance

* Swaps bcrypt-nodejs for bcryptjs as compatible with bcrypt native

* Fixes package versions
2016-08-19 13:53:57 -07:00
Greenkeeper
9429659d90 chore(package): update mongodb to version 2.2.7 (#2554)
https://greenkeeper.io/
2016-08-19 16:40:02 -04:00
Arthur Cinader
5f67caefde Make parse-server cloud code logging closer parse.com legacy (#2550)
* Make parse-server cloud code logging much to parse.com legacy. (fixes #2501)

1. More closely mimic the wording.  Include the user id.

2. Truncate input and result at 1k char.

3. Use more sensible metadata that would makes sense to index.  The guideline I used was: if it makes sense to filter on, put it in metadata.  If it makes sense to "free text" search on, then put it in the message.

  - file and console output, logging an object does not do what on might expect.  For example, logging a function's "params":

  ```
  expected:

    info: Ran cloud function aFunction for user qWHLVEsbEe with:
      Input: {"foo":"bar","bar":"baz"}
      Result: "it worked!" functionName=aFunction, params= { foo: "bar", "bar": baz }, user=qWHLVEsbEe

  what you actually get:

    info: Ran cloud function aFunction for user qWHLVEsbEe with:
      Input: {"foo":"bar","bar":"baz"}
      Result: "it worked!" functionName=aFunction, foo=bar, bar=baz, user=qWHLVEsbEe
  ```
  - logging highly variable metadata is pretty useless for indexing when logs are sent to a logging repository like elastic search.  In that use case, you want to index stuff you expect to filter on like user, hook type.

  - finally, putting the same input and result data in both the metadata and the message makes each message much larger with no additional value (that I know of anyway :).

4. Change some of the naming of functions in trigger.js to make future work easier.  I was confused about why there were three logging functions in trigger and it took me awhile to get that before hooks and after hooks are logged differently.  I just changed the names to make it obvious at first glance.

5. Add some try/catches to help any future futzers  see syntax errors, etc instead of just hanging.

Some log examples from unit test output:

```
info: Ran cloud function loggerTest for user YUD2os1i5B with:
  Input: {}
  Result: {} functionName=loggerTest, user=YUD2os1i5B

info: beforeSave triggered for MyObject for user nssehQ3wtz:
  Input: {}
  Result: {} className=MyObject, triggerType=beforeSave, user=nssehQ3wtz

info: afterSave triggered for MyObject for user XdznQgTD0p:
  Input: {"createdAt":"2016-08-19T01:11:31.249Z","updatedAt":"2016-08-19T01:11:31.249Z","objectId":"POoOOLL89U"} className=MyObject, triggerType=afterSave, user=XdznQgTD0p

error: beforeSave failed for MyObject for user 7JHqCZgnhf:
  Input: {}
  Error: {"code":141,"message":"uh oh!"} className=MyObject, triggerType=beforeSave, code=141, message=uh oh!, user=7JHqCZgnhf

info: Ran cloud function aFunction for user YR3nOoT3r9 with:
  Input: {"foo":"bar"}
  Result: "it worked!" functionName=aFunction, user=YR3nOoT3r9

error: Failed running cloud function aFunction for user Xm6NpOyuMC with:
  Input: {"foo":"bar"}
  Error: {"code":141,"message":"it failed!"} functionName=aFunction, code=141, message=it failed!, user=Xm6NpOyuMC

info: Ran cloud function aFunction for user CK1lvkmaLg with:
  Input: {"longString":"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus lobortis semper diam, ac euismod diam pharetra sed. Etiam eget efficitur neque. Proin nec diam mi. Sed ut purus dolor. Nulla nulla nibh, ornare vitae ornare et, scelerisque rutrum eros. Mauris venenatis tincidunt turpis a mollis. Donec gravida eget enim in luctus.\n\nSed porttitor commodo orci, ut pretium eros convallis eget. Curabitur pretium velit in odio dictum luctus. Vivamus ac tristique arcu, a semper tellus. Morbi euismod purus dapibus vestibulum sagittis. Nunc dapibus vehicula leo at scelerisque. Donec porta mauris quis nulla imperdiet consectetur. Curabitur sagittis eleifend arcu eget elementum. Aenean interdum tincidunt ornare. Pellentesque sit amet interdum tortor. Pellentesque blandit nisl eget euismod consequat. Etiam feugiat felis sit amet porta pulvinar. Lorem ipsum dolor sit amet, consectetur adipiscing elit.\n\nNulla faucibus sem ipsum, at rhoncus diam pulvinar at. Vivamus consectetur, diam... (truncated)
  Result: {"longString":"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus lobortis semper diam, ac euismod diam pharetra sed. Etiam eget efficitur neque. Proin nec diam mi. Sed ut purus dolor. Nulla nulla nibh, ornare vitae ornare et, scelerisque rutrum eros. Mauris venenatis tincidunt turpis a mollis. Donec gravida eget enim in luctus.\n\nSed porttitor commodo orci, ut pretium eros convallis eget. Curabitur pretium velit in odio dictum luctus. Vivamus ac tristique arcu, a semper tellus. Morbi euismod purus dapibus vestibulum sagittis. Nunc dapibus vehicula leo at scelerisque. Donec porta mauris quis nulla imperdiet consectetur. Curabitur sagittis eleifend arcu eget elementum. Aenean interdum tincidunt ornare. Pellentesque sit amet interdum tortor. Pellentesque blandit nisl eget euismod consequat. Etiam feugiat felis sit amet porta pulvinar. Lorem ipsum dolor sit amet, consectetur adipiscing elit.\n\nNulla faucibus sem ipsum, at rhoncus diam pulvinar at. Vivamus consectetur, diam... (truncated) functionName=aFunction, user=CK1lvkmaLg
```

* Implement PR comments:
- add back params to metadata and add back to the test
- use screaming snake case for conts

* fix typo
2016-08-19 16:39:51 -04:00
Greenkeeper
277df54dc8 chore(package): update pg-promise to version 5.3.1 (#2519)
https://greenkeeper.io/
2016-08-19 11:31:02 -04:00
Florent Vilmart
9ecb9a3595 Postgres: Operations, Hooks, OAuth login, Files support (#2528)
* Adds files related tests through fs-adapter with PG

* Schema deletions implementations

* Adds Hooks spec

* Fix test

* Adds support for containsAll (numbers and strings)

* Better support for deleteFields and deleteClass

* Recursive JSON update for authData

* Adds node_modules to travis cache

* Disable temporarily to make tests pass

* Adds _perishable_token support for _User class

* ignore when a table creation fails at init (table exists)

* Adds support for AddUnique and Remove

* PG 9.4 compatible functions

* Re-enable tests

* nit

* Better handling of schema creation race
2016-08-18 18:05:26 -04:00
Marko Matić
3164b478ea Syncing afterSave/afterDelete trigger calls (Issue #2489) (#2499)
* Implemented syncing afterSave/afterDelete trigger calls with REST request execution flow (Issue 2489). After this change, afterSave and afterDelete triggers CAN return a promise, which needs to be resolved inside a trigger for REST request flow to continue. If trigger doesn't return a promise, request flow continues.

* Added {} to multiline if.

* Fixed bad commit.

* Fixed problem with beforeSave triggers becoming async.
2016-08-17 09:26:42 -04:00
Emilie Montredon
430ae378f2 Updated README.md (#2538)
Created a new email adapter to use Mailjet with parse-server to send email verification and reset password emails.
2016-08-17 09:26:18 -04:00
Arthur Cinader
7616b8d3ec Fix capitalization, typo, and grammar mistake (#2533)
* Fix capitalization, typo, and grammar mistake

* fix two typos.
2016-08-16 16:29:34 -04:00
Héctor Ramos
fc73518b98 Update ISSUE_TEMPLATE.md 2016-08-15 14:07:50 -07:00
Arthur Cinader
24a2416d10 fix typo (#2525) 2016-08-15 16:49:45 -04:00
Florent Vilmart
c0249283ac Advancements with postgres (#2510)
* Start DB runner from tests

* Connect GridstoreAdapter only when needed

* removes unused package

* better test errors reporting

* Adds support for __op.Delete

* Better test error reporting

* Makes sure all tests can run without crashing

* Use xdescribe to skip test suite

* Removes unused dependencies

* Let volatiles classes be created with PG on start

* Do not fail if class dont exist

* adds index.spec.js to the pg suite

* Use a new config each test to prevent side effects

* Enable EmailVerificationToken specs with pg

* Makes sure failure output is not cut

* Reduces number of ignored tests in ParseObject.spec

* Inspect reconfiguration errors

* Mark GlobalConfig is incompatible with PG

- Problem is with nested updates (param.prop = value)

* PG: Nested JSON queries and updates

- Adds support for nested json and . operator queries
- Adds debug support for PG adapter
- Adds loglevel support in helper

* Enable working specs in ParseUser

* Sets default logLevel in tests to undefined

* Adds File type support, retores purchaseValidation specs

* Adds support for updating jsonb objects

- Restores PushController tests

* Proper implementation of deleteByQuery and ORs

- Adds ParseInstallation spec to the test suite

* xit only failing tests

* Nit on ParseAPI spec

* add sorting operator

* properly bound order keys

* reverts describe_only_db behavior

* Enables passing tests

* Adds basic support for relations, upsertOneObject aliased to createObject

* progress on queries options

* Fix ACL update related problems

* Creates relation tables on class creation

* Adds Relation tests

* remove flaky tests

* use promises instead of CB

* disable flaky test

* nits

* Fixes on schema spec

- Next thing is to implemenet geopoint and files correctly

* fix failues

* Basic GeoPoint support

* Adds support for $nearSphere/$maxDistance geopoint queries

* enable passing tests

* drop tables afterEach for PG, clean up relation tables too

* Better initialization/dropTables
2016-08-15 16:48:39 -04:00
Florent Vilmart
2f1ee2186b Makes sure _acl is set as empty {} (#2495)
* regression test for #2465

* Makes sure _acl is set when locked down

- Fixes #2465
2016-08-12 13:15:55 -07:00
Brage G. Staven
e690b73bb5 Stream video with GridStoreAdapter (implements byte-range requests) (#2437)
* Stream video with GridStoreAdapter

* fixing nits. Removing test(Range not accepted as header)

* nit

* Changed names. Added function to check if stream-requirements is fulfilled.
2016-08-12 15:58:18 -04:00
Greenkeeper
122c3fd1a3 chore(package): update lodash to version 4.15.0 (#2506)
https://greenkeeper.io/
2016-08-12 15:55:09 -04:00
Andrew Lane
80de86c8ae Implement Janrain Capture and Janrain Engage auth provider (#2436)
* Janrain engage auth provider
* Modeled after the existing providers in /src/authDataManager/ and also after https://github.com/janrain/Janrain-Sample-Code/blob/master/widget-examples/server.js
* See also: http://developers.janrain.com/overview/social-login/identity-providers/user-profile-data/#normalized-user-profile-data

* Janrain capture auth provider
* Modeled after the existing providers in /src/authDataManager/
* See also: https://docs.janrain.com/api/registration/entity/#entity

* Janrain engage auth provider
* Modeled after the existing providers in /src/authDataManager/ and also after https://github.com/janrain/Janrain-Sample-Code/blob/master/widget-examples/server.js
* See also: http://developers.janrain.com/overview/social-login/identity-providers/user-profile-data/#normalized-user-profile-data

* Janrain capture auth provider
* Modeled after the existing providers in /src/authDataManager/
* See also: https://docs.janrain.com/api/registration/entity/#entity

* Adding missing newlines at EOF
2016-08-12 13:34:24 -04:00
Florent Vilmart
a5a172918e Refactor logging to provide common logger from LoggerAdapter (#2478)
* Refactor logging to provide common logger from LoggerAdapter

Move logger logic de WinstonLoggerAdapter

Further improvements in configuration

Use logger instead of getLogger

- Removes PLog module

Reverts name changes

nits

* Adds additional logging levels as requirements

* Adds tests for logging configuration

* removes flaky test

* investigate...

* further investigation

* Adds silent option to disable console output

* Restores logs with VERBOSE in tests

* Expose controller instead of adapter, reduces method requirements for adapter

* Shuffles initializations around

* Fix doc

* Load cloudCode last to make sure the logger is available

* Adds test to make sure we can load an adapter from npm module

* extract defaults

* Adds defaultMongoURI to defaults

* fix defaults values

* Proper error for PG failures

* Disable flaky test
2016-08-12 10:25:24 -07:00
CongHoang
6e0a25dea0 fix export Bytes data type to JSON (#2409) 2016-08-09 12:05:46 -04:00
Antoine Lenoir
452887bd05 Change pushHash with stringified data (#2397)
* Change pushHash with stringify data

* stringify data.alert for pushHash

* stringify data.alert if object for pushHash

* test push notification when data.alert is an object
2016-08-09 12:00:56 -04:00
MBDeveloper
e6d31a07ab Add function name to the request object - this can help in generic way to log the function calls. (#2309) 2016-08-09 11:28:57 -04:00
Felix Dumit
a87ab6f1c4 Support for validating LinkedIn SDK access_tokens (#2486) 2016-08-09 08:38:22 -04:00
Greenkeeper
cbcd44bd72 chore(package): update lodash to version 4.14.2 (#2485)
https://greenkeeper.io/
2016-08-08 22:13:06 -04:00
Greenkeeper
1a90405fad chore(package): update request-promise to version 4.1.1 (#2483)
https://greenkeeper.io/
2016-08-08 11:58:14 -04:00
Greenkeeper
b6b09e68de chore(package): update babel-core to version 6.13.2 (#2471)
https://greenkeeper.io/
2016-08-07 20:03:11 -07: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
Drew
ae36200d1f Disable tests that don't work in Postgres, and don't start a mongo for postgres tests (#2481)
* Disable tests that don't work in Postgres, and don't start a mongo for postgres tests

* Remove unnecessary chages

* remove more unnecessary chagnes
2016-08-07 22:21:01 -04: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
Greenkeeper
cdb46dcb2e chore(package): update babel-preset-es2015 to version 6.13.2 (#2473)
https://greenkeeper.io/
2016-08-07 18:48:24 -07:00
Greenkeeper
55690254de chore(package): update babel-register to version 6.11.6 (#2400)
https://greenkeeper.io/
2016-08-07 18:48:04 -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
Greenkeeper
36891f4ed7 chore(package): update babel-polyfill to version 6.13.0 (#2459)
https://greenkeeper.io/
2016-08-05 12:54:09 -04:00
Greenkeeper
27cfa9645a chore(package): update babel-preset-es2015 to version 6.13.1 (#2463)
https://greenkeeper.io/
2016-08-05 12:53:57 -04:00
Greenkeeper
e41e3c3202 chore(package): update babel-core to version 6.13.1 (#2462)
https://greenkeeper.io/
2016-08-05 12:28:18 -04:00
Andrew Lane
1a661b73a6 Fix copy/paste error in linked in auth provider (#2468) 2016-08-05 12:11:05 -04:00
Florent Vilmart
d79b478e0b Revert "Update babel-preset-es2015 to version 6.13.0 🚀" (#2469) 2016-08-05 12:10:53 -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
Greenkeeper
eb1b2eb83f chore(package): update babel-plugin-syntax-flow to version 6.13.0 (#2457)
https://greenkeeper.io/
2016-08-04 20:36:18 -07:00
Greenkeeper
f293b1d0a3 chore(package): update babel-preset-es2015 to version 6.13.0 (#2460)
https://greenkeeper.io/
2016-08-04 20:35:55 -07:00
Greenkeeper
01df251847 chore(package): update gaze to version 1.1.1 (#2461)
https://greenkeeper.io/
2016-08-04 20:35:47 -07:00
Greenkeeper
3044a382d6 chore(package): update babel-polyfill to version 6.9.1 (#2454)
https://greenkeeper.io/
2016-08-04 20:35:37 -07:00
Greenkeeper
62caea6c28 chore(package): update parse to version 1.9.1 (#2452)
https://greenkeeper.io/
2016-08-04 17:00:47 -07:00
Steven Shipton
4dda71698b Fix test:win for windows. Move coverage from test:win to coverage:win. Fix test on windows bash (#2453) 2016-08-04 23:18:52 +02:00
Greenkeeper
f5755e8f73 chore(package): update multer to version 1.2.0 (#2449)
https://greenkeeper.io/
2016-08-04 12:13:38 -07: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
Greenkeeper
5865d59b5a chore(package): update request-promise to version 4.1.0 (#2426)
https://greenkeeper.io/
2016-08-04 10:27:58 -07:00
Florent Vilmart
946f8a3872 fix typo when logging result (#2443) 2016-08-04 10:27:47 -07:00
Greenkeeper
f1c9d97d2f chore(package): update pg-promise to version 5.2.7 (#2433)
https://greenkeeper.io/
2016-08-03 16:44:31 +02:00