Commit Graph

850 Commits

Author SHA1 Message Date
Diamond Lewis
ce7ff2ca44 Add original object to LiveQuery Events (#5265)
* Add original object to LiveQuery Events

* change response original
2018-12-28 17:56:08 -05:00
Diamond Lewis
99698928af Fix for #5207 (#5257) 2018-12-23 19:40:59 -06:00
Diamond Lewis
ab32dbc9a2 PG: Fix containedIn query on empty array (#5254)
* PG: Fix containedIn query on empty array

* improve logic
2018-12-19 17:57:55 -06:00
Diamond Lewis
631b1684e2 PG: Updating mixed array test (#5252)
* PG: Updating mixed array test

Currently we can save a mixed array but not update

* build array instead of casting

* fix test

* add recursion
2018-12-18 17:38:05 -06:00
Diamond Lewis
7b3da8b744 PG: Fix updating numeric array (#5251)
* PG: Fix updating numeric array

* lint
2018-12-18 12:11:24 -06:00
Diamond Lewis
d478e001b5 PG: Support multiple global config (#5242)
* PG: Support Multiple Configs

* rename test

* refactor
2018-12-14 17:39:07 -06:00
Diamond Lewis
daab3781a2 Support Distinct for special fields (#5144)
* Support Distinct for special fields

* update changelog
2018-10-26 10:21:42 -05:00
Georges Jamous
961abda4eb "Object not found." instead of "Insufficient auth." when using master key (#5133)
* add additional isMaster check

* adding some tests

* nits

* covering all basis
2018-10-22 19:33:43 -04: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
4b7037ac9a Fix intense CPU usage when sessionToken is invalid in liveQuery (#5126)
* Ensure we bail out early when auth or userId are not provided (sessionToken fetch is invalid)

* Adds changelog

* better handling of session token errors and client tokens
2018-10-18 07:21:31 -04:00
Florent Vilmart
7c81290252 Live query CLP (#4387)
* 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
2018-10-17 17:53:49 -04:00
Arthur Cinader
b3b4461fe2 pr comments:
consolidate write operations
also tweak test text
2018-10-11 09:09:56 -07:00
Arthur Cinader
6ebce1832b Expire password reset tokens if user's email changes. 2018-10-11 09:09:56 -07:00
Arthur Cinader
152ff41cf8 fix the expectation on the failing test. 2018-10-11 09:09:56 -07:00
Arthur Cinader
34b51f7289 Add failing test to show
that changing a user's email
does not delete their perishable token.
2018-10-11 09:09:56 -07:00
Arthur Cinader
317682d7f6 Typos 2018-10-11 09:09:56 -07:00
Florent Vilmart
f1bc55bf89 Reduces number of calls to injectDefaultSchema (#5107) 2018-10-08 14:16:29 -04:00
Florent Vilmart
045d941aef Remove request and request-promise from dev dependencies (#5077)
* removes from emailverificationtoken spec

* updates winston

* Updates ValidationAndPasswordsReset

* Use local request in schemas

* Removes request in rest.spec

* Removes request from PushRouter0

* removes request from public API

* removes request from index.spec

* Removes request form parse.push spec

* removes request from ParseInstallation spec

* Removes from ParseHooks

* removes request from ParseGlobalConfig.spec

* Removes request from ParseAPI.spec.js

* removes request from LogsRouter

* removes in features

* Filters undefined headers instead of crashing

* Removes request from ParseUser spec

* Removes usage of request in ParseFile.spec.js

* Removes request from AuthAdapters.js

* removes request-promise from ParseGeoPoint.spec

* Removes request-promise from ParseQuery spec

* remove request-promise from UserPII

* removes request-promise from EnableExpressErrorHandler

* Updates RevocableSessionUpgrade spec

* Update RestQuery

* Removes read preferenceOptionM

* ensure we forward auth from URL

* use request in CloudCode.spec.js

* Removes request-promise from JobSchedule.spec

* Removes rp from VerifyUserPassword.spec.js

* Removes rp from PasswordPolicy spec

* Removes rp from ParsePolygon spec

* Removes rp from fullTextSearch spec

* Removes rp from PArseQuery.Aggregate

* Ensure we properly forward errors

* Removes request and request-promise
2018-09-24 17:07:51 -04:00
Florent Vilmart
93a0017b25 remove runtime dependency on request (#5076) 2018-09-23 12:31:08 -04:00
Florent Vilmart
576779b69b Updates JS SDK to 2.1.0 (#5043) 2018-09-08 20:05:32 -04:00
Florent Vilmart
cfa22d0a62 Use spies for CloudCode logger tests (#5042) 2018-09-08 18:46:26 -04:00
Florent Vilmart
a42101531a Silences warnings from mongodb client (#5025)
* Silences warnings from mongodb client

* Update count, delete and finds to recommended implementations

* With new parser, readPref will be null by default

* Update flaky specs wih async/await style

* Adds gridstore adapter spec

* Use GridFSBucketStorage adapter
2018-09-04 16:15:09 -04:00
Florent Vilmart
d83a0b6808 Use Prettier JS (#5017)
* Adds prettier

* Run lint before tests
2018-09-01 13:58:06 -04:00
orette
c7357ed109 Use the correct function when validating google auth tokens (#5018)
* Use the correct function when validating google auth tokens

httpsRequest.request expects the param postData and has no default value
or validation to check if it is missing before using it. As a result, an
error `TypeError: First argument must be a string or Buffer` is
thrown when an attempt is made to authenticate with Google.

A quick check on the LinkedIn, FB, and twitter authentication adapters
shows they are using httpsRequest.get for their validation calls.

* Correct google auth adapter tests
2018-08-30 20:17:46 -04:00
eddyLazar
41acaa0570 fixed vkontakte validateAuthData (#4977)
* fixed vkontakte validateAuthData

* updated changelog
2018-08-17 15:38:07 -04:00
Florent Vilmart
b740db335b Allows undefined values to pass from mongo to database controler (#4973)
* Allows undefined values to pass from mongo to database controler

* Adds changelog
2018-08-16 11:24:33 -04:00
Florent Vilmart
457d51a972 Adds context object in Cloud Code hooks (#4939)
* wip

* Refactors triggers a bit

- Adds testing for hooks and context

* comment nit

* nits
2018-08-15 10:47:21 -04:00
Florent Vilmart
488b2ff231 Migrate to new cloud code interfaces
removes job status object, moves messasge method on req object

Adds 3.0.0 migration guide

Fixes nits about 3.0.0 documentation

Adds update guide to README
2018-08-15 10:47:21 -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
4802b1caec Add pipeline key to Aggregate (#4959)
* Add pipeline key to Aggregate

* clean up

* unit tests
2018-08-12 20:05:08 -05:00
Florent Vilmart
8ba8a3393d Removes second log when responding with a regular error 2018-08-12 19:04:48 -04:00
Florent Vilmart
b9673da07b Refactor all auth adapters to reduce duplications (#4954)
* Refactor all auth adapters to reduce duplications

* Adds mocking and proper testing for all auth adapters

* Proper testing of the google auth adapter

* noit
2018-08-12 11:05:28 -04:00
Diamond Lewis
f1b008388c Support include('*') Query (#4947) 2018-08-10 12:51:32 -05:00
Florent Vilmart
2ae603574c Auth module refactoring in order to be reusable (#4940)
* Auth module refactoring in order to be reusable

* Ensure cache controller is properly forwarded from helpers

* Nits
2018-08-09 13:02:06 -04:00
Florent Vilmart
a021fef830 Adds exposed headers to avoid issue in JS SDK (#4934)
* Adds exposed headers to avoid issue in JS SDK

* Adds test for headers
2018-08-07 11:13:15 -04:00
Florent Vilmart
ff25ae254d Update parse SDK to 2.0.0 (#4925)
* WIP: Integrate JS SDK v2

- Removes backbone style callbacks
- Use Promise instead of Parse.Promise

* Fixes ParseObject and ParseRelation

* Updates Parse.Query with promises

* Alls tests should pass

* Ensure a fresh user is used for each test

* Use REST implementation to avoid side effects for username/email duplicates

* Uses js sdk v2
2018-08-05 13:58:07 -04:00
GabrielLomba
a61ef7ee2f Fix typo in FilesController.spec (#4917)
* Add the addFileNameHash option that allows users to remove the hash from file names

* Change option name to preserveFileName

* Revert changes to package-lock.json

* Fix typo in FileController.spec
2018-07-27 17:41:04 -04:00
GabrielLomba
6a151ee135 Add the addFileNameHash option that allows users to remove the hash f… (#4915)
* Add the addFileNameHash option that allows users to remove the hash from file names

* Change option name to preserveFileName

* Revert changes to package-lock.json
2018-07-27 09:04:06 -04:00
Florent Vilmart
a2c40367fa Ensures the test suites are properly formed for vscode jasmine plugin (#4901)
* Ensures the test suites are properly formed for vscode jasmine plugin

* nit
2018-07-19 07:05:27 +00:00
Florent Vilmart
efb6c63a95 Ensure legacy users with authData are not locked out (#4898)
* Adds fix for issue, ensuring legacy users with no ACL are properly handled

* Runs tests only on mongo
2018-07-18 14:42:50 +00:00
Saulo Tauil
b22947d4ec Enable express error handler (#4697)
* Propagate error to express handler in all situations

* Call the default error handler if `enableExpressErrorHandler` is truthy

* Updating options interface and definitions

* Testing express error handler

* Test spec fixes

* Fix test
2018-07-17 19:47:00 +00:00
Ross Bayer
ced6b76ef5 Support incrementing push badge value by more than 1 (#4889)
* Support 'IncrementByN' badge value for higher push badge increments

* Fix test

* Rely on object for badge incrementation (i.e. {increment: 3}) rather than string (IncrementBy3)

* For badge incrementation, utilize format similar to other operation notation
2018-07-12 20:34:08 +02:00
Florent Vilmart
960431b92d Even faster tests (#4868)
* 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
2018-07-03 11:13:08 -04:00
Florent Vilmart
ae1a8226d5 Removes need to use babel-register (#4865)
* Removes need to use babel-register

- Adds watch to watch changes when running the test to regenerate
- Tests are now pure node 8

* Adds timing to helper.js

* Update contribution guide

* Adds inline sourcemaps generation to restore coverage

* nits
2018-07-02 23:30:14 -04:00
Florent Vilmart
e97df073df Testing improvements (#4863)
* Adds supports-color so spec reporter dont output colors when not supported

* Adds babelrc so breakpoints dont jump around in specs

* Rename test to avoid duplicated name

* Removes unused methods

* Better naming for it_exclude
2018-07-01 00:00:37 -04:00
Florent Vilmart
585938ca2c improves test performance on mongodb (#4862)
* improves test performance on mongodb

* Removes unused methdos
2018-06-29 17:09:51 -04: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
greenkeeper[bot]
b332f4d4ae Update mongodb to the latest version 🚀 (#4855)
* fix(package): update mongodb to version 3.1.0

* chore(package): update lockfile

https://npm.im/greenkeeper-lockfile

* starting mongo 3.1.0, read preferences are passed again

* Adds test confirming #4831 is properly functional now
2018-06-27 14:12:51 -04:00
Chris
5cdbde244a #4678: Converting strings to Date when schema.type is Date within agg… (#4743)
* #4678: Converting strings to Date when schema.type is Date within aggregate function

* Added test cases to test new date match aggregate query

* Added function to parse match aggregate arguments and convert necessary values to Date objects

* Added missing return value

* Improved code quality based on suggestions and figured out why tests were failing

* Added tests from @dplewis

* Supporting project aggregation as well as exists operator

* Excluding exists match for postgres

* Handling the $group operator similar to $match and $project

* Added more tests for better code coverage

* Excluding certain tests from being run on postgres

* Excluding one more test  from postgres

* clean up
2018-06-26 17:18:04 -05:00
Diamond Lewis
64388a31ad Aggregate allow multiple of same stage (#4835)
* Aggregate Allow Multiple Stages

* remove testing files

* nit

* spread them
2018-06-23 11:28:17 -05:00