* Auth module refactoring in order to be reusable
* Ensure cache controller is properly forwarded from helpers
* Nits
* Adds support for static validation
* Adds support for CLP in Live query (no support for roles yet)
* Adds e2e test to validate liveQuery hooks is properly called
* Adds tests over LiveQueryController to ensure data is correctly transmitted
* nits
* Fixes for flow types
* Removes usage of Parse.Promise
* Use the Auth module for authentication and caches
* Cleaner implementation of getting auth
* Adds authCache that stores auth promises
* Proper testing of the caching
* nits
* Various improvements in test name / de-duplications
* Reverts to class by class deletion, introduced fast mode that just delete data for mongo
- Speeds up are incredible Executed 1695 of 1713 specs INCOMPLETE (18 PENDING) in 4 mins 19 secs.
* Adds documentation about the deleteEverything
* 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
* add failing test to demonstrate that you can't sort on a
field in an object.
* Only validate the base of the field name.
* fix test name
* Only test sort for mongo.
* pg order by nested object
* level 2 test
* Factor out operation to get a field's base name. Add comment.
* tweak comment wording so it wont make my grammar teacher angry.
* adding nor to specialQuerykeys
* adding nor suport
* adding test
* CRLF
* adding postgres NOR
* adding nor validation
* adding NOR test
* adding test amd fixing NOR cases
* revert the nor logic
* Introduces flow types for storage
* Better typing of QueryOptions
* Adds flow types to SchemaCOntroller,
- runs flow on pre tests
- fixes flow
* Adds ClassLevelPermissions type
* Moves Controller types into a single file
* Changes import styles
* Changes import styles
* fixing method setIndexesWithSchemaFormat (#4454)
Fixing invalid database code in method `setIndexesWithSchemaFormat`:
* It must be a transaction, not a task, as it executes multiple database changes
* It should contain the initial queries inside the transaction, providing the context, not outside it;
* Replaced the code with the ES6 Generator notation
* Removing the use of batch, as the value of the result promise is irrelevant, only success/failure that matters
* nits
* Fixes tests, improves flow typing
* Add Indexes to Schema API
* error handling
* ci errors
* postgres support
* full text compound indexes
* pg clean up
* get indexes on startup
* test compound index on startup
* add default _id to index, full Text index on startup
* lint
* fix test
* 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
* Refactors pushStatusHandler to use HTTP interface so we can bind CloudCode hooks
* Handle correctly nested dot atomic operations
* Better handling of restricted class names, add support for afterSave _PushStatus
* Adds simple testing for afterSave(PushStatus)
* Reverts jobStatusHandler
* Addresses fixes
* adds delays to all methods
* 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
* 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
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
* 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
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
MongoDB has an unfixed bug in all supported versions 2.6-3.4 which
results in suboptimal index usage for `$or` queries when the query has
implicit `$and`s at the query root.
When adding `_rperm` to `$or` queries, Parse accidentally creates
queries which hit this bug.
The fix in this commit applies the suggested workaround of putting the
`_rperm` property inside all `$or` subdocuments, moving it from the top
level and leaving `$or` as the only top-level operator.
MongoDB Bug Link: https://jira.mongodb.org/browse/SERVER-13732
* adds resetTokenValidityDuration setting
* adds a validator to validate password that can be used to enforce strong
passwords
* adds unit tests for passwordPolicy.validator
* adds unit tests to to fail reset password function if password is not in a valid format
* updates README.md for passwordPolicy
* prevents duplicate check for password validator in updateUserPassword
* adds optional setting to disallow username in password
* updates test cases to use fdescribe instead of describe
* updates test cases to use request-promise instead of request
* adds ability to use a RegExp or Callback function or both for a passwordPolicy.validator
* expect username parameter in redirect to password_reset_success
* adds support for _perishable_token_expires_at in postgres
* Add option to reuse database controller between requests. Clear schema cache when deleting everything
* Add test
* Rename setting to persistSchemaCache to more accurately reflect effect
* Repurpose option to determine whether to randomize cache prefix. Restore Config.js controller creation. Add tests
* Fix bug with missing parameter passed to to SchemaCache
* Renaming and formatting
* Fix property name typo
* Rename option to avoid double negative and still be falsey by default. Style fix
* Add failing test for multiple .notEqualTo on relation with same class
* Fix multiple .notEqualTo on relations with the same class
Multiple should use the union of all objectIds not the intersect
FixesParsePlatform/parse-server#1596
* Removes runtime dependency babel-polyfill (#2692)
* Removes runtime dependency babel-polyfill
* removes references to polyfilled array includes
* Better support for polyfilling
* Removes unnecessary log
* Adds killswitch if tests are polyfilled
* Reverts usage of includes on strings
* Reproduction for #1567
* Recursive handling of nested pointer keys in select
* Better support for multi-level nested keys
* Adds support for selecting columns natively (mongo)
* Support for postgres column selections
* Filter-out empty keys for pg
* Start DB runner from tests
* Connect GridstoreAdapter only when needed
* removes unused package
* better test errors reporting
* Adds support for __op.Delete
* Better test error reporting
* Makes sure all tests can run without crashing
* Use xdescribe to skip test suite
* Removes unused dependencies
* Let volatiles classes be created with PG on start
* Do not fail if class dont exist
* adds index.spec.js to the pg suite
* Use a new config each test to prevent side effects
* Enable EmailVerificationToken specs with pg
* Makes sure failure output is not cut
* Reduces number of ignored tests in ParseObject.spec
* Inspect reconfiguration errors
* Mark GlobalConfig is incompatible with PG
- Problem is with nested updates (param.prop = value)
* PG: Nested JSON queries and updates
- Adds support for nested json and . operator queries
- Adds debug support for PG adapter
- Adds loglevel support in helper
* Enable working specs in ParseUser
* Sets default logLevel in tests to undefined
* Adds File type support, retores purchaseValidation specs
* Adds support for updating jsonb objects
- Restores PushController tests
* Proper implementation of deleteByQuery and ORs
- Adds ParseInstallation spec to the test suite
* xit only failing tests
* Nit on ParseAPI spec
* add sorting operator
* properly bound order keys
* reverts describe_only_db behavior
* Enables passing tests
* Adds basic support for relations, upsertOneObject aliased to createObject
* progress on queries options
* Fix ACL update related problems
* Creates relation tables on class creation
* Adds Relation tests
* remove flaky tests
* use promises instead of CB
* disable flaky test
* nits
* Fixes on schema spec
- Next thing is to implemenet geopoint and files correctly
* fix failues
* Basic GeoPoint support
* Adds support for $nearSphere/$maxDistance geopoint queries
* enable passing tests
* drop tables afterEach for PG, clean up relation tables too
* Better initialization/dropTables
* Refactor logging to provide common logger from LoggerAdapter
Move logger logic de WinstonLoggerAdapter
Further improvements in configuration
Use logger instead of getLogger
- Removes PLog module
Reverts name changes
nits
* Adds additional logging levels as requirements
* Adds tests for logging configuration
* removes flaky test
* investigate...
* further investigation
* Adds silent option to disable console output
* Restores logs with VERBOSE in tests
* Expose controller instead of adapter, reduces method requirements for adapter
* Shuffles initializations around
* Fix doc
* Load cloudCode last to make sure the logger is available
* Adds test to make sure we can load an adapter from npm module
* extract defaults
* Adds defaultMongoURI to defaults
* fix defaults values
* Proper error for PG failures
* Disable flaky test