Commit Graph

993 Commits

Author SHA1 Message Date
Rhuan
8bc201d228 #6101 Let users define objectId (#6177)
* #6101 Let users define objectId

* Add `allowCustomObjectId` to PS Option

* Add checking in objectId creation

* Add test

* Update docs

* Update definition

* Change default to false

* throw on empty, null, undefined

* better tests

* unused async

* removed comment

* retain comment

* Linting fix according to contributing spec.
2019-12-17 12:23:18 -06:00
Christopher Brookes
d9f36b060e Add missing encodeURIComponent on username password reset (#6278)
* Add missing encodeURIComponent on username

* Add new unit test on encoded username password reset redirect
2019-12-16 20:15:29 -06:00
Antoine Cormouls
a72ab50c70 GraphQL: Support required fields on output type (#6279)
* Handle required fields

* Fix output fields
2019-12-14 20:12:04 -08:00
Antoine Cormouls
e0e06ef131 Handle required fields (#6271) 2019-12-11 21:47:11 -08:00
Diamond Lewis
3de12faddc Update MongoDB to 3.3.5 (#6263)
* Update MongoDB to 3.3.5

* xit

* try again

* set timeout for tests

* remove flaky test

* Update package-lock.json

* fix conflicts
2019-12-06 16:00:27 -08:00
Antoine Cormouls
5d76b2f354 GraphQL: DX Relational Where Query (#6255)
* DX Relational Where Query

* Remove WherePointer & fix tests

* Add have, haveNot, exists on Pointer/Relation where input

* Merge branch 'master' into gql-relational-query

* Enable inQueryKey

* better descrption
2019-12-05 10:14:16 -08:00
Old Grandpa
6db040bdec GraphQL alias for mutations in classConfigs (#6258)
* mutations

* removed duplicate tests
2019-12-03 21:38:28 -08:00
Diamond Lewis
985933955f Suppress Test Logs (#6256)
* Suppress Test Logs

This will reduce some of the noise in the tests logs.

* replace deprecated buffer

* remove deprecation warnings

* fix geopoint

* Fix GraphQL

* postgres warnings
2019-12-03 18:21:12 -06:00
Old Grandpa
188f033330 GraphQL classConfig query alias (#6257)
* adds alias option

* added tests
2019-12-03 16:14:48 -08:00
Mike Patnode
a7cb381fbf Allow validateFilename to return a string or Parse Error (#6246) 2019-12-02 19:47:22 -06:00
Antonio Davi Macedo Coelho de Castro
a9066e20dc Relay Spec (#6089)
* Install graphql-relay

* Add relayNodeInterface to ParseGraphQLSchema

* Add support to global id

* Add support to global id in other operations

* Fix sort by glboal id

* Fix where by global id

* Introduce IdWhereInput

* Add Relay object identification tests

* Client mutation id on createFile mutation

* Client mutation id on callCloudCode mutation

* Client mutation id on signUp mutation

* Client mutation id on logIn mutation

* Client mutation id on logOut mutation

* Client mutation id on createClass mutation

* Client mutation id on updateClass mutation

* Client mutation id on deleteClass mutation

* Client mutation id on create object mutation

* Improve Viewer type

* Client mutation id on update object mutation

* Client mutation id on delete object mutation

* Introducing connections

* Fix tests

* Add pagination test

* Fix file location

* Fix postgres tests

* Add comments

* Tests to calculateSkipAndLimit
2019-12-01 21:43:08 -08:00
Julian Dax
4435154cf9 Add LDAP auth module (#6226) 2019-11-25 10:03:38 -06:00
Diamond Lewis
2f05d819f3 beforeFind: Improve request.query object (#6237)
* beforeFind: Improve request.query object

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

* can modify exclude query
2019-11-23 11:38:13 -06:00
Diamond Lewis
5bf87d86bb Improve WebSocketServer Error Handling (#6230)
* Improve WebSocketServer Error Handling

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

Prevents an unhandled server rejection.

Includes an example for LiveQuery test and closing the proper connections.

Improve live query monitoring

* fix tests
2019-11-22 15:23:04 -06:00
Manuel Trezza
5ed0885440 added afterLogout trigger (#6217)
* added afterLogout trigger

* added verification of session object in tests

* removed obsolete code

* removed unsued code

* improved tests to verify user ID
2019-11-15 21:52:57 -06:00
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