Commit Graph

802 Commits

Author SHA1 Message Date
Paulo Vítor S Reis
5e14147676 Fixes issue affecting deleting multiple fields of a Schema (#3735) 2017-04-23 17:22:55 -04:00
Arthur Cinader
a0c1974015 Some wordsmithing on test descriptions. 2017-04-23 11:14:32 -07:00
Florent Vilmart
5813fd0bf8 Fix flaky tests (#3724)
* adds continuation to silence rejected promises

* Wrap json parsing
2017-04-16 16:50:03 -04:00
Florent Vilmart
fd375cb927 Fixes issue affecting queries on Pointer arrays (#3721)
* Transform array atoms on equality

* nits
2017-04-16 11:44:41 -04:00
Florent Vilmart
907b160fc7 Adds support for PushScheduling (#3722)
* Add support for push scheduling

Add a configuration flag on the server to handle the availability of
push scheduling.

* Update push controller to skip sending only if scheduling is configured

Only skip push sending if scheduling is configured

* Update bad conventions

* Add CLI definitions for push scheduling

* Adds tests for pushTime

* Adds test for scheduling

* nits

* Test for not scheduled
2017-04-15 17:20:55 -04:00
ren dong
f3f81b692b support pg-promise init options (#3613)
* pg-promise init options

* add database init options

* Create PostgresInitOptions.spec.js

* Update PostgresInitOptions.spec.js

* Update PostgresInitOptions.spec.js

* add PostgresInitOptions test

* Add files via upload

* linebreaks CRLF to LF

* modify postgresURI to test environment

* modify pg error code to 42P01

* fix reconfigureServer callback
2017-04-07 07:50:55 -04:00
zhoul-HS
52828683ba Add __type property to GeoPoint fields in PostgresStorageAdapter (#3695)
* Add __type property to GeoPoint fields in PostgresStorageAdapter

* Add test to check __type on GeoPoint queries
2017-04-07 07:44:12 -04:00
Benjamin Wilson Friedman
e01b417d3f Added exception for Twitter and OAuth missing options (#3676)
* Added exception for Twitter and OAuth missing configuration information

* Updated error codes to INTERNAL_SERVER_ERROR, code 1
2017-03-28 18:16:47 -04:00
Florent Vilmart
f3765e0b8e use nyc for coverage (#3652)
* use nyc for coverage

* removes unnecessary logss

* Disable RedisCacheAdapter tests when not in specific environment
2017-03-20 09:58:36 -07:00
Wissam Abirached
2533a8cdb3 Do not create user if username or password is empty (#3650) 2017-03-17 18:57:21 -04:00
jeacott1
82e0a59139 missing return in test. (#3645) 2017-03-15 08:59:19 -04:00
Xy Ziemba
29fec01a42 Resend Verification Email Endpoint (#3543)
* Endpoint to Handle Verification Email Request

* Adds tests for verificationEmailRequest endpoint

* Better error responses for `/verificationEmailRequest`
2017-03-04 13:30:52 -08:00
Natan Rolnik
9bfa0c60c4 Adds index on _Role name property (#3586)
* Adds index on _Role name property

In order to avoid having different _Role objects with the same name, adding an index on the name property of _Role is necessary.

Fixes #3579

* Uses throw instead of Promise.reject when enforcing unique indexes

* Fixes wrong sorting of results in schemas tests
2017-03-04 12:42:19 -08:00
Ryan Foster
e6006e800e adding TTL option for redis cache adapter (#3397)
* adding TTL option for redis cache adapter

* adding test for RedisCacheAdapter

* Fixing adapater var name

* changing timeout

* updating default time

* Fix the redis cache spec to construct the cache with the anticipated ttl

make timeout values really really small so our test run fast :).
2017-02-27 12:29:15 -08:00
Jack Wearden
73195627c0 Alleviate SERVER-13732 on all top level filters (#3564)
In a prior commit, improvements were made to the addition of `_rperm`
in the case of `$or` queries, to avoid MongoDB bug SERVER-13732.

As the vast majority of $or queries previously hit this bug due to the
presence of `_rperm` on most Parse queries), the present solution
avoids the bug and improves query performance in most cases.

However, it's still possible for clients to supply their own queries
which hit that bug, such as those with `_created_at` or `_updated_at`
filters, or their own properties from their data model.

This commit makes the logic currently present for `_rperm` available
to all top level filters that exist alongside an $or query, meaning
SERVER-13732 should be avoided in all cases where keys at the top and
inner levels do not have name clashes.

- https://github.com/ParsePlatform/parse-server/pull/3476
- https://jira.mongodb.org/browse/SERVER-13732
2017-02-26 13:37:33 -05:00
Bhaskar Reddy Yasa
0e900cbefd allow flow through to passwordPolicy in case of empty ('') password (#3560) 2017-02-24 07:21:50 -05:00
Florent Vilmart
d3e6c0dea3 Adds test for #3544 (#3545) 2017-02-21 15:06:45 -05:00
Florent Vilmart
193e5a4278 Make sure we don't treat dot notation keys as topLevel atoms (#3531)
Fixing GeoPoints and Files in _GlobalConfig
2017-02-19 12:07:54 +02:00
David Starke
a520ea0243 Fix LiveQuery unsafe user (#3525)
* LiveQuery should not use unsafe user setting

* server should issue queries with the master key
2017-02-18 19:36:20 -05:00
Arthur Cinader
ca70ad0141 Add a unit test to fail when clientKey='' 2017-02-09 14:50:28 -08:00
Arthur Cinader
4979503f63 Two tests that fail often. Give em a little more time. (#3453) 2017-02-08 10:06:42 -08:00
nodechefMatt
ecf422b2d9 Mongo object to Parse object date serialization - avoid re-serialization of iso of type Date (#3389)
* Mongo object to Parse object date serialization - avoid nested ios

* Mongo object to Parse object date serialization

* Remove file from previous commit
2017-02-04 08:32:35 -08:00
Arthur Cinader
e7f2995143 Adjust a test for change to logging. (#3452) 2017-01-30 13:28:52 -05:00
Arthur Cinader
f864141663 Log Parse Errors so they are intelligible. (#3431)
The problem this pr is trying to solve:

When an error occurs on the server, a message should
be returned to the client, and a message should be logged.

Currently, on the server, the log is just [object, object]

This pr will stop calling the default express error handler
which causes two problems: 1. it writes to console instead of log file
2. the output is completely useless! :)

Instead, we'll log the error ourselves using the ParseServer's logger.

fixes: #661
2017-01-30 12:32:54 -05:00
Ricardo Matsui
d67be492f5 Verify pushes are sent to the expected number of installations (#3418) 2017-01-28 11:10:21 -08:00
Greenkeeper
de4c1ee418 Update mongodb to version 2.2.21 🚀 (#3368)
* chore(package): update mongodb to version 2.2.20

https://greenkeeper.io/

* Fix race when fetching schema frequently

* Bumps mongo to 2.2.21
2017-01-16 13:26:14 -08:00
Florent Vilmart
c26db2248f use uWS as optional dependency for ws server (#3231)
* use uWS as optional dependency for ws server

* Update ParseWebSocketServer.js
2017-01-14 07:43:31 -08:00
Florent Vilmart
deedf7b370 Push scalability (#3080)
* Update status through increment
* adds support for incrementing nested keys
* fix issue when having spaces in keys for ordering
* Refactors PushController to use worker
* Adds tests for custom push queue config
* Makes PushController adapter independant
* Better logging of _PushStatus in VERBOSE
2017-01-13 19:34:04 -05:00
Arthur Cinader
4cb6e7d209 Add lint rule space-infix-ops (#3237)
Disallows: 1+1.  Must be 1 + 1.
2017-01-11 12:31:40 -08:00
Arthur Cinader
ceb5a1b5f0 chore(package): update jasmine-spec-reporter to version 3.0.0 (#3333)
https://greenkeeper.io/

Fix parse-server to work with jasmine-spec-reporter-3.0.0
2017-01-11 11:53:24 -08:00
Lenart Rudel
5d9dbea07b Add parseFrameURL for masking user-facing pages (#3267)
* Add parseFrameURL for masking user-facing pages.

Allow users to specify a different address which is used to mask parse
requests for verifying email and resetting password. This is how Parse.com
used to allow customers to gain control over page content, styling etc.

On the destination page javascript is used to check the link in the request
and embed the parse server page using IFRAME.

* Fix code indentation

* Rename method for building link and pass config to it.

* Add customPages options to README.md.

* Add tests for parseFrameURL email link building, and parseFrameURL option.

* Add parseFrameURL for masking user-facing pages.

Allow users to specify a different address which is used to mask parse
requests for verifying email and resetting password. This is how Parse.com
used to allow customers to gain control over page content, styling etc.

On the destination page javascript is used to check the link in the request
and embed the parse server page using IFRAME.

* Fix code indentation

* Rename method for building link and pass config to it.

* Add customPages options to README.md.

* Don't Object.assign to defaultConfiguration global
2017-01-08 10:56:57 -08:00
Bhaskar Reddy Yasa
f331f6644c Add support for regex string for password policy validatorPattern setting (#3331) 2017-01-08 07:12:44 -08:00
David Starke
df029b82eb LiveQuery should match subobjects with dot notation (#3322)
* LiveQuery should match subobjects with dot notation

* one additional test case
2017-01-06 17:06:25 -08:00
Florent Vilmart
4f46eceacf Fixes issue affecting the auth providers (#3211)
* Reproduces error for issue 3208

* Make sure we don't override a default adapter with the options when validation function are not provided
2016-12-08 08:54:06 -08:00
Florent Vilmart
752f0e9143 Fixes #3195 (#3201)
* Adds error reproduction

* Fix transform in order to accept nested array results in $in/$nin

The error originated by the nesting of 2 array in $in [["..."]], using _.flatMap with those will guarantee at the lower level
that the query is properly resolved

* nits

* _.flatMap the $in/$nin values
2016-12-07 20:03:40 -05:00
Arthur Cinader
ca286b7108 Enable prefer-const lint rule (#3202) 2016-12-07 18:17:05 -05:00
Florent Vilmart
a6c988176e Adds tests that shows issue #3194 is ok (#3200) 2016-12-07 14:18:52 -08:00
corban baxter
e069b20ef9 adding simple test for adding and removing users on a role. (#3198) 2016-12-07 16:15:01 -05:00
Florent Vilmart
c1dcaf1271 Auth Adapters refactoring (#3177)
* Moves all authentication providers to Adapter/Auth

* refactors specs

* Deprecates oauth option in favor of auth option

- Deprecates facebookAppIds option (in favor of auth.facebook.appIds)
- Adds warnings about the deprecated options

* nits
2016-12-06 14:09:43 -08:00
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