Commit Graph

613 Commits

Author SHA1 Message Date
Florent Vilmart
a9067260fc adds ability to pass custom installationId to create sessions in cloud code (#3156) 2016-12-06 16:46:09 -05:00
Florent Vilmart
2e569ca7dd Fixes SchemaController data for Volatile Classes (#3171)
* Reproduction for the issue

* Ensures Volatile classes and other schema share the same structure
2016-12-06 16:42:54 -05:00
Arthur Cinader
8111c3338e turn on max empty line rule with default of max: 2. (#3176)
Run with fix.
2016-12-06 13:35:23 -08:00
Florent Vilmart
fb36dfa26f Fix #3185 (#3186)
* Adds tests that reproduce the issue

* Use values from keys to force include when needed
2016-12-06 16:28:55 -05:00
Florent Vilmart
e0704b440c Adds class level permission requiring authenticated user (#893)
* Adds class level permission requiring authenticated user

* Updates to latest schema permissions syntax

* fix flaky test

* Exclude PG

* Rebased and nitted

* lints
2016-12-02 19:47:33 -05:00
Arthur Cinader
01b05b060f Strip personally identifiable information from user table for unauthorized users.
- add a config option to explicitly enumerate pii fields beyond email
- in query controller, strip pii of user table results before sending out the door.
2016-12-02 19:39:09 -05:00
Arthur Cinader
a270632570 More lint tweaking (#3164)
1. Add no space in paren rule
2. fix spec/eslintrc.json so it allow for inheriting from root rc.

Because the spce rc specified reccomended, it "turned off" all of the
rule tweaks in the root.  This fixes that.
2016-12-02 19:11:54 -05:00
Arthur Cinader
37daafc7b0 Add strip whitespace and trailing eol to spec too. (#3159) 2016-12-01 21:45:49 -05:00
Arthur Cinader
7292fa7f11 Allow select (keys) to be altered in triggers (#3146)
Inspect the keys when a query is returned from a trigger and respect the new
value.
2016-12-01 10:04:47 -05:00
Steven Shipton
143bd11638 Change arg check from truthy to defined (#3143)
Show log on master when using cluster
2016-11-30 08:48:49 -05:00
Bhaskar Reddy Yasa
bd1689190f Adds password history support to passwordPolicy (#3102)
* password history support in passwordPolicy

* Refactor RestWrite.transformUser

* fix eslint issues
2016-11-29 09:01:52 -08:00
Florent Vilmart
6676c6a4b9 Let multiple installations be updates if no critical values are set (#3040)
* Let multiple installations be updates if no critical values are set

* nits
2016-11-28 13:11:54 -05:00
Antonio Davi Macedo Coelho de Castro
6264f99ad5 Concat appId to PubSub channel (#3043) 2016-11-28 09:15:21 -05:00
Yuki Takeichi
85567310d4 Ignores createdAt when update (#3111) 2016-11-25 09:20:06 -05:00
David Poetzsch-Heffter
8f1c1f419b fixing equals on array columns in live query (#3089) 2016-11-24 20:42:53 -05:00
Florent Vilmart
d800ff85e2 Enhanced support for batch endpoints (#3042)
* Allow to have different endpoint on publicserverURL and serverURL when batching

* nits
2016-11-24 20:14:12 -05:00
Florent Vilmart
8c2c76dd26 Adds liniting into the workflow (#3082)
* initial linting of src

* fix indent to 2 spaces

* Removes unnecessary rules

* ignore spec folder for now

* Spec linting

* Fix spec indent

* nits

* nits

* no no-empty rule
2016-11-24 15:47:41 -05:00
Florent Vilmart
6e2fba4ae4 Moves test runner logic to helper (#3041) 2016-11-24 15:09:11 -05:00
Bhaskar Reddy Yasa
edb7b70ced Adds password expiry support to password policy (#3068)
* Adding support for password expiry policy

* Renamed daysBeforeExpiry -> maxPasswordAge
2016-11-21 07:46:38 -08:00
Glen Tregoning
1eff210a51 MongoStorageAdapter.findOneAndUpdate returns Parse Object (#3053) (#3064) 2016-11-20 09:02:49 -05:00
Yuki Takeichi
4ea455b20a support Relation object saving (#3074)
* support Parse.Relation object save

* prevent Relation object from being saved in storage
2016-11-20 09:00:33 -05:00
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