Commit Graph

978 Commits

Author SHA1 Message Date
Diamond Lewis
2533db0ad3 Fix installationId on LiveQuery connect (#6180)
Throws an error and prevents LiveQuery from reconnecting.

Fixes Monitoring installationId.
Allow installationId to be sent to and from client.
2019-11-04 15:53:13 -06:00
Diamond Lewis
b44726987d Support Google Play Games Service (#6147)
* Support Google Play Games Service

* clean up

* improve coverage

* more tests
2019-10-28 13:16:55 -05:00
Manuel Trezza
9d781c481f Throw error when setting authData to null (#6154)
* added ignore authData field

* add fix for Postgres

* add test for mongoDB

* add test login with provider despite invalid authData

* removed fit

* fixed ignoring authData in postgres

* Fix postgres test

* Throw error instead of ignore

* improve tests

* Add mongo test

* allow authData when not user class

* fix tests

* more tests

* add condition to synthesize authData field only in _User class

it is forbidden to add a custom field name beginning with `_`, so if the object is not `_User` , the transform should throw

* add warning log when ignoring invalid `authData` in `_User`

* add test to throw when custom field begins with underscore
2019-10-27 20:28:06 -05:00
Mike Patnode
1c8d4a6519 Move filename validation out of the Router and into the FilesAdaptor (#6157)
* Move filename validation out of the Router and into the FilesAdaptor

* Address PR comments

* Update unittests to handle FilesAdapter interface change

* Make validateFilename optional
2019-10-26 21:15:21 -05:00
Saimoom Safayet Akash
cf9245a4a2 Added warning for special URL sensitive characters for appId (#6159)
* Added warning for special url sensitive characters for appId

* refactored and added test case
2019-10-26 18:12:42 -05:00
Diamond Lewis
c1a217c6b8 Support Apple Game Center Auth (#6143)
Fixes: https://github.com/parse-community/parse-server/issues/5984
2019-10-18 19:04:01 -05: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
edfa1df454 Cleanup Schema cache per request (#6126)
* remove enableSingleSchemaCache from test

* clear schema cache per request
2019-10-11 15:27:15 -05:00
Antoine Cormouls
2290145e82 GraphQL: ACL (#5957)
* Spec

Fix Spec

* Add ACL Type + Input

* Improvements

* Fix
2019-10-01 21:47:56 -07:00
Alann Maulana
38e0ff9d76 Microsoft Graph Authentication (#6051)
* add microsoft graph auth

* change mail to id

* add graph user id and email

* add microsoft graph auth test case

* remove validating auth data using mail

* add test case to AuthenticationAdapters

* fix indentation

* fix httpsRequest and fakeClaim not found

* add newline eof last

* fix test in auth adapter

* fix unhandled promise rejection
2019-09-26 13:23:18 -05:00
Omair Vaiyani
eef530b1e3 feat: add allowHeaders to Options (#6044)
* feat: add allowHeaders to Options

This allows developers to use custom headers in their API requests, and they will be accepted by their mounted app.

* refactor: convert allowCrossDomain to generator to add appId in scope

This is necessary as the middleware may run in OPTIONS request that do not contain the appId within the header.

* chore: update Definitions and docs

* fix: update test to use new allowCrossDomain params

* chore: add tests for allowCustomDomain middleware re: allowHeadrs
2019-09-12 14:03:57 -07:00
Antonio Davi Macedo Coelho de Castro
1361bb3020 Introduce ReadOptionsInput (#6030) 2019-09-12 13:43:49 -07:00
Antonio Davi Macedo Coelho de Castro
84776810b8 Fix: aggregate not matching null values (#6043)
* Fix: aggregate not matching null values

* Exclude Postgres from this new test - it does not even support  and  is not working correctly - should be addressed separately
2019-09-11 09:13:15 -05:00
Antonio Davi Macedo Coelho de Castro
a754b883b2 Improve callCloudCode mutation to receive a CloudCodeFunction enum instead of a String (#6029)
* Add listing test

* Improvements

* Fixinf package.json

* Fix package.json

* Fix tests
2019-09-09 15:07:22 -07:00
Antonio Davi Macedo Coelho de Castro
ad40386173 Test transactions (#6022)
* Test transactions

* test: Separate transaction tests for SDK
2019-09-05 08:50:50 -07:00
Douglas Muraoka
f9b77c1bc7 refactor(GraphQL): Pointer constraint input type as ID (#6020)
* refactor(GraphQL): Pointer constraint input type as ID

Redefines the Pointer constraint input type from a custom scalar to
a simple ID.

* fix: PR review requested changes
2019-09-04 15:46:18 -07:00
Antonio Davi Macedo Coelho de Castro
34f1bf384d GraphQL: Remove underline from operators (#6024)
* Change _or, _and, _nor to OR, AND, NOR

* Renaming where operators maps

* Fix tests

* Fix tests

* Remove CreateResult and UpdateResult types

* Remove KEYS_ATT and INCLUDE_ATT

* Full text search test

* Change the operation generator functions names

* Fix object constraints

* Improve constraint transformation
2019-09-04 10:57:51 -07:00
Saimoom Safayet Akash
723fe3b158 added support for line auth (#6007)
* added support for line auth

* fixed linting issues

* modified auth adapter spec to handle line auth adapter

* revert package.json changes
2019-09-03 08:11:33 -05:00
Antonio Davi Macedo Coelho de Castro
ac353ca8c2 Fix aggregate group id (#5994)
* Fix aggregate group id

* Improve implementation

* Add test case

* Fix postgres test - it does not work with group and sort at same time
2019-09-01 22:34:36 -07:00
Antonio Davi Macedo Coelho de Castro
5a482bd661 GraphQL schema operations (#5993)
* Remove nested operations

* Improve error log

* Fix bug schema to load

* Fix ParseGraphQLSchema tests

* Fix tests

* Fix failing tests

* First verstion not complete of create class mutation

* Fix bug caused by circular dependency

* Renaming files

* Schema types should be loaded before parse classes

* Fix tests

* Create class mutation boilerplate

* Improve CreateClassSchemaInput fields names

* Remove fields

* Pointer and relation fields

* Improve pointer default type

* Class type

* Create class mutation resolver

* Schema field transformers

* Class types transformations

* First test

* Numbers test

* Boolean tests

* Date test

* Fix some get tests

* Test for created at and updated at

* File tests

* Test for objects

* Renaming reducerFabric to reducerGenerator

* Changing get tests for file and object

* Object composed queries test

* Array test

* Null field test

* Bytes test

* Geo Point test

* Polygons tests

* Remove create generic mutation

* Fix tests

* Create class test - isRequired and defaultValue will be added back later

* Enforce master key

* Fix tests

* Duplicated field test

* updateClass mutation

* Remove update generic mutation tests

* Remove update generic mutation

* deleteClass mutation

* Remove delete generic mutation tests

* Remove delete generic mutation

* class query

* Classes query

* Remove get generic query from tests

* Remove remaining generic operations and fix tests

* Fix last test

* Try to fix redis tests

* Fix postgres tests

* Update objectsMutations and objectsQueries files locations

* Rename classSchema files to schema files

* Rename ClassObject to ParseObject

* Fix names and paths

* Still some wrong names
2019-09-01 22:11:03 -07:00
Douglas Muraoka
b47d9fb17e refactor(GraphQL): Rename objectId to id (#5985)
* refactor(GraphQL): Rename objectId to id

Renames `objectId` to `id` for the GraphQL API. Queries, mutations,
custom and generic types were updated.
Removes `RELATION_INPUT` and `POINTER_INPUT`. Now the user just need
to provide the ID of the object to link.

* fix: Column "id" not found on Postgres

* fix: Avoid deleting Parse class objectId

* fix: Undo objectId removal on mutations

* fix: Handle generic mutation id
2019-08-30 16:23:45 -07:00
Antonio Davi Macedo Coelho de Castro
3ede1f68b2 Fix beforeLogin trigger when user has a file (#6001)
* Fix beforeLogin trigger when user has a file

* Add test case
2019-08-29 19:07:39 -07:00
Jong Eun Lee
d0dc511423 Add test cases for protectedFields when using Find without constraints. (#5967) 2019-08-24 18:08:52 -07:00
Dobbias Nan
2b1c591cb7 Protected fields pointer-permissions support (#5951)
* moved whitelisting of own user to remove conflict with custom classes and * permission

* added new pointer-perm regex to permissions

* added pointer-permissions support

* added tests

* fixed typo

* fixed typo 2

* added tests using find operation

* renamed protectedFields pointerPerm to userField

* decoupled readUserFields from CLP and removed readUser from protectedFields before querying

* updated tests
2019-08-22 12:01:50 -07:00
Antoine Cormouls
5b3a492965 GraphQL DX: Relation/Pointer (#5946)
* Add a test on deep complex GraphQL Query

* Relation/Pointer new DX + deep nested mutations

* Fix lint

* Review

* Remove unnecessary code

* Fix objectId on update
2019-08-21 14:55:34 -07:00
Manuel
89e8868a85 Get ParseConfig parameters with Master Key (#5954)
* added saving, retrieving

* added tests

* fixed typo

* added masterKeyOnly to schema controller
2019-08-20 22:12:36 -07:00
Lucas Alencar
b9839c1e92 feat: Avoid setting a relation as required or with a defaultValue (#5922)
* feat: Avoid setting a relation as required or with a defaultValue

* chore: Test to update a class with a relation field with options

* chore: Improve tests
2019-08-20 21:27:49 -07:00
Antonio Davi Macedo Coelho de Castro
c951e08f63 Handle shutdown on grid adapters (#5943)
* Handle shutdown on grid adapters

* Add tests

* Fix postgres test
2019-08-19 02:35:06 -05:00
Antonio Davi Macedo Coelho de Castro
f5ac94ddb2 Fix GraphQL max upload size (#5940) 2019-08-19 01:23:59 -05:00
Diamond Lewis
1064f0c3fb Support: serverCloseComplete option (#5937)
* Support: serverCloseComplete option

Callback when server has fully shutdown.

Please check that all cases are covered.

* handle error on startup

* fix tests

* test workaround

* remove serverCloseComplete chech on startup failure
2019-08-19 00:25:52 -05:00
Antonio Davi Macedo Coelho de Castro
ee5aeeaff5 Remove nested operations from GraphQL API (#5931)
* Remove nested operations

* Improve error log

* Fix bug schema to load

* Fix ParseGraphQLSchema tests

* Fix tests

* Fix failing tests

* Rename call to callCloudCode
2019-08-17 20:02:19 +02:00
Diamond Lewis
3ab9dcdfd0 Improve Live Query Monitoring (#5927)
* Improve Live Query Monitoring

* typo
2019-08-16 11:38:24 -07:00
Antoine Cormouls
cea1988ce9 GraphQL: Fix undefined Array (#5926)
* Add Spec

* Fix Undefined Array

* Nullability policy
2019-08-16 11:12:29 -07:00
Dobbias Nan
0fa315fc5b Added array support for pointer-permissions (#5921)
* added array support for pointer permissions

* added tests for array support for pointer permissions

* Postgres fix

* simplify PG, no idea why this works
2019-08-15 23:55:12 -05:00
Antoine Cormouls
59b0221fec GraphQL: Renaming Types/Inputs (#5883)
* Renaming GraphQL Types/Inputs

* Add Native Type to avoid collision

* Use pluralize for renaming

* Fixing tests

* Improve name collision management - tests passsing

* Renaming few more default types

* Rename file input

* Reverting fields types to not collide with the relay spec types
Improver users mutations

* Adding ArrayResult to the reserved list

* Fixing tests

* Add more unit tests to ParseGraphQLSchema

* Test transformClassNameToGraphQL

* Name collision tests
2019-08-15 14:23:41 -07: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
Antoine Cormouls
4bffdce047 GraphQL: Inline Fragment on Array Fields (#5908)
* Inline Fragment Spec

* Inline Fragment on Arrays

* Fix Test

* Only select the root field

* Requested Changes

* Lazy Loaded ArrayResult
2019-08-14 12:25:28 -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
Diamond Lewis
470bb238b5 Fix: Logger print JSON and Numbers (#5916)
* Fix: Logger print JSON and Numbers

* fix test
2019-08-13 18:44:03 -07:00
greenkeeper[bot]
4c1be61bed Update mongodb to the latest version 🚀 (#5914)
* fix(package): update mongodb to version 3.3.0

* chore(package): update lockfile package-lock.json

* Fix tests

* Fix GraphQL tests for read preference

* Fix mongo adapter deprecation notice

* Fix the way the connections are checked, return promise when shutting down mongo
2019-08-14 01:25:49 +00:00
Antoine Cormouls
9031961e86 Return specific Type on specific Mutation (#5893)
* Return specific Type on specific Mutation

* Add Optimization on Mutation

* Optimize SignUp
2019-08-12 01:38:59 -07:00
SebC
b246bad5c7 Fix apple signin authAdapter (#5891)
* Fix apple signin authAdapter to use the user id instead of the user token

* Update spec
2019-08-07 18:08:14 -05:00
Douglas Muraoka
f81da11b84 fix(GraphQL): Remove "password" output field from _User class (#5889) 2019-08-06 17:21:33 -07:00
Douglas Muraoka
ef14ca530d GraphQL Object constraints (#5715)
* GraphQL Object constraints

Implements the GraphQL Object constraints, which allows us to filter queries results using the `$eq`, `$lt`, `$gt`, `$in`, and other Parse supported constraints.
Example:
```
query objects {
  findMyClass(where: {
    objField: {
      _eq: {
        key: 'foo.bar',
        value: 'hello'
      },
      _gt: {
        key: 'foo.number',
        value: 10
      },
      _lt: {
        key: 'anotherNumber',
        value: 5
      }
    }
  }) {
    results {
      objectId
    }
  }
}
```
In the example above, we have the `findMyClass` query (automatically generated for the `MyClass` class), and a field named `objField` whose type is Object. The object below represents a valid `objField` value and would satisfy all constraints:
```
{
  "foo": {
    "bar": "hello",
    "number": 11
  },
  "anotherNumber": 4
}
```
The Object constraint is applied only when using Parse class object type queries. When using "generic" queries such as `get` and `find`, this type of constraint is not available.

* Objects constraints not working on Postgres

Fixes the $eq, $ne, $gt, and $lt constraints when applied on an Object type field.

* Fix object constraint field name

* Fix Postgres constraints indexes

* fix: Object type composed constraints not working

* fix: Rename key and value fields

* refactor: Object constraints for generic queries

* fix: Object constraints not working on Postgres
2019-08-02 12:18:07 -07:00
Lucas Alencar
78c42d97fd fix: Promise is not being returned in classUpdate method (#5877)
* fix: Set falsy values as default to schema fields

* fix: Promise is not being returned in classUpdate method
2019-08-01 08:52:36 -05:00
Antonio Davi Macedo Coelho de Castro
f3b84242d7 Fix month in aggregate tests (#5879) 2019-07-31 19:55:16 -07:00
Antonio Davi Macedo Coelho de Castro
14a8d333a3 FIX: Transaction was aborting before all promises have either resolved or rejected (#5878) 2019-07-31 18:34:49 -07:00
Antonio Davi Macedo Coelho de Castro
8b97c1380b Batch transaction (#5849)
* Batch transaction boilerplate

* Refactoring transaction boilerplate

* Independent sessions test

* Transactions - partial

* Missing only one test

* All tests passing for mongo db

* Tests on Travis

* Transactions on postgres

* Fix travis to restart mongodb

* Remove mongodb service and keep only mongodb runner

* MongoDB service back

* Initialize replicaset

* Remove mongodb runner again

* Again only with mongodb-runner and removing cache

* Trying with pretest and posttest

* WiredTiger

* Pretest and posttest again

* Removing inexistent scripts

* wiredTiger

* One more attempt

* Trying another way to run mongodb-runner

* Fixing tests

* Include batch transaction on direct access

* Add tests to direct access
2019-07-31 02:41:07 -07:00
Lucas Alencar
6080dbc4f9 fix: Set falsy values as default to schema fields (#5868) 2019-07-30 15:51:49 -05:00
Diamond Lewis
218c3499f9 Implement WebSocketServer Adapter (#5866)
* Implement WebSocketServerAdapter

* lint

* clean up
2019-07-30 09:05:41 -05:00