Commit Graph

1169 Commits

Author SHA1 Message Date
Antoine Cormouls
626fad2e71 fix: setting a field to null does not delete it via GraphQL API (#7649)
BREAKING CHANGE: To delete a field via the GraphQL API, the field value has to be set to `null`. Previously, setting a field value to `null` would save a null value in the database, which was not according to the [GraphQL specs](https://spec.graphql.org/June2018/#sec-Null-Value). To delete a file field use `file: null`, the previous way of using `file: { file: null }` has become obsolete.
2021-10-27 01:33:48 +02:00
dblythy
12eb6c823b refactor: replace hardcoded error codes with references (#7546) 2021-10-18 20:19:47 +02:00
Corey
b5fc0d59db ci: enable more tests on Postgres adapter (#7641) 2021-10-18 16:51:56 +02:00
Antoine Cormouls
85ef7217b0 feat: alphabetical graphql api, fix internal reassign, enhanced Graphql schema cache system (#7344) 2021-10-11 14:51:28 +02:00
dblythy
ab1dddd406 fix: add deprecation warning for Parse.Cloud.httpRequest (#7595) 2021-10-09 05:04:12 +02:00
dblythy
68a3a87501 fix: set objects in afterFind triggers (#7311) 2021-10-09 02:34:09 +02:00
Brandon Scott
197fcbda00 refactor: modernize HTTPRequest tests (#7604) 2021-10-08 22:44:40 +02:00
dblythy
caee281bc5 fix: allow LiveQuery on Parse.Session (#7554) 2021-10-08 17:24:33 +02:00
dblythy
484c2e81ca fix: improve security by deprecating creating users with public access by default (#7319) 2021-10-08 05:24:20 +02:00
dblythy
d90c1591ad test: fix failing tests after removal of session token (#7599) 2021-09-30 13:41:04 +02:00
dblythy
834ae366f9 Merge pull request from GHSA-7pr3-p5fm-8r9x
* fix: strip sessionToken on _User LiveQuery

* delete authData

* add changelog

* Update package.json

* Update CHANGELOG.md

* add changes

* Update ParseLiveQuery.spec.js

Co-authored-by: Manuel <5673677+mtrezza@users.noreply.github.com>
2021-09-30 04:52:12 +02:00
dblythy
8ed94421e6 fix: add support for descending sorting of full text search (#7496) 2021-09-15 16:15:08 +02:00
dblythy
0225340ccb refactor: allow ES import for cloud string if package type is module (#7560)
* allow module import for Parse Cloud

* Update .babelrc

* catch esm error

* Update ParseServer.js

* add tests

* Update CHANGELOG.md

* Update CloudCode.spec.js

Co-authored-by: Manuel <5673677+mtrezza@users.noreply.github.com>
2021-09-14 14:10:37 +02:00
Manuel
24188a39a7 refactor: remove restricted session field (#7543)
* add issue bot for prs

* Update CHANGELOG.md

* Update issue-bot.yml

* remove session restriction artifacts

* Update CHANGELOG.md

* Update CHANGELOG.md
2021-09-04 03:03:46 +02:00
Antonio Davi Macedo Coelho de Castro
308668c894 Merge pull request from GHSA-xqp8-w826-hh6x
* Added a test case that triggers the query parameter crash

* rest.js: validate the explain parameter to keep the nodejs driver from throwing an uncatchable exception and crashing the server (see https://jira.mongodb.org/browse/NODE-3463)
RestQuery.js: Check whether explain mode is enabled not by "!== true", but by the "!" operator. explain can have string values.
Added tests that validate correct behaviour on different explain values

* Refactor the new tests

* Simplify the new tests
Also do a sanity check on the explain results

* Test refactor

* Exclude queryPlannerExtended as it is not supported by the testing environment
  Simplifies the tests

* Restrict the changes to mongodb
  Moved the verification of the explain value from rest.js to MongoStorageAdapter.js
  Also restricted the relevant unit tests to mongodb

* Added changelog entry

* reformat changelog entry

* Update CHANGELOG.md

Co-authored-by: Kartal Kaan Bozdoğan <kartalkaanbozdogan@gmail.com>
Co-authored-by: Manuel <5673677+mtrezza@users.noreply.github.com>
2021-09-02 12:46:48 +02:00
Antonio Davi Macedo Coelho de Castro
fc0fef5922 Merge pull request from GHSA-23r4-5mxp-c7g5 (#7497)
* Merge pull request from GHSA-23r4-5mxp-c7g5

* add anonymous login security fix

* add changelog entry

* update changelog

* Update package.json (#7498)

* Update package-lock.json (#7499)

Co-authored-by: Corey <coreyearleon@icloud.com>
2021-08-18 19:03:54 +02:00
Raschid J.F. Rafeally
8fddac39bf feat(AggregateRouter): support native mongodb syntax in aggregation pipelines (#7339) 2021-08-12 19:14:04 +02:00
Corey
c8e822b958 Accept context via header X-Parse-Cloud-Context (#7437)
* failing testcase

* add header

* switch to X-Parse-Cloud-Context header

* add back blank line that lint removed

* test replacing context header with body context. Add support for setting body with json string

* add back blank line

* cover error when _context body is wrong

* Update middlewares.js

* revert accidental status change

* make sure context always decodes to an object else throw error

* improve context object check

Co-authored-by: Antonio Davi Macedo Coelho de Castro <adavimacedo@gmail.com>
2021-07-25 21:17:03 -07:00
Snyk bot
a95ad89736 [Snyk] Security upgrade parse from 3.2.0 to 3.3.0 (#7464)
* fix: package.json & package-lock.json to reduce vulnerabilities

The following vulnerabilities are fixed with an upgrade:
- https://snyk.io/vuln/SNYK-JS-WS-1296835

* update user test

Co-authored-by: Manuel Trezza <5673677+mtrezza@users.noreply.github.com>
2021-07-23 18:04:03 +02:00
Manuel
250008d379 changed twitter API endpoint for oauth test (#7472) 2021-07-23 12:46:26 +02:00
Manuel
1594afec64 add runtime deprecation warning (#7451) 2021-07-12 20:14:35 +02:00
Jason Posthuma
d8dc524c08 Add check for property (#7421)
* Add check for property

* updated changelog

* Fixed logic returning false positive

* Added test case

* update change log
2021-06-21 16:11:15 -07:00
GormanFletcher
129f7bfa9b Add support for master key clients to create user sessions (#7406)
* 6641: Implement support for user impersonation: master key clients can log in as any user, without access to the user's credentials, and without presuming the user already has a session

* reworded changelog

* rebuilt package lock

* fit test

* using lodash flatMap

* bump to node 12 for postgres test

* revert test fit

* add node version to postgres CI

* revert package-lock

Co-authored-by: gormanfletcher <git@gormanfletcher.com>
Co-authored-by: Manuel <5673677+mtrezza@users.noreply.github.com>
2021-06-04 18:55:00 -05:00
Corey
6d13aeae2c Fix select exclude queries (#7242)
* fix keys and excludeKeys to work with JSON array strings

* make excludeKeys test more robust

* add changelog

* add select([]) functionality to fix)

* update changelog

* update keys

* add exclude test

* add select REST test and exclude JS SDK test

* add more tests

* add additional exclude test

* improved select test for testing JSON string array in REST

* improved exclude test for testing JSON string array in REST

* check for parse keys

* make include look like keys and excludeKeys

* nit

* Exclude nexted child fields

* add updates and show failing testcases

* working

* add more tests

* even more test cases

* use await for added tests

* lint

* Add suggestions
2021-06-03 14:54:44 -05:00
Kartal Kaan Bozdoğan
5e7c9d2e1a Fixed a bug affecting updates to nested pointers (#7392)
* Fixed a bug affecting updates to nested pointers
  Also created unit tests

* Marked the regression test for #7391 as pending for postgre
  The issue is not fixed yet
Use cont instead of var
2021-05-25 15:33:40 -07:00
dblythy
51e08009f8 Fix: properly pass req.user to liveQuery triggers (#7296) 2021-05-02 11:23:46 +02:00
dblythy
3638b0e791 Fix Twitter API Oauth Error (#7370) 2021-04-25 14:50:45 +02:00
Rikard Teodorsson
64fc04cc26 Cloud Code validator issue with required: false (#7353)
* Only check the type of a parameter in the validator when the parameter is set to required or is not null

* Added test cases. Don't check type or options if required=false and no default value is set

* Added test cases. Don't check type or options if required=false and no default value is set

* Update const optional
2021-04-18 22:22:23 -07:00
Perceval Archimbaud
87dcd23b6a Fix #7340 by correclty computing function name for push event (#7341)
* Add a failing test for issue #7340

If any delay occurs after "message.event" assignation in
LiveQueryServer._onAfterSave, the next subscription or request with a different
event might overwrite it, and by that using the wrong "push" function name.

* Remove updade of message and use res.event instead

This prevent computing function name from a
incorrect event if multiple subscriptions override
one by one the message.event.

* Update CHANGELOG.md

* Replace setTimeout by async/await expressions
2021-04-13 14:47:14 -07:00
Manuel
2e11bf3b5c Remove S3 File Adapter (#7324)
* remove s3 adapter

* moved mock files adapter

* Update package-lock.json
2021-04-09 10:12:24 -05:00
Manuel
bf732b9a6e Add build docker image to CI (#7332)
* add build docker image to CI

* remove node setup

* removed local dependency to test passing docker build

* Update CHANGELOG.md

* Revert "removed local dependency to test passing docker build"

This reverts commit a7801e1874be206c9f3f7bfd367766546bf483b6.

* removed unnecessary docker build options

* fixed docker build
2021-04-09 16:40:03 +02:00
Manuel
a28433f16e Replace mailgun adapter with mock adapter (#7321) 2021-04-06 16:32:48 +02:00
Manuel
7042552507 Enable direct access by default (#6636)
* enabled direct access by default

* removed obsolete direct access option test case

* quick fix test

* Set RESTController during tests

* Properly handle RESTController

* Documentation

* revert changes

* rerun tests

* remove extra parse instance

* Revert "remove extra parse instance"

This reverts commit 21422f45f1548ebddddd1c4ccbc03a94b4994429.

* Ensure restcontroller is set

* Fix test

* improved option docs

* renamed direct access env var

* added deprecations to README

* added deprecation definition

* fixed docs typo

* improve promise rejection warning test

* added renaming of env var to deprecation warning

Co-authored-by: Diamond Lewis <findlewis@gmail.com>
2021-04-05 02:28:28 +02:00
Ali Oğuzhan Yıldız
4d167026ae fix: empty file tags cause upload error for some providers (#7300)
* fix: empty file tags cause upload error for some providers

DigitalOcean and Linode object storage solutions do not accept `tags` option while uploading a file. Previously, tags option was set to default empty object. Now, we do not include it if it is empty.

* chore: add tests for saving a file with/without tags

* chore: update file tags handling to make tests pass

* chore: refactor file tag tests

* chore: update file tag tests

* chore: update changelog

* chore: update changelog entry

* chore: remove duplicated changelog entry
2021-04-02 17:29:46 +02:00
Manuel
2093d61616 Adds deprecator (#7303)
* adds deprecator

* un-fit

* added changelog entry

* some fixes

* un-fit

* removed deprecation definition

* changed deprecation log syntax according to Nodejs
2021-03-30 22:42:34 +02:00
Prerna Mehra
5d9bf24b02 GraphQL: reset password with emailed token (#7290)
* renamed "resetPassword" to "requestResetPassword" & created new "resetPassword" mutation

* added new route to handle resetPassword in UsersRouter.js

* updated resetPassword test to "requestResetPassword" mutation

* updated "resetPassword" mutation args description

* changed token arg description to rerun the tests

* directly using updatePassword for resetPassword

* removed handleResetPassword from UsersRouter.js file

* added test case for reset Password

* changed mutation names to "resetPassword" & "confirmResetPassword"

* changed mutation names in test also
2021-03-28 21:45:41 -07:00
Chris
6313656d8a Excluding keys that have trailing "edges.node" on them (#7273)
* Excluding keys that have trailing "edges.node" on them as they will not be selectable anyway

* Updated CHANGELOG and added test case

* Forgot to change fit back to it
2021-03-17 20:40:11 -07:00
Diamond Lewis
a02014f557 Improve single schema cache (#7214)
* Initial Commit

* fix flaky test

* temporary set ci timeout

* turn off ci check

* fix postgres tests

* fix tests

* node flaky test

* remove improvements

* Update SchemaPerformance.spec.js

* fix tests

* revert ci

* Create Singleton Object

* properly clear cache testing

* Cleanup

* remove fit

* try PushController.spec

* try push test rewrite

* try push enqueue time

* Increase test timeout

* remove pg server creation test

* xit push tests

* more xit

* remove skipped tests

* Fix conflicts

* reduce ci timeout

* fix push tests

* Revert "fix push tests"

This reverts commit 05aba62f1cbbca7d5d3e80b9444529f59407cb56.

* improve initialization

* fix flaky tests

* xit flaky test

* Update CHANGELOG.md

* enable debug logs

* Update LogsRouter.spec.js

* create initial indexes in series

* lint

* horizontal scaling documentation

* Update Changelog

* change horizontalScaling db option

* Add enableSchemaHooks option

* move enableSchemaHooks to databaseOptions
2021-03-16 16:05:36 -05:00
Diamond Lewis
1666c3e382 [WIP] Enable test suite to be randomized (#7265)
* initial run

* Update ParseGraphQLServer.spec.js

* temporarily enable reporter

* Bump retry limit

* fix undefined database

* try to catch error

* Handle LiveQueryServers

* Update Config.js

* fast-fail false

* Remove usage of AppCache

* oops

* Update contributing guide

* enable debugger, try network retry attempt 1

* Fix ldap unbinding

* move non specs to support

* add missing mock adapter

* fix Parse.Push

* RestController should match batch.spec.js

* Remove request attempt limit

* handle index.spec.js

* Update CHANGELOG.md

* Handle error: tuple concurrently updated

* test transactions

* Clear RedisCache after every test

* LoggerController.spec.js

* Update schemas.spec.js

* finally fix transactions

* fix geopoint deadlock

* transaction with clean database

* batch.spec.js
2021-03-15 02:04:09 -05:00
Diamond Lewis
9563793303 Allow single server instance in test suite (#7262)
* initial pass

* reconfigureServer when needed

* finish postgres tests

* mongo tests

* more tests

* clean up

* re-add skipped test

* Fix transaction tests

* handle batch

* AuthenticationAdapter fix

* More reconfiguration

* clean up

* properly terminate cli servers

* handle Parse.Push

* Flaky PushController

* ensure reconfigureServer when changed

* fix postgres tests

* remove console.log

* LiveQuery spec remove duplicates and listeners
2021-03-13 09:05:22 -06:00
Diamond Lewis
8b0e8cd02c Fix Parse.Push flaky tests (#7263)
* Fix Push Notification Flaky Tests

* handle all tests
2021-03-12 15:50:13 -08:00
Diamond Lewis
39fa17f914 Postgres: Properly initialize database on startup and debugger (#7255)
* PG: Properly initialize database

* fix flaky tests

* flaky test

* correct test

* no idea

* clean up debugger
2021-03-10 11:31:35 -08:00
Manuel
bee889a329 Add security check (#7247)
* added Parse Server security option

* added SecurityRouter

* added Check class

* added CheckGroup class

* moved parameter validation to Utils

* added CheckRunner class

* added auto-run on server start

* added custom security checks as Parse Server option

* renamed script to check

* reformat log output

* added server config check

* improved contributing guideline

* improved contribution guide

* added check security log

* improved log format

* added checks

* fixed log fomat typo

* added database checks

* fixed database check

* removed database auth check in initial version

* improved contribution guide

* added security check tests

* fixed typo

* improved wording guidelines

* improved wording guidelines
2021-03-10 13:19:28 -06:00
Manuel
de50b7b23d Add custom routes to pages router (#7231)
* added custom routes

* fixed docs typos

* added page.customRoutes config validation

* added 404 response if missing custom route response

* added docs

* minor README formatting

* added CHANGELOG entry

* fixed bug in definitions builder that did not recognize array of custom type

* added missing route handler definition

* fixed custom routes definition
2021-03-07 13:51:35 +01:00
Brett Ponder
b20aa0c677 Remove Stage name check on aggregate pipelines (#7237)
* add search for atlas search index

* added test for search in pipeline

* removed stage name check in pipeline

* removed spec for invalid query invalid key

* updated changelog

Co-authored-by: Diamond Lewis <findlewis@gmail.com>
2021-03-03 14:46:49 -08:00
Manuel
d789ca6b40 Fix password reset, email verification for custom endpoint (#7236)
* fixed incorrect endpoint for password reset and email verification

* added tests
2021-03-03 00:53:02 +01:00
dblythy
3833868709 New: Validate Cloud Validators (#7154)
* new: validate cloud validators

* add otherKey

* Update CHANGELOG.md

* Update CloudCode.Validator.spec.js

* Update CloudCode.Validator.spec.js

* new: validate cloud validators

* add otherKey

* Update CHANGELOG.md

* Update CloudCode.Validator.spec.js

* Update CloudCode.Validator.spec.js

* Update Parse.Cloud.js

* Update CHANGELOG.md

* Change to throw error

Co-authored-by: Antonio Davi Macedo Coelho de Castro <adavimacedo@gmail.com>
2021-03-02 00:52:21 +01:00
Corey
2b9b336dd9 Fix flaky postgres test (#7228)
* Fix flaky postgres test

* add pgcrypto extension to test

* fix postgres ref link CONTRIBUTING guide and add pgcrypto extension

* Update CONTRIBUTING.md
2021-02-25 17:28:15 -06:00
Miguel Serrano
92f50f6808 Add support for Facebook Limited Login (#7219)
* Add support for Facebook Limited auth

* Add tests

* Fix tests

* Fix tests

* Add entry to changelog

* Cleanup
2021-02-24 07:36:24 -06:00
dblythy
91a0108084 New: allow options to be async on Cloud Validator (#7155)
* new: allow options to be async on Cloud Validator

* Update CHANGELOG.md

* Ensure pushStatus is properly running (#7213)

* Ensure pushStatus is properly running

* remove duplicate test

* new: allow options to be async on Cloud Validator

* Update CHANGELOG.md

* Update CloudCode.Validator.spec.js

Co-authored-by: Diamond Lewis <findlewis@gmail.com>
2021-02-23 02:56:54 -06:00