Commit Graph

1045 Commits

Author SHA1 Message Date
dblythy
44015c3e35 Before Connect + Before Subscribe help required (#6793)
* Before Connect + Before Subscribe #1

* Cleanup and Documentation

* Add E2E tests

* Bump parse to 2.15.0

Co-authored-by: Diamond Lewis <findlewis@gmail.com>
2020-07-16 20:36:38 -05:00
Manuel
3bd5684f67 Add idempotency (#6748)
* added idempotency router and middleware

* added idempotency rules for routes classes, functions, jobs, installaions, users

* fixed typo

* ignore requests without header

* removed unused var

* enabled feature only for MongoDB

* changed code comment

* fixed inconsistend storage adapter specification

* Trigger notification

* Travis CI trigger

* Travis CI trigger

* Travis CI trigger

* rebuilt option definitions

* fixed incorrect import path

* added new request ID header to allowed headers

* fixed typescript typos

* add new system class to spec helper

* fixed typescript typos

* re-added postgres conn parameter

* removed postgres conn parameter

* fixed incorrect schema for index creation

* temporarily disabling index creation to fix postgres issue

* temporarily disabling index creation to fix postgres issue

* temporarily disabling index creation to fix postgres issue

* temporarily disabling index creation to fix postgres issue

* temporarily disabling index creation to fix postgres issue

* temporarily disabling index creation to fix postgres issue

* temporarily disabling index creation to fix postgres issue

* trying to fix postgres issue

* fixed incorrect auth when writing to _Idempotency

* trying to fix postgres issue

* Travis CI trigger

* added test cases

* removed number grouping

* fixed test description

* trying to fix postgres issue

* added Github readme docs

* added change log

* refactored tests; fixed some typos

* fixed test case

* fixed default TTL value

* Travis CI Trigger

* Travis CI Trigger

* Travis CI Trigger

* added test case to increase coverage

* Trigger Travis CI

* changed configuration syntax to use regex; added test cases

* removed unused vars

* removed IdempotencyRouter

* Trigger Travis CI

* updated docs

* updated docs

* updated docs

* updated docs

* update docs

* Trigger Travis CI

* fixed coverage

* removed code comments
2020-07-15 13:10:33 -05:00
SebC
cbf9da517b Add production Google Auth Adapter instead of using the development url (#6734)
* Add the production Google Auth Adapter instead of using the development url

* Update tests to the new google auth

* lint
2020-07-15 09:56:08 -07:00
Diamond Lewis
e6a6354b29 Run Prettier JS (#6795) 2020-07-13 13:06:52 -05:00
yog27ray
34614e0f78 Pass context in beforeDelete, afterDelete, beforeFind and Parse.Cloud.run. (#6666)
* add context for following hooks.
1. beforeDelete
2. afterDelete
3. beforeFind
4. Cloud Function

* revert un-necessary code change.

* fix: failing test cases.

* fix: failing test cases.

* fix: failing test cases.

* fix: failing test cases.

* fix: failing test cases.

* fix: failing test cases.

* fix: failing test cases.

* review changes

* revert changes

* revert changes

* review changes

* lint changes

* review changes
2020-07-10 22:47:27 +02:00
Kevin Yao
d03ec18bcc feat: allow custom cors origin header (#6772) 2020-07-10 13:48:57 -05:00
Manuel
f095dffcc3 fix context for cascade-saving and saving existing object (#6735)
* added test cases

* fixed unparsed context when updating object

* fixed context inheritance for cascade-saved objects

* upgraded parse dependecy to 2.14.0

* rebuild

* removed superfluous comments

* undo lint changes
2020-07-02 14:37:41 -05:00
Corey
5426f5a4f7 Add file bucket encryption using fileKey (#6765)
* add fileKey encryption to GridFSBucketStorageAdapter

* remove fileAdapter options from test spec

* ensure promise doesn't fall through in getFileData

* switch secretKey to fileKey
2020-07-01 18:43:26 -05:00
Yaacov Rydzinski
f56049b34b upgrade graphql-tools to v6 (#6701)
* upgrade to v6

* remove old graphql-tools package

Co-authored-by: Antonio Davi Macedo Coelho de Castro <adavimacedo@gmail.com>
2020-05-24 23:35:45 -07:00
Diamond Lewis
370215a39b Support Metadata in GridFSAdapter (#6660)
* Support Metadata in GridFSAdapter

* Useful for testing in the JS SDK
* Adds new endpoint to be used with `Parse.File.getData`
* Allows file adapters to return tags as well as future data.

* fix tests

* Make getMetadata optional

* Revert "fix tests"

This reverts commit 7706da13c688027483974e854b5b24321fb070cd.

* improve coverage
2020-05-08 15:32:20 -05:00
greenkeeper[bot]
b1506995ad Update uuid to the latest version 🚀 (#6659)
* fix(package): update uuid to version 8.0.0

* chore(package): update lockfile package-lock.json

* remove deprecated uuid/v4

* use uuidv4 as default

Co-authored-by: greenkeeper[bot] <23040076+greenkeeper[bot]@users.noreply.github.com>
Co-authored-by: Diamond Lewis <findlewis@gmail.com>
2020-04-30 05:21:51 +00:00
Antoine Cormouls
4d1bd9346f Allow to unset file from graphql (#6651) 2020-04-29 22:18:25 -07:00
promisenxu
67bf868208 Handle shutdown for RedisCacheAdapter (#6658)
* Handle shutdown for RedisCacheAdapter

* connected value need to be tested in setTimeout

Co-authored-by: Promise Xu <promise@klido.me>
2020-04-29 19:51:58 -07:00
Manuel
2b7223355e fix explain on user class (#6650)
* added test case and fixed bug

* enabled test case only for mongodb
2020-04-28 11:45:01 -07:00
Manuel
e78c07e169 Fix read preference for aggregate (#6585)
* added failing test cases

* fixed test cases for aggregate query

* added read preference option to aggregate router
2020-04-28 11:41:33 -07:00
Manuel
288e746888 add context to Parse.Object.save (#6626)
* added failing test

* added parsing of context in REST save request

* undo lint changes
2020-04-28 11:36:46 -07:00
Corey
f43afc5d40 Adding ssl config params to Postgres URI (#6580)
* use pg-promise native pg-connection-string to parse uri instead of ParseConfigParser.js. The allows for a more felxible uri for ssl and other params

* added ssl config params and others to PostgresConfigParser

* forgot to add back the original client file

* need to read in file at path for pfx, ca, key, and key

* convert file buffer to string to be consistant with node-postgres examples
2020-04-23 11:25:16 -05:00
Corey
489aeae784 Fix: objectId size for Pointer in Postgres (#6619)
* Fixing objectId for Pointer in Postgres

* add test case for longer objectId pointer. Note that this test fails on Postgres before the addition of previous commit

* removed comment that wasn't needed
2020-04-22 11:01:11 -05:00
Gordon Sun
9d8955cf90 improve a test case (#6629)
1. do not need to create a new server, use the reconfigureServer tool
3. use async await

Co-authored-by: Gordon Sun <gordon.sun@pipe17.com>
2020-04-21 10:37:43 -07:00
Antoine Cormouls
f2f772084f Allow to resolve automatically Parse Type fields from Custom Schema (#6562)
* add package

* Allow real GraphQL Schema via ParseServer.start

* Allow resolve fields from auto graphQL Schema

* Simple merge

* fix + improve

* Add tests
2020-04-21 10:15:00 -07:00
Gordon Sun
c11e891298 remove wrong console log in test (#6627)
Co-authored-by: Gordon Sun <gordon.sun@pipe17.com>
2020-04-20 22:34:59 -07:00
Yaacov Rydzinski
a6300a2201 Graphql tools v5 (#6611)
* Add test case for order option when extending the schema

* Remove fit

* upgrade to graphql-tools v5

revert #6515

Co-authored-by: Antonio Davi Macedo Coelho de Castro <adavimacedo@gmail.com>
2020-04-20 22:16:48 -07:00
Gordon Sun
a5ef0be7f4 catch JSON.parse and return 403 properly (#6614)
Co-authored-by: Gordon Sun <gordon.sun@pipe17.com>
2020-04-15 12:59:49 -07:00
Gordon Sun
b08571774f Allow set user mapped from JWT directly on request (#6411)
* Use user mapped from JWT for Auth

* Add a test for userFromJWT bypass

Co-authored-by: Gordon Sun <gordon.sun@pipe17.com>
2020-04-03 17:09:37 -05:00
Corey
dcba8e0b7c Case insensitive username and email indexing and query planning for Postgres (#6506)
* Update .travis.yml

testing error to see what happens...

* Update .travis.yml

Attempting to resolve postgres in CL by installing postgis via sudo instead of through apt/packages

* Update .travis.yml

* Update .travis.yml

* Update .travis.yml

Removed extra lines of postgres that were under "services" and "addons". I believe the "postgresql" line under "services" was installing the default of 9.6 and "addons" was installing postgres 11. My guess is the fail was occurring due to 9.6 being called sometimes and it never had postgis installed. If this is true, the solution is to only install one version of postgres, which is version 11 with postgis 2.5.

* Adding test case for caseInsensitive 

Adding test case for verifying indexing for caseInsensitive

* Implementing ensureIndex

* Updated PostgresStorageAdapter calls to ST_DistanceSphere. Note this has a minimum requirement of postgis 2.2. Documented the change in the readme. This is address #6441

* updated postgres sections of contributions with newer postgres info. Also switched postgis image it points to as the other one hasn't been updated in over a year.

* more info about postgres

* added necessary password for postgres docker

* updated wording in contributions

* removed reference to MacJr environment var when starting postgres in contributions. The official image automatically creates a user named 'postgres', but it does require a password, which the command sets to 'postgres'

* added more time to docker sleep/wait to enter postgis commands. This will always take a few seconds because the db is installing from scratch everytime. If postgres/postgis images aren't already downloaded locally, it will take even longer. Worst case, if the command times out on first run. Stop and remove the parse-postgres container and run the command again, 20 seconds should be enough wait time then

* latest changes

* initial fix, need to test

* fixed lint

* Adding test case for caseInsensitive 

Adding test case for verifying indexing for caseInsensitive

* Implementing ensureIndex

* Updated PostgresStorageAdapter calls to ST_DistanceSphere. Note this has a minimum requirement of postgis 2.2. Documented the change in the readme. This is address #6441

* updated postgres sections of contributions with newer postgres info. Also switched postgis image it points to as the other one hasn't been updated in over a year.

* more info about postgres

* added necessary password for postgres docker

* updated wording in contributions

* removed reference to MacJr environment var when starting postgres in contributions. The official image automatically creates a user named 'postgres', but it does require a password, which the command sets to 'postgres'

* added more time to docker sleep/wait to enter postgis commands. This will always take a few seconds because the db is installing from scratch everytime. If postgres/postgis images aren't already downloaded locally, it will take even longer. Worst case, if the command times out on first run. Stop and remove the parse-postgres container and run the command again, 20 seconds should be enough wait time then

* latest changes

* initial fix, need to test

* fixed lint

* Adds caseInsensitive constraints to database, but doesn't pass regular tests. I believe this is because ensureIndex in the Postgres adapter is returning wrong. Also, some issues with the caseInsensitive test case

* this version addes the indexes, but something still wrong with the ensureIndex method in adapter

* removed code from suggestions

* fixed lint

* fixed PostgresAdapter test case

* small bug in test case

* reverted back to main branch package.json and lock file

* fixed docker command in Contribute file

* added ability to explain the find method

* triggering another build

* added ability to choose to 'analyze' a query which actually executes (this can be bad when looking at a query plan for Insert, Delete, etc.) the query or to just setup the query plan (default, previous versions defaulted to 'analyze'). Alse added some comparsons on sequential vs index searches for postgres

* made sure to check that search actually returns 1 result. Removed prep time comparison between searches as this seemed to be variable

* added test cases using find and case insensitivity on fields other than username and password. Also added explain to aggregate method

* fixing issue where query in aggregate replaced the map method incorrectly

* reverted back to mapping for aggregate method to make sure it's the issue

* switched back to caseInsensitive check for email and username as it was causing issues

* fixed aggregate method using explain

* made query plain results more flexible/reusable. Got rid of droptables as 'beforeEach' already handles this

* updated CONTRIBUTING doc to use netrecon as default username for postgres (similar to old style). Note that the official postgres docker image for postgres requires POSTGRES_PASSWORD to be set in order to use the image

* left postgis at 2.5 in the contributing document as this is the last version to be backwards compatibile with older versions of parse server

* updating docker command for postgres

Co-authored-by: Arthur Cinader <700572+acinader@users.noreply.github.com>
2020-04-03 09:24:56 -05:00
Corey
7121ea0a16 Fixed issue that prevented Postgres Tests from passing locally and on any port other than 5432 in travis (#6531)
* Attempting to fix Postgres issue

* Attempting to fix Postgres issue

trying to stop loop

* Attempting to fix Postgres

isolating postgres calls

* Attempting to fix Postgres issue

Separating jobs

* Attempting to fix postgres

* Attempting to fix postgres

* Attempting to fix postgres

Separating builds again

* Attempting to fix postgres

* Attempting to fix postgres

* Attempting to fix postgres

Just added back version 10, just in case it gets called

* Attempting to fix postgres

* Attempting to fix postgres

* Attempting to fix postgres

* Attempting to fix postgres

* Attempting to fix postgres

* Attempting to fix postgres

* Attempting to fix postgres

* Attempting to fix postgres

* Attempting to fix postgres

* Attempting to fix postgres

* Update .travis.yml

* Attempting to fix postgres

Removed postgres installs from unneeded test cases. Added the ability to test Postgres 10 and 11

* Attempting to fix postgres

* Attempting to fix postgres

* Attempting to fix postgres

* Attempting to fix postgres

Added test for postgres 12 that's allowed to fail

* Attempting to fix postgres

* Attempting to fix postgres 

Second round to see if it fails eventually

* Attempting to fix postgres

Round 3

* Attempting to fix postgres

Allowing all postgres to fail since it seems to occur randomly

* Temporary fix: separated mongo and postgres in travis

Now the mongo and postgres scripts are independent of each other to prevent the `ERROR:  could not access file "$libdir/postgis-2.4": No such file or directory` of showing up in the rest of the builds.

In addition, a test for postgres-12 has been added for future compatibility. Both the postgres-11 and postgres-12 have been added to `allow_failures` because the aforementioned error still creeps up. Important note is that the error has nothing to do with compatibility with postgres, but rather seems to be an error of how postgres (or really postgis) is being referenced in the respective travis distribution. Lastly, this error, if truly random should appear less than before as the postgres scripts aren't being run for every build as it previously was running.

* Allowing all postgres to fail

* Allowing multiple names to fail

* Removing preinstalled versions of postgres from list

Seeing if this gets rid of the random error

* Use postgres made for dist

* Second round

* Round 3

* Round 4

* Round 5

* Fixed issue with random postgres fail

Removing the native postgres builds at the right time seems to have fixed the random error from before.

The postgres tests are now not allowed to fail.

* Added back postgres 11 and 12 to allow_failures

The actual problem is fixed, but it seems there are some instability with some of the test cases for postgres that need to be addressed at another time.

The issues that pop up are: 
- Postgres-11
```Failures:
1) Cloud Code cloud jobs should set the message / success on the job
  Message:
    Expected undefined to equal 'hello'.
  Stack:
    Error: Expected undefined to equal 'hello'.
        at <Jasmine>
        at req.message.then.then.jobStatus (/home/travis/build/parse-community/parse-server/spec/CloudCode.spec.js:1571:46)
        at process._tickCallback (internal/process/next_tick.js:68:7)
```

- Postgres-12
``` 
Failures:
1) Cloud Code cloud jobs should set the message / success on the job
  Message:
    Expected undefined to equal 'hello'.
  Stack:
    Error: Expected undefined to equal 'hello'.
        at <Jasmine>
        at req.message.then.then.jobStatus (/home/travis/build/parse-community/parse-server/spec/CloudCode.spec.js:1571:46)
        at process._tickCallback (internal/process/next_tick.js:68:7)
  Message:
    Expected 'running' to equal 'succeeded'.
  Stack:
    Error: Expected 'running' to equal 'succeeded'.
        at <Jasmine>
        at promise.then.then.jobStatus (/home/travis/build/parse-community/parse-server/spec/CloudCode.spec.js:1580:45)
        at process._tickCallback (internal/process/next_tick.js:68:7)
```

* added travis scripts for postgres

* Setting up before_install and before_script

This should shrink the footprint of the file and and reduce the redundancy of calls for postgres.

Added support for testing of Postgres 9 and 10 in the scripts, not adding the tests though

* make scripts executable

* Update .travis.yml

* add sourcing in script

* trying to fix source

* fixing env var in script

* fixed ; near then

* Cleaning up travis file

removed old lines

* Finishing clean up

* Fixing allow_failures since "name" was removed

* Update .travis.yml

* Removed Postgres 11 from allow_failures

* I think using travis default postgres port of 5433 will allow us to not have to remove anything from the image

* Switching travis to postgres port 5433

* modifying script for test

* modifying script for test

* modifying script for test

* reverting back to working way with removing postgres from image

* Reverted back to removing postgres from image

* removing postgres 12

* removed postgres-12 from allow_failures

* updated postgres method from deprecated. Also updating postgis to 3.0

* updated postgis to 3.0

* Update .travis.yml

* fix Postgres test issues that causes some tests to fail locally when using PARSE_SERVER_TEST_DATABASE_URI

* removed dependence on creating adapter locally in testcase and use config instead.

* fixed one more potential issue with postgres adapter

* modified travis and script to leverage PARSE_SERVER_TEST_DATABASE_URI

* changes to before install to reduce time

* add updated port to script for psql connection

* fixed arg for psql

* added back conf file as it probably contains the default permissions

* seeing if stopping/starting postgres back-to-back was the issue

* checking fix

* revert to working version of install script

* leave default port

* removing uninstall of postgres from script

* looks like postgres won't start until the others are removed

* forgoing using posgres service and starting directly, hoping it allows to skip remove

* removed sudo for starting postgres

* adding back sude, but using default user for postgres

* fix

* don't start service

* init db cluster before starting

* remove folder befor init

* remove folder befor init

* still have to stop service

* switch ports after new configs are made

* switch ports after new configs are made

* went back to removing to get it to start properly

* seeing if you can use postgres installaition out of the box

* seeing if you can use postgres installaition out of the box

* copy hba file, then stop,start

* testing using port as argument

* working version

* round 2

* updated documentation to reflect changes

* use restart instead of stop/start for postgres

* removed extra lines to ensure consistency with future builds

* reload instead of restart postgres

* restart postgres since we can't currently connect

* Switch to testonly for postgres

* run testonly

* Declare as mongo test since it's handed coded to a mongo uri
2020-04-03 08:53:57 -05:00
stevestencil
a9dba442b1 Add file triggers and file meta data (#6344)
* added hint to aggregate

* added support for hint in query

* added else clause to aggregate

* fixed tests

* updated tests

* Add tests and clean up

* added beforeSaveFile and afterSaveFile triggers

* Add support for explain

* added some validation

* added support for metadata and tags

* tests?

* trying tests

* added tests

* fixed failing tests

* added some docs for fileObject

* updated hooks to use Parse.File

* added test for already saved file being returned in hook

* added beforeDeleteFile and afterDeleteFile hooks

* removed contentLength because it's already in the header

* added fileSize param to FileTriggerRequest

* added support for client side metadata and tags

* removed fit test

* removed unused import

* added loging to file triggers

* updated error message

* updated error message

* fixed tests

* fixed typos

* Update package.json

* fixed failing test

* fixed error message

* fixed failing tests (hopefully)

* TESTS!!!

* Update FilesAdapter.js

fixed comment

* added test for changing file name

* updated comments

Co-authored-by: Diamond Lewis <findlewis@gmail.com>
2020-04-02 16:00:15 -05:00
Manuel Trezza
19dea5bbd3 Fix aggregate geoNear with date query (#6540)
* added failing test case

* add date conversion for geoNear query

- geoNear stages were not parsed for date fields, but mongodb nodejs adapter requires date object

* reverted unnecessary code auto-formatting

* limited parsing to query property of geoNear stage

- the geoNear object contains parameter keys which could be identical to field names in the collection, which should not be parsed and changed, therefore restricting parsing only to query parameter key

* reverted unnecessary code auto-formatting

* added index type parameter to ensureIndex

- required to create geo index for geoNear test

* added geo index creation to test case

* fixed dates in test case

- test case likey failed due to date rounding

* added error output to console

- temporary, to find out why test fails on mongodb 3.6.9

* create seperate class to avoid multiple geo indices on TestObject class

- mongodb <4.0 does not allow nultiple geo indices on a class when using geoNear
- see https://docs.mongodb.com/v3.6/reference/operator/aggregation/geoNear/#behavior

* fixed incorrect result validation

- results were not ordered properly, so test validation failed sometimes

* removed error output to console

This reverts commit da81c515cbf8cb6edfd82f09ca3087457ac8c727.
2020-03-29 15:15:40 -05:00
Antoine Cormouls
312a4bc812 Switch ACL to Relay Global Id (#6495) 2020-03-23 01:35:42 -07:00
Nikolay Andryukhin
c178acd347 fixing enableExpressErrorHandler logic (#6423)
* fixing enableExpressErrorHandler logic

* Fix tests

Co-authored-by: n.andryukhin <n.andryukhin@mediasoft.team>
Co-authored-by: Diamond Lewis <findlewis@gmail.com>
2020-03-22 22:49:12 -07:00
Maravilho Singa
b60502d8a0 Instagram: Support passing in API url (#6398)
* Update instagram.js

Instagram API was updated.

* Update instagram.js

Instagram API was updated and is not allowing anymore to setup new projects to use the old style but it is still working for the ones that have it already setup.

New docs are listed here: https://developers.facebook.com/docs/instagram-basic-display-api/

I've added support for both old and new API
To use new API just add new field "api_type" = "new_api" in client side.

For old API just no changes needed.

* support api url

Co-authored-by: Diamond Lewis <findlewis@gmail.com>
2020-03-22 11:24:22 -05:00
UnderratedDev
dd2b64ef65 updated 2 files for allowing multiple client ids (#6523)
* updated 2 files for allowing multiple client ids

* updated tests that fail due to user inputting data in code, added todo comment to them stating what we need to do to fix them
2020-03-21 19:04:10 -05:00
Andy
8e0e485de1 use token and algo from jwt header (#6416)
* use token and algo from jwt header

* change node-rsa out for jwks-rsa, reflect change in tests and add one test for coverage

* remove superfluous cache, allow jwks cache parameters to be passed to validateAuthData

* remove package lock

* regenerate package lock

* try fixing package-lock with copy from master

* manual changes for merge conflict

* whitespace

* pass options as object

* fix inconsistent variable name
2020-03-11 15:29:20 -05:00
Antoine Cormouls
16a974a04a Fix Unknow type merge bug on overloaded types (#6494)
* Fix Unknow type bug on overloaded types

* check args too
2020-03-11 12:59:18 -07:00
Siddharth Ramesh
ef17dc4382 Group aggregation supports multiple columns for postgres (#6483)
* Group aggregation supports multiple columns for postgres

* Group aggregation supports multiple columns for postgres

* Group aggregation supports multiple columns for postgres

* Group aggregation supports multiple columns for postgres
2020-03-09 09:18:39 -07:00
Arthur Cinader
3a3a5eee5f Merge pull request from GHSA-h4mf-75hf-67w4
* Fix session token issue

* verify email problem

* Fix password reset problem

* Change test file name

* Split tests

* Refetch user

* Replaces lets to consts

* Refactor unit test

What you have is just finee, but wanted
to show you what I meant with my comment

Use jasmine's this to set stuff in beforeEach's

Not that all functions need to be `function ()` instead of
`() =>` so `this` is preserved.

see: https://jasmine.github.io/tutorials/your_first_suite#section-The_%3Ccode%3Ethis%3C/code%3E_keyword

Co-authored-by: Antonio Davi Macedo Coelho de Castro <adavimacedo@gmail.com>
2020-03-02 15:46:01 -08:00
Old Grandpa
6b0efaeffd Do not allow to protect default fields (#6439)
* consider default columns

* disallow protecting default fields
2020-02-28 15:52:48 -08:00
Arthur Cinader
5c7918980c Set min mongodb to 3.6 in prep for parse-server 4.0 (#6445)
* Set min mongodb to 3.6 in prep for parse-server 4.0

fixes: 6444

* don't use anonymous functions when we can just
pass the function.

Also remove the boolean argument in tests that no longer exists.

* generate the correct lock file.  ooops.
2020-02-27 10:56:14 -08:00
Antoine Cormouls
c7f96c92cd GraphQL: Allow true GraphQL Schema Customization (#6360)
* Allow real GraphQL Schema via ParseServer.start

* wip

* working

* tests ok

* add tests about enum/input use case

* Add async function based merge

* Better naming

* remove useless condition
2020-02-21 15:12:49 -08:00
Old Grandpa
292bdb713a Allow protectedFields for Authenticated users and Public. Fix userField with keys/excludedKeys (#6415)
* fix error message and test it

* protected fields fixes

* clean

* remove duplicate test, add some comments

* no need for 'requiresAuthentication'
2020-02-19 01:34:08 -08:00
Diamond Lewis
ca1ae336c9 Websocket: unhandle rejection (#6418)
* Websocket: unhandle rejection

Closes: https://github.com/parse-community/parse-server/issues/6413, https://github.com/parse-community/parse-server/issues/6173
Prevent crashing on websocket error.

Bonus points to anybody who can post a specific payload that the client sends that returns an error.

* log the socket

* fix tests

* fix payload reference link
2020-02-19 01:30:23 -08:00
Arthur Cinader
fd0b535159 Case insensitive signup (#5634)
* Always delete data after each, even for mongo.

* Add failing simple case test

* run all tests

* 1. when validating username be case insensitive

2. add _auth_data_anonymous to specialQueryKeys...whatever that is!

* More case sensitivity

1. also make email validation case insensitive
2. update comments to reflect what this change does

* wordsmithery and grammar

* first pass at a preformant case insensitive query.  mongo only so far.

* change name of parameter from insensitive to
caseInsensitive

* Postgres support

* properly handle auth data null

* wip

* use 'caseInsensitive' instead of 'insensitive' in all places.

* update commenet to reclect current plan

* skip the mystery test for now

* create case insensitive indecies for
mongo to support case insensitive
checks for email and username

* remove unneeded specialKey

* pull collation out to a function.

* not sure what i planned
to do with this test.
removing.

* remove typo

* remove another unused flag

* maintain order

* maintain order of params

* boil the ocean on param sequence
i like having explain last cause it seems
like something you would
change/remove after getting what you want
from the explain?

* add test to verify creation
and use of caseInsensitive index

* add no op func to prostgress

* get collation object from mongocollection
make flow lint happy by declaring things Object.

* fix typo

* add changelog

* kick travis

* properly reference static method

* add a test to confirm that anonymous users with
unique username that do collide when compared
insensitively can still be created.

* minot doc nits

* add a few tests to make sure our spy is working as expected
wordsmith the changelog

Co-authored-by: Diamond Lewis <findlewis@gmail.com>
2020-02-14 09:44:51 -08:00
David Corona
09a1dca5e3 Add new afterLogin cloud code hook (#6387)
* add new afterLogin cloud code hook

* include user on req.user for afterLogin hook
2020-02-11 17:38:14 -06:00
greenkeeper[bot]
da0dbfe23d Update mongodb to the latest version 🚀 (#6348)
* fix(package): update mongodb to version 3.5.0

* chore(package): update lockfile package-lock.json

* Fix shutdown issues

Properly retrieves the number of connections

https://docs.mongodb.com/manual/reference/command/serverStatus/#connections

Bump to 3.5.1

* remove fit

Co-authored-by: Diamond Lewis <findlewis@gmail.com>
2020-02-08 04:49:43 +00:00
Old Grandpa
3c46117d9b Granular CLP pointer permissions (#6352)
* set pointer permissions per operatioon; tests

* more tests

* fixes addField permission; tests
2020-01-27 22:21:30 -08:00
Antoine Cormouls
30a5aa0b61 GraphQL: Nested File Upload (#6372)
* wip

* wip

* tested

* wip

* tested
2020-01-27 19:16:53 -08:00
Antoine Cormouls
df3fa029bc fix queries (#6363) 2020-01-27 19:10:39 -08:00
Antoine Cormouls
d4e264daf8 GraphQL: 3rd Party LoginWith Support (#6371)
* wip

* wip

* tested
2020-01-27 18:57:26 -08:00
Old Grandpa
2d257e20a0 CLP objectId size validation fix (#6332)
* Relax regex for customId ; allow varying id length

* test

* remove trycatch, fix typo

* de-duplicate test names; test pointer targetclass

* fixed early return; detailed errors for protected
2020-01-14 01:01:14 -08:00
stevestencil
9842c6ee42 adds ability to set hint on Parse.Query #6288 (#6322)
* added hint to aggregate

* added support for hint in query

* added else clause to aggregate

* fixed tests

* updated tests

* Add tests and clean up

* Add support for explain

Co-authored-by: Diamond Lewis <findlewis@gmail.com>
2020-01-14 02:14:43 -06:00