Commit Graph

1492 Commits

Author SHA1 Message Date
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
Lukáš Smilek
b185fad695 Additional explication for expireInactiveSessions in ParseServerOptions (#7552)
* Update docs.js

Additional explication for `expireInactiveSessions`

* Update index.js

Additional explication for `expireInactiveSessions`

* Update docs.js

correcting spelling error

* Update index.js

correcting spelling error

* Update Definitions.js

Co-authored-by: Manuel <5673677+mtrezza@users.noreply.github.com>
2021-09-10 15:49:20 +02:00
Corey
24e9bdc639 ci: Fix docker image pushing to Docker Hub (#7548)
* add actions file

* nit

* add multi-platform

* add buildx

* reduce platforms

* remove arm7

* add back arm7

* add missing archs

* remove failing image

* add back in linux/s390x

* switch image name to parse-server

* remove failing images

* nit spelling

* Nit

* add comment about nightly builds
2021-09-07 14:35:03 +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
Manuel
27832453e2 refactor: clean code (#7542)
* add issue bot for prs

* Update CHANGELOG.md

* Update issue-bot.yml

* reformat code
2021-09-03 01:23:15 +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
c3b71ba5b6 [Snyk] Upgrade ws from 7.4.6 to 7.5.3 (#7457)
* fix: upgrade ws from 7.4.6 to 7.5.0

Snyk has created this PR to upgrade ws from 7.4.6 to 7.5.0.

See this package in npm:
https://www.npmjs.com/package/ws

See this project in Snyk:
https://app.snyk.io/org/acinader/project/8c1a9edb-c8f5-4dc1-b221-4d6030a323eb?utm_source=github&utm_medium=upgrade-pr

* changed logging for circular obj

* upgraded to ws 7.5.3

Co-authored-by: Manuel Trezza <5673677+mtrezza@users.noreply.github.com>
2021-07-25 01:54:28 +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
Snyk bot
755c49404d [Snyk] Upgrade pg-promise from 10.9.2 to 10.10.1 (#7286)
* fix: upgrade pg-promise from 10.9.2 to 10.9.3

Snyk has created this PR to upgrade pg-promise from 10.9.2 to 10.9.3.

See this package in npm:
https://www.npmjs.com/package/pg-promise

See this project in Snyk:
https://app.snyk.io/org/acinader/project/8c1a9edb-c8f5-4dc1-b221-4d6030a323eb?utm_source=github&utm_medium=upgrade-pr

* bump pg-promise to 10.10.1

* fix add field if not exists

* lint

Co-authored-by: Diamond Lewis <findlewis@gmail.com>
2021-04-29 12:10:15 -05: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
Manuel
91be6bb59a fix(utils): permutation helper (#7355)
* fix permutation helper

* fix typo
2021-04-17 00:22:01 +02: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
c56d326b17 Add circular dependency detection to CI (#7316)
* add circular dependency detection to CI

* fixed Auth-RestWrite circular dependency

* updated package lock

* fixed Logger circular dependency

* fix lint
2021-04-07 20:47:57 -05: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
Vitaly Tomilov
25fb476bf8 Update PostgresClient.js (#7276)
Proper pg-monitor re-attachment logic.
2021-03-18 15:54:17 -05: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
Manuel
637326d3af bump mongodb version in CI (#7272)
* bump mongodb version

* improved wording in changelog

* another mongodb bump

* rewording changelog

* added info to option docs
2021-03-17 01:57:10 +01: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
32fc45d2d2 Add KeyPromiseQueue to Push and Job StatusHandlers (#7267)
* Add KeyPromiseQueue to Push and Job StatusHandlers

* Update CHANGELOG.md

* Update CHANGELOG.md
2021-03-15 18:51:46 -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
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
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
Diamond Lewis
f1394a93c2 Ensure pushStatus is properly running (#7213)
* Ensure pushStatus is properly running

* remove duplicate test
2021-02-20 15:17:15 -06:00
OverDrive
a1cd631425 Fix for authenticating with instagram (#7173)
* Fix for authenticating with instagram

* Change tests for instagram authentication

* Instagram authentication for the case when data child object is presented in the response
2021-02-19 13:19:13 -06:00
Antonio Davi Macedo Coelho de Castro
a430d6f7b7 Fix flaky test with transactions (#7187)
* Fix flaky test with transactions

* Add CHANGELOG entry

* Fix the other transactions related tests that became flaky because now Parse Server tries to submit the transaction multilpe times in the case of TransientError

* Remove fit from tests
2021-02-18 10:18:54 -08:00
dblythy
3d76643286 New: requireAnyUserRoles and requireAllUserRoles for Parse Cloud Validator (#7097)
* new: requireUserRole for Parse Cloud Validator

* change to requireUserRoles

* Update CHANGELOG.md

* revoke triggers

* Update triggers.js

* Update ParseLiveQueryServer.js

* Update ParseLiveQueryServer.js

* create requireUserRoles

* rename to requireAny and requireAll

* allow for a function
2021-02-12 14:01:38 -08:00
Kartal Kaan Bozdoğan
7224cde023 fix: Pass customObjectId in beforeSave (#7167)
* beforeSave custom object id fix

* Added regression test case for issue #6733
2021-02-12 15:57:22 -06:00
dblythy
e53b6c2f87 run prettier (#7172) 2021-02-12 10:18:49 +01:00
dblythy
27d56f0801 Fix: Proper handling of arrays for cloud validator (#7178)
* fix: proper handling of arrays for cloud validator

* Update CloudCode.Validator.spec.js
2021-02-11 00:29:34 -06:00