Commit Graph

782 Commits

Author SHA1 Message Date
Florent Vilmart
9256b2d7e6 chore: fix flaky test (#3928)
* logOut is async so handle with a promise
2017-06-13 23:54:15 -04:00
Diamond Lewis
8b21d5ab80 feat: Full Text Search Support (#3904)
* Full Text Support

* invalid input test

* Support for sort

* index exist test

* clean up

* better error messaging

* postgres support

* error instructions for $diacritic and $case sensitivity

* nit

* nit

* nit

* separate test for full text
2017-06-13 21:42:59 -04:00
Arthur Cinader
5f991e90fb chore: put loose test into a describe block where it belongs... (#3920) 2017-06-13 10:40:44 -04:00
Antonio Davi Macedo Coelho de Castro
4aa4ebe807 chore: adds test for multiple dont select query (#3799) (#3885) 2017-06-13 10:40:17 -04:00
Worathiti Manosroi
7d70af60ba fix: volatileClasses are masterKey only (#3916)
* volatileClass should respect the schema if defined

* masterKey only for the volatileClasses

* add some test …
2017-06-13 10:36:40 -04:00
Diamond Lewis
4b16a72992 feat(postgres): Add Bytes to Support (#3894)
* Add bytes to schema

* postgres support

* test cases

* bytes work parse object
2017-05-31 22:23:49 -04:00
Diamond Lewis
e8be98ded2 chore(Query): $withinPolygon: 3 point minimum and boundary testing. (#3889)
* added 3 point minimum constraint to within-polygon

* test nit

* test for open and closed paths
2017-05-31 18:08:37 -04:00
Antonio Davi Macedo Coelho de Castro
6cc99aa193 fix(Restwrite): Do not send verification email if users is authenticated using some auth provider (#2660) (#3882) 2017-05-29 20:06:40 -04:00
Diamond Lewis
b692e8578d fix(Postgres): Support for GeoPoint equality query (#3875)
* Postgres doesn't support this query type yet

* removing conflict

* near test

* remove trailing space
2017-05-28 20:42:51 -04:00
Florent Vilmart
c2abbae92d fix(Users): Makes sure verifying emails triggers hooks and liveQuery (#3851)
* Use RestWrite when verifying emails so hooks are called (as master)

* Fixes tests for postgres

* nit

* Makes rest.update support a full where instead of objectId

* Use rest.update to guaranteed proper beforeSave and liveQuery calls
2017-05-28 20:34:49 -04:00
Florent Vilmart
73aafa2d24 fix(tests): Stabilize flaky tests (#3876)
* Longer TTL, shorter wait

* Makes sure we wait for the logout

- Parse.User.logOut is async and was making a test flaky
2017-05-28 20:01:33 -04:00
Florent Vilmart
57efd89b3d fix(AuthAdapters): Do not revalidate auth data if hasn't changed (#3867) (#3872)
* Adds test for #3867

* Always Skip authData validation when nothing is mutated
2017-05-28 17:50:16 -04:00
Diamond Lewis
c99fdea6fb feat(ParseQuery): Added 'withinPolygon' support for GeoPoints (#3866)
* Added 'withinPolygon' to query

* Unit test for withinPolygon

* More Unit Test

* withinPolygon fix for Postgres

* Fix nit

nit?
2017-05-28 12:42:16 -04:00
Diamond Lewis
a380fcf2c7 fix(postgres): Geopoint issue #3285 (#3874) 2017-05-28 12:41:09 -04:00
Anthony Mosca
1f11ad5d74 chore(PushController): Fix push controller tests. (#3853) 2017-05-23 20:22:35 -04:00
Florent Vilmart
b5a2042d12 Fixes issue #3835 affecting relation updates (#3836)
* Adds test for 3835

* Makes sure we run relational updates AFTER validating access to the object

* Always run relation udpates last
2017-05-22 12:34:00 -04:00
Felipe Andrade
03b6449fe1 [PushController] Fixes issue with undefined push_time (#3717) (#3824)
* Fixes #3717

This fixes PR #3717. Sending push with parse-server@2.4.0 returns error
504 GATEWAY_TIMEOUT. This happens when push_time is not set (default).

* Fix lint issues

* Fix in PushController and add tests

Add a test to check push_time format and if it should schedule push
when the parse-server is configured
2017-05-20 12:07:45 -04:00
Florent Vilmart
17a2d269ef Always clear sessions when user password is updated (#3821)
* Adds repro to  issue #3289

* Always clear sessions when password is updated
2017-05-16 11:13:09 -07:00
Florent Vilmart
9dbb89a2e4 Fixes postgres flaky test (#3822)
* Changes expected error code

* nits
2017-05-16 09:06:17 -07:00
Florent Vilmart
691cf5988a Adds count class level permission (#3814)
* Adds count class level permission

* fixup! Adds count class level permission

* Adds missing count property on beforeFind request object

* nits
2017-05-14 21:47:30 -04:00
Florent Vilmart
ab5b759e26 [CI] test with 6.10 and 7.10, mongoDB 3.2 and 3.4 (#3787)
* Node modernization on CI

* Makes sure tests dont yeild unhandled promise rejections

* Adds small delay to startDB

* Adds mongodb service

* testing default

* stupid

* testing with silent nugget

* proper versions

* Single release step
2017-05-14 10:50:53 -04:00
Florent Vilmart
88de01f3d8 Fix issue _PushStatus stuck sending (#3808)
* Adds test for not set device tokens

* Properly filter the installations without a deviceToken

* nit for slower PG test

* nit
2017-05-12 14:24:37 -04:00
Florent Vilmart
10c7cb0bfa requiresAuthentication is self-sufficient for ACL's (#3784)
* Adds test to reproduce issue #3753

* Consider requiresAuthentication as the same level as other CLP

* Better testing
2017-05-11 11:09:06 -04:00
Anthony Mosca
877ef78b5e Improve email verification (#3681)
* Removed hidden keys from users/me.

* Ensured that general users cannot update email verified flag.

* Updated tests to reflect email verification changes.
2017-05-11 09:44:58 -04:00
youngerong
e0be653f4c Properly obfuscate query parameters in logs (#3793)
* fix-3789

* fix3789 add unit test
2017-05-11 07:17:20 -04:00
cmmills91
22ba39812b Add support for resending verification email in case of expired token (#3617)
* -Defines new public API route /apps/:appId/resend_verification_email that will generate a new email verification link and email for a user identified by username in POST body
-Add template and url support for invalidVerificationLink, linkSendSuccess, and linkSendFail pages. The invalidVerificationLink pages includes a button that allows the user to generate a new verification email if their current token has expired, using the new public API route
-All three pages have default html that will be functional out of the box, but they can be customized in the customPages object. The custom page for invalidVerificationLink needs to handle the extraction of the username and appId from the url and the POST to generate the new link (this requires javascript)
-Clicking a link for an email that has already been verified now routes to the emailVerifySuccess page instead of the invalidLink page

* Fix package.json repo url to be parse-server againwq

* Fix js lint issues

* Update unit tests

* Use arrow functions, change html page comments, use qs and a string template to construct location for invalidVerificationLink page, syntax fixes

* Remember to pass result when using arrow function
2017-05-10 09:02:16 -04:00
Jack Wearden
7b9ebc4e8e Avoid multiple $nears in one query (#3798)
Mongo has a hard limit on 1 $near operation per query. Restructuring to
avoid SERVER-13732 should not invalidate a query by creating multiple
$near operations.

Additionally, queries with multiple $ors are now recursively handled,
whereas before, ops at the top level would only have been pushed one
level deeper.

https://github.com/parse-community/parse-server/issues/3767
2017-05-10 08:32:08 -04:00
Florent Vilmart
45a9d50110 Skip authData validation if it hasn't changed. (#3783)
* Adds test for the new feature

* Re-validate authData only if mutated

- In case of short-lived tokens (like facebook) this will allow clients to be lax with asking users to re-login
2017-05-07 12:55:30 -04:00
Florent Vilmart
f7af48db89 Fix/3678 overloaded query constraints (#3723)
* Added failing test

* Updated test description

* Properly handle equalities with additional operator constraints

* adds continuation to silence rejected promises

* Wrap json parsing

* nits
2017-04-23 15:10:17 -07:00
Paulo Vítor S Reis
69042fbf50 [postgres] Improve performance when adding many new fields to the Schema (#3740) 2017-04-23 17:25:33 -04:00
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