Commit Graph

592 Commits

Author SHA1 Message Date
Bhaskar Reddy Yasa
cf6ce5b9a3 Adding support for optional Password Policy (#3032)
* adds resetTokenValidityDuration setting

* adds a validator to validate password that can be used to enforce strong
passwords

* adds unit tests for passwordPolicy.validator

* adds unit tests to to fail reset password function if password is not in a valid format

* updates README.md for passwordPolicy

* prevents duplicate check for password validator in updateUserPassword

* adds optional setting to disallow username in password

* updates test cases to use fdescribe instead of describe

* updates test cases to use request-promise instead of request

* adds ability to use a RegExp or Callback function or both for a passwordPolicy.validator

* expect username parameter in redirect to password_reset_success

* adds support for _perishable_token_expires_at in postgres
2016-11-17 08:37:51 -08:00
steven-supersolid
7b5f89e037 Fix bug.
Add similar tests for live query definitions
2016-11-14 16:23:31 +00:00
steven-supersolid
7bc83c372d nit: style 2016-11-14 15:14:48 +00:00
steven-supersolid
28c1824394 Add rudimentary test for cli definitions.
Use consistent import and quote style.
2016-11-14 14:59:00 +00:00
jb
19271fa1ef Adding support for AfterFind (#2968) 2016-11-12 12:35:34 -05:00
Tyler Brock
e9dfb68a37 Add support for maxTimeMS mongoOption (#3018) 2016-11-11 08:03:35 -08:00
Steven Shipton
5082609937 Allow numberOrBooleanParser to parse string correctly. Improve error message in numberParser. Add env variable PARSE_SERVER_CLUSTER for cluster. Add tests (#3034) 2016-11-11 09:40:45 -05:00
Halim Qarroum
9abf17730f Injected the username when password has changed. (#3033)
* Injected the username when password has changed.

When the resetPassword controller has successfully updated the user's password, it now redirects the user to the password changed page with the username as a query parameters.

* Update unit test for password_reset_success redirect
2016-11-10 12:40:17 -05:00
Kirill Kravinsky
908c48098a Add health-checking endpoint on '/health' that always returns 200 (#2992)
* Add health-checker endpoint on '/health' that always returns 200OK

* Refactor health handler, add tests

* Refactor health test
2016-11-02 20:33:59 -04:00
Steven Shipton
b347bff641 Add option to re-use schema cache between requests (#2979)
* Add option to reuse database controller between requests. Clear schema cache when deleting everything

* Add test

* Rename setting to persistSchemaCache to more accurately reflect effect

* Repurpose option to determine whether to randomize cache prefix. Restore Config.js controller creation. Add tests

* Fix bug with missing parameter passed to to SchemaCache

* Renaming and formatting

* Fix property name typo

* Rename option to avoid double negative and still be falsey by default. Style fix
2016-11-02 19:05:23 -04:00
Tyler Brock
f3c656829a Use spec reporter instead of dots (#2989) 2016-11-02 08:39:09 -04:00
Kulshekhar Kabra
583887c43c Improve update of jsonb fields. Add PG 9.5 to travis. (#2984)
* Improve update of jsonb fields. Add PG 9.5 to travis.

* Replace manual escaping with pg-promise's built in
2016-11-01 20:55:53 -04:00
Kulshekhar Kabra
8f0ae7081d Enable a few tests to test against Postgres (#2971)
* Enable RestCreate related tests for Postgres

* Enable tests in ParseRole for postgres

* Enable one ParseObject test for postgres

* Improve the way a jsonb field is updated.

* Use Postgres 9.5 in Travis

* Install Postgres 9.5 in Travis

* Use sudo to install and setup Postgres 9.5 in Travis

* Test if Postgres 9.5 can be used with trusty

* Re-exclude a test for postgres

* Revert travis to its original form
2016-11-01 07:30:22 -04:00
Kulshekhar Kabra
78646a3e91 Enable API related tests for Postgres (#2970) 2016-10-31 12:11:21 -04:00
Kulshekhar Kabra
edf6ab6875 Enable query related tests for Postgres (#2969) 2016-10-31 12:10:53 -04:00
Kulshekhar Kabra
b6c19a53ee Fix endsWith query test to use the correct query (#2965) 2016-10-31 08:12:58 -04:00
Florent Vilmart
48865c765f Adds ability to update a subscription (#2935)
* Adds ability to update a subscription

* Adds unsubscribe to the RequestSchema, makes sure to not fire unsubscribe to the client when updating

* Fix failing tests

* More extensive tests

* fix annotation
2016-10-31 08:12:11 -04:00
Michael Helvey
94178df4d2 Add functionName to invalid function error (#2963)
Currently in the logs if an invalid function is called the error
message just says "invalid function" which is decidedly unhelpful
when looking through server logs.  Now it will say
"Invalid function: "functionName""
2016-10-30 11:58:34 -04:00
Florent Vilmart
23b77f7261 Live query pubsub adapter (#2902)
* Moves LiveQuery pub/sub to adapter folder

* Adds ability to provide custom adapter for LiveQuery pubsub

* Adds test for function based adapter

* Pass all options to createSubscriber

* nits
2016-10-28 12:06:35 -04:00
Kulshekhar Kabra
4a5ed1095c Allow the URI for the test DB to be set via env (#2954) 2016-10-28 09:11:07 -04:00
Steven Shipton
e788d49af0 Don't require all keys to be configured to enable key checks (#2816) (#2941)
* Add tests. Fail request if any of the 4 optional keys does not match

* Only require one key to be supplied in the request, except when no keys are configured

* Use const over let, var
2016-10-26 16:44:39 -04:00
Steven Shipton
151bea25ee Try to retrieve schema from all schemas cache if not found in individual cache (#2912)
* Try to get schema from main schema if not found in single schema

* Add newline

* Add missing return

* Add missing done to tests
2016-10-23 11:59:39 -04:00
Aaron Blondeau
af55cd1efb Add role based ACL checks to LiveQuery (#2893)
* Add acl role check to _matchesACL, start adding tests.

* Add tests for ACL role checks in LiveQueryServer.

* Switch to arrow functions, add immutabalized code from @acinader, swap for loop style.
2016-10-21 23:53:31 -04:00
Florent Vilmart
86f35014f4 Fixes #2780 (#2810)
* Adds regression test for #2780

* Fixes #2780

- Make sure we compare installationId from the data and not the auth when rejecting update
2016-10-19 19:54:19 -04:00
Jeremy Louie
a6a6f7ff60 Fix error when updating installation with useMasterKey (#2888)
* Add failing test for updating installations with masterKey

* Prevent auth.installationId from being used when using masterKey

This allows masterKey to update any installation object
Fixes ParsePlatform/parse-server##2887
2016-10-19 15:06:19 -04:00
Jeremy Louie
b88b0c578f Fix multiple use of notEqualTo (#2882)
* Add failing test for multiple .notEqualTo on relation with same class

* Fix multiple .notEqualTo on relations with the same class

Multiple  should use the union of all objectIds not the intersect
Fixes ParsePlatform/parse-server#1596
2016-10-18 16:44:47 -04:00
Kulshekhar Kabra
de36d9640b Allow configuration options for Postgres (#2873)
* Allow configuration options for Postgres

* Fix the use of incorrect options object.

* Refactor and test the postgres config parser.

* Remove unnecessary try/catch

* Remove unnecessary try/catch

* Add blank line at the end of the test file

* Rename file for consistency purposes
2016-10-15 17:29:54 -04:00
Florent Vilmart
6979bb430b Properly handle select/include pairs #2786 (#2809)
* Regression test for 2786

* Fix issue affecting selcting/including keys
2016-10-07 09:33:55 -04:00
Florent Vilmart
954a8a4159 Better support for null values in arrays (#2777)
* Adds reproduction for #2752

* Make sure we support null values in arrays of pointers for inclusion
2016-09-26 13:26:06 -04:00
Florent Vilmart
b5af4d017c Makes sure pointer includes are interpolated as get (#2747)
* test for repro #2005

* Adds ability to override CLP op from RestQuery.execute

* nits
2016-09-24 14:54:31 -04:00
Florent Vilmart
2ec2bb5660 Removes dependency upon babel-polyfills (#2731)
* Removes runtime dependency babel-polyfill (#2692)

* Removes runtime dependency babel-polyfill

* removes references to polyfilled array includes

* Better support for polyfilling

* Removes unnecessary log

* Adds killswitch if tests are polyfilled

* Reverts usage of includes on strings
2016-09-24 13:53:15 -04:00
Florent Vilmart
3ba6e613b3 Adds repro for #1931 (#2735) 2016-09-24 13:53:04 -04:00
Florent Vilmart
4dcefd6386 Repro for issue #1944 (#2736) 2016-09-24 13:47:44 -04:00
Florent Vilmart
9c522be00d Support for nested .select() calls (#2737)
* Reproduction for #1567

* Recursive handling of nested pointer keys in select

* Better support for multi-level nested keys

* Adds support for selecting columns natively (mongo)

* Support for postgres column selections

* Filter-out empty keys for pg
2016-09-24 13:43:49 -04:00
Florent Vilmart
d4593931db Makes sure we plumb auth.installationId when updating installations (#2739) 2016-09-24 13:42:36 -04:00
Arthur Cinader
a41cbcbc7f Move password masking out of logging clients where possible (#2762)
Move password masking functionality into LoggerController.

The is a more aggresive approach to masking password string in the logs.

Cleaning the url is still in the PromiseRouter because picking it out of the log string
would be fragile.

This will cause more log messages to be scanned for password strings, and may cause a password
string to be obsfucated that is not neccesarily part of parse internals -- but i think that is
still a good thing....

see: #2755 & #2680
2016-09-22 15:05:54 -04:00
Florent Vilmart
ad707457be Obfuscate password name value pairs in log strings (#2755)
* Unit test to catch password in logs.

* Add clean to logger controller to "look for" password strings in log messages.
2016-09-20 21:45:24 -04:00
Florent Vilmart
e30989c7d3 Lookup for email in username field to match docs if email is undefined (#2732)
* Lookup for email in username field to match docs if email is undefined

* Adds support for sendMail option to when email is selected

* Proper does not exists clause
2016-09-18 18:32:34 -04:00
Florent Vilmart
263ca5e052 Adds CloudCode handler for beforeFind (#2715)
* Adds CloudCode handler for beforeFind

- Allows cloud code to modify a query before it is run
- Works with promises for a safer environment
- Supports modifiying the current query
- Supports issuing new queries

* Adds test for cornercase empty queries from rest

* Makes sure restOptions is always definied
2016-09-17 13:52:35 -07:00
Florent Vilmart
ddb0fb8a27 Adds redis cache for distributed environments (#2691)
* Makes schemaCache clearning promise-based

* Adds redis cache adapter for distributed systems

* Adds redis service to travis

* allow pg to fail
2016-09-17 13:52:02 -07:00
Florent Vilmart
109bc9a0ce handling matching api.parse.com when calling upgradeToRevocableSession without a sessionToken (#2721) 2016-09-17 12:52:52 -07:00
Steven Shipton
0773523bc2 Ensure _acl is updated when _rperm and _wperm updated (#2701)
* Ensure _acl is updated when _rperm and _wperm updated

* alternative solution

* Only try to apply $set for permission updates
2016-09-17 11:05:33 -04:00
Florent Vilmart
ac348f5c4f Reverts calling next() after handling response (#2634)
* Revert "Makes sure routes don't overlap and yield a header set error"

* removes next() calls in PromiseRouter

* Reverts calling next() after response

* Adds fail calls when next() calls traverse tests
2016-09-09 17:28:41 -04:00
Florent Vilmart
7f6fb11d78 Revocable session upgrade only on mongo (#2685)
* Revert "Tries a new travis configuration"

* Revocable session upgrade only on mongo
2016-09-09 17:02:15 -04:00
Florent Vilmart
cb7b54941b Direct Access to parse-server (#2316)
* Adds ParseServerRESTController experimental support

* Adds basic tests

* Do not create sessionToken when requests come from cloudCode #1495
2016-09-09 15:18:37 -04:00
Florent Vilmart
340eb46fe1 Adds endpoint for non-revocable session token upgrade (#2646) 2016-09-09 14:48:06 -04:00
Florent Vilmart
c5fdd91aa3 Makes sure we don't duplicate user ACL's keys (#2651)
* Adds repro for issue #2246

* Provide fix for issue #2246

* Nit with Set to deduplicate the acl array

* remove debuging console.log
2016-09-09 14:43:59 -04:00
Florent Vilmart
e8aa1ad312 Fix null pointer includes (#2657)
* Adds failing test for #2189

* Improves support for null values in includes

* nit
2016-09-09 14:41:21 -04:00
Florent Vilmart
fc576cb415 Adds more expressive schema mismatch errors (#2662) 2016-09-09 14:41:11 -04:00
Florent Vilmart
364604e181 Run Schema validations after beforeSave #2672 (#2677)
* Adds test to repro #2672

* Run schema validation after beforeSave is run

* Makes authData part of base _User object

* exclude flaky pg test
2016-09-09 14:41:03 -04:00