Commit Graph

96 Commits

Author SHA1 Message Date
Oussama Meglali
2170962a50 feat: Add support for MongoDB query comment (#8928) 2024-03-03 02:27:57 +01:00
Rikard Teodorsson
7d32d8934f fix: Context not passed to Cloud Code Trigger beforeFind when using Parse.Query.include (#8765) 2023-10-14 02:57:47 +02:00
Yechezkel Deren
45a3ed0fcf perf: Improve performance of recursive pointer iterations (#8741) 2023-09-13 14:16:33 +02:00
Manuel
5954f0ffa0 refactor: Parse Pointer allows to access internal Parse Server classes and circumvent beforeFind query trigger (#8735) 2023-09-04 16:01:02 +02:00
Daniel
ce34747e8a fix: Parameters missing in afterFind trigger of authentication adapters (#8458) 2023-03-06 03:18:00 +01:00
Daniel
c793bb88e7 feat: Add afterFind trigger to authentication adapters (#8444) 2023-03-06 01:35:15 +01:00
dblythy
5bbf9cade9 feat: Improve authentication adapter interface to support multi-factor authentication (MFA), authentication challenges, and provide a more powerful interface for writing custom authentication adapters (#8156) 2022-11-10 17:35:39 +01:00
Manuel
e39d51bd32 fix: brute force guessing of user sensitive data via search patterns; this fixes a security vulnerability in which internal and protected fields may be used as query constraints to guess the value of these fields and obtain sensitive data (GHSA-2m6g-crv8-p3c6) (#8144) 2022-09-02 21:13:18 +02:00
dblythy
8ed94421e6 fix: add support for descending sorting of full text search (#7496) 2021-09-15 16:15:08 +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
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
dblythy
e53b6c2f87 run prettier (#7172) 2021-02-12 10:18:49 +01:00
Manuel
b59517fd68 Add tests against multiple MongoDB versions (#7161)
* added tests environment with mongodb 4.4.3

* added CI test for mongodb 4.4.3

* added CI tests for MongoDB versions 4.0, 4.2

* improved flaky test (seems to max out the limit of simultaneous connections)

* added spec helpers to run tests only for specific MongoDB version

* addedn npm scripts to run tests against relevant mongodb versions

* added spec helper function to exclude specific mongodb version

* added test for changed aggregate query planner results

* fixed regex test with incorrect regex syntax

* fixed test where query has select no keys (empty array)

* added changelog entry and ordered list

* fixed test that tried to simultaneously delete and build index on same collection

* added MongoDB compatibility table to readme

* updated default local tests to use MongoDB 4.4.3

* added MongoDB badges for new versions to README

* fixed typo in readme

* added new test helper filter to contribution guide

* fixed incorrect storage engine for mongodb 4.4

* changed CI to test MongoDB 3.6. with mmapv1 storage engine and standalone

* improved CI test description

* added CI self check for new MongoDB versions

* fixed CI

* removed CI

* added CI

* added throwing error if any of the checks failed

* added github action connector

* improved error message

* improved error messages

* improved error message

* updated CI environment to MongoDB 3.6.22

* improved error messages

* update CI env name

* updated CI env name

* improved error message

* removed patch versions from CI env description

* improved status message

* removed version range from core lib

* added explicit mongodb version to redis test and node 12 test

* bumped Node 12 test to 12.20.1 (version currently recommended by AWS Elastic Beanstalk)
2021-02-07 23:16:46 +01:00
dblythy
41a052c2c3 Fix: context for afterFind (#7078)
* Fix: context for afterFind

* Update CHANGELOG.md

Co-authored-by: Manuel <trezza.m@gmail.com>
2020-12-18 14:54:48 +01:00
Corey
568c285369 Fix includeAll for querying a Pointer and Pointer array (#7002)
* initial test

* Add failing testcase

* fix includeAll by considering array
2020-11-11 10:57:41 -06:00
Diamond Lewis
e6ac3b6932 fix(prettier): Properly handle lint-stage files (#6970)
Now handles top level files and recursive files in folders.

Set max line length to be 100
2020-10-25 15:06:58 -05:00
dblythy
c68d05512f Pass request.query to afterFind (#6960)
* Initial Commit

* Update triggers.js
2020-10-21 21:40:40 -05: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
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
Diamond Lewis
095164babd Prevent afterFind with saving objects (#6127)
Fixes: https://github.com/parse-community/parse-server/issues/6088
2019-10-15 15:50:25 -05:00
Diamond Lewis
cf6e79ee75 Fix: Lint no-prototype-builtins (#5920)
* Fix: Lint no-prototype-builtins

Closes: https://github.com/parse-community/parse-server/issues/5842

Reference: https://eslint.org/docs/rules/no-prototype-builtins

* replace Object.hasOwnProperty.call
2019-08-14 14:57:00 -07:00
Diamond Lewis
1a7f64d8d9 Fix: Undefined dot notation in matchKeyInQuery (#5917)
* Fix: Undefined dot notation in matchKeyInQuery

* fix test

* fix postgres test

* improve tests

* FINAL test
2019-08-13 21:34:46 -07:00
Raschid J.F. Rafeally
9816285205 Added rest option: excludeKeys (#5737)
* Added restOption: excludeKeys

* improve tests
2019-07-10 15:01:21 -05:00
Antonio Davi Macedo Coelho de Castro
afa74d655d Futzing with read preference (#3963)
* allow setting readpreference when using rest api.

* take out partially complete unit test.

* oops. nit

* Include read preference option for find directly from api and adding few more tests

* Adding catch for all tests

* Keep same check for get and find

* Turn read preference case insensitive

* Includes and subqueries read preferences through API

* Fixing bugs regarding changes that were done in master branch during the last year

* Changing behavior to make includeReadPreference and subqueryReadPreference to follow readPreference by default
2019-05-14 12:58:02 -07:00
awgeorge
0dec4931a0 Add filter sensitive fields logic that apply CLPs\nAdd protectedFields CLP\nAdd defaults for protectedFields CLP\nFix tests 2019-02-23 07:28:39 -08:00
awgeorge
b343de0c70 Set default protectedFields and remove previous filter logic 2019-02-23 07:28:39 -08:00
Florent Vilmart
46ac7e7f11 Adds fix for issue affecting update with CLP (#5269)
* Adds fix for issue affecting update with CLP

* Disable single instance
2019-01-04 14:23:27 -05:00
Perceval Archimbaud
9f2fc88f0f Fix issue #5274 on RestQuery.each and relations (#5276)
* Add test on RestQuery.each with relation

* Fix the failing test for RestQuery.each and relations

* Add test for getRolesForUser

* Fix format for comment

* Remove extra fit
2019-01-04 14:22:46 -05:00
Antoine Cormouls
de79b70cbc Ensure all roles are properly loaded #5131 (#5132)
* Fix Limitation Role #5131

Allow to manage Live Query with User that have more than 100 Parse.Roles

* Clean Up

* Add Custom Config Support and Test

* Fix Auth Test

* Switch to Async Function

* Fix restWhere

* Fix Test

* Clean Final Commit

* Lint Fix

* Need to Fix Test Callback

* Fixes broken test

* Restore find() method in spy

* adds restquery-each

* small nit

* adds changelog
2018-10-20 16:45:23 -04:00
Florent Vilmart
d83a0b6808 Use Prettier JS (#5017)
* Adds prettier

* Run lint before tests
2018-09-01 13:58:06 -04:00
Florent Vilmart
bf9fdb41ed Ensure the ACL is always part of the payload when using select (#4967)
* Ensure the ACL is always part of the payload when using select

* Update changelog

* fix for PG
2018-08-15 09:48:32 -04:00
Diamond Lewis
f1b008388c Support include('*') Query (#4947) 2018-08-10 12:51:32 -05:00
Florent Vilmart
3bcb5a0997 Ensure User ACL's are more flexible and secure #3588 (#4860)
* Fixes an issue that would let the beforeDelete be called when user has no access to the object

* Ensure we properly lock user

- Improves find method so we can attempt to read for a write poking the right ACL instead of using masterKey
- This ensure we do not run beforeDelete/beforeFind/beforeSave in the wrong scenarios

* nits

* Caps insufficient
2018-06-28 16:31:22 -04:00
Diamond Lewis
0e93306867 nit 2018-06-16 10:16:54 -07:00
Diamond Lewis
00252cbeff add includeAll option 2018-06-16 10:16:54 -07:00
Florent Vilmart
fc47f9b84f issue(afterFind): Fixes issue when using afterFind with relations (#4752)
* Adds failing test for the issue

* Adds fix for the issue
2018-05-18 09:36:56 -04:00
Diamond Lewis
d8f3fb16bd Skip afterFind for Aggregate and Distinct Queries (#4596) 2018-02-28 19:32:01 -06:00
Arthur Cinader
1876d3f3fd Add doesNotMatchKeyInQuery case... 2017-11-30 12:40:39 -08:00
Henrik Malmberg
741f869140 Allows to use dot-notation to match against a complex structure when using matchesKeyInQuery 2017-11-30 12:40:39 -08:00
Diamond Lewis
7223add446 Support for Aggregate Queries (#4207)
* Support for Aggregate Queries

* improve pg and coverage

* Mongo 3.4 aggregates and tests

* replace _id with objectId

* improve tests for objectId

* project with group query

* typo
2017-11-12 14:00:22 -05:00
Benjamin Wilson Friedman
9145c88562 Corrected outdated links (#4254) 2017-10-12 22:40:47 -04:00
Florent Vilmart
0f840b6bb8 Fix/issue pointer permissions (#4141)
* Makes sure we don't override roles

* Reduces the query size whith pointer permissions

- Does not return as $and if not needed
- Returns just the query with the additional constraint

* Do not use $in if include is just of length 1
2017-09-09 14:02:07 -04:00
Antonio Davi Macedo Coelho de Castro
b6298feaa7 Read preference option per query (#3865) 2017-06-21 23:18:10 +03:00
Antonio Davi Macedo Coelho de Castro
4509d25471 Endpoints for audiences CRUD (#3861) 2017-06-21 08:54:13 +03:00
greenkeeper[bot]
e94991b368 Update dependencies to enable Greenkeeper 🌴 (#3940)
* chore(package): update dependencies

* docs(readme): add Greenkeeper badge

* Fix indent issues with eslint 4.0

see http://eslint.org/docs/user-guide/migrating-to-4.0.0\#-the-indent-rule-is-more-strict
2017-06-20 09:15:26 -07: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
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
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
ca286b7108 Enable prefer-const lint rule (#3202) 2016-12-07 18:17:05 -05:00