Commit Graph

55 Commits

Author SHA1 Message Date
Manuel
637326d3af bump mongodb version in CI (#7272)
* bump mongodb version

* improved wording in changelog

* another mongodb bump

* rewording changelog

* added info to option docs
2021-03-17 01:57:10 +01:00
Diamond Lewis
a02014f557 Improve single schema cache (#7214)
* Initial Commit

* fix flaky test

* temporary set ci timeout

* turn off ci check

* fix postgres tests

* fix tests

* node flaky test

* remove improvements

* Update SchemaPerformance.spec.js

* fix tests

* revert ci

* Create Singleton Object

* properly clear cache testing

* Cleanup

* remove fit

* try PushController.spec

* try push test rewrite

* try push enqueue time

* Increase test timeout

* remove pg server creation test

* xit push tests

* more xit

* remove skipped tests

* Fix conflicts

* reduce ci timeout

* fix push tests

* Revert "fix push tests"

This reverts commit 05aba62f1cbbca7d5d3e80b9444529f59407cb56.

* improve initialization

* fix flaky tests

* xit flaky test

* Update CHANGELOG.md

* enable debug logs

* Update LogsRouter.spec.js

* create initial indexes in series

* lint

* horizontal scaling documentation

* Update Changelog

* change horizontalScaling db option

* Add enableSchemaHooks option

* move enableSchemaHooks to databaseOptions
2021-03-16 16:05:36 -05:00
Manuel
bee889a329 Add security check (#7247)
* added Parse Server security option

* added SecurityRouter

* added Check class

* added CheckGroup class

* moved parameter validation to Utils

* added CheckRunner class

* added auto-run on server start

* added custom security checks as Parse Server option

* renamed script to check

* reformat log output

* added server config check

* improved contributing guideline

* improved contribution guide

* added check security log

* improved log format

* added checks

* fixed log fomat typo

* added database checks

* fixed database check

* removed database auth check in initial version

* improved contribution guide

* added security check tests

* fixed typo

* improved wording guidelines

* improved wording guidelines
2021-03-10 13:19:28 -06:00
Manuel
de50b7b23d Add custom routes to pages router (#7231)
* added custom routes

* fixed docs typos

* added page.customRoutes config validation

* added 404 response if missing custom route response

* added docs

* minor README formatting

* added CHANGELOG entry

* fixed bug in definitions builder that did not recognize array of custom type

* added missing route handler definition

* fixed custom routes definition
2021-03-07 13:51:35 +01:00
Manuel
7f47b0427e Add page localization (#7128)
* added localized pages; added refactored page templates; adapted test cases; introduced localization test cases

* added changelog entry

* fixed test description typo

* fixed bug in PromiseRouter where headers are not added for text reponse

* added page parameters in page headers for programmatic use

* refactored tests for PublicAPIRouter

* added mustache lib for template rendering

* fixed fs.promises module reference

* fixed template placeholder typo

* changed redirect response to provide headers instead of query parameters

* fix lint

* fixed syntax errors and typos in html templates

* removed obsolete URI encoding

* added locale inferring from request body and header

* added end-to-end localizaton test

* added server option validation; refactored pages server option

* fixed invalid redirect URL for no locale matching file

* added end-to-end localizaton tests

* adapted tests to new response content

* re-added PublicAPIRouter; added PagesRouter as experimental feature

* refactored PagesRouter test structure

* added configuration option for custom path to pages

* added configuration option for custom endpoint to pages

* fixed lint

* added tests

* added a distinct page for invalid password reset link

* renamed generic page invalidLink to expiredVerificationLink

* improved HTML files documentation

* improved HTML files documentation

* changed changelog entry for experimental feature

* improved file naming to make it more descriptive

* fixed file naming and env parameter naming

* added readme entry

* fixed readme TOC - hasn't been updated in a while

* added localization with JSON resource

* added JSON localization to feature pages (password reset, email verification)

* updated readme

* updated readme

* optimized JSON localization for feature pages; added e2e test case

* fixed readme typo

* minor refactoring of existing tests

* fixed bug where Object type was not recognized as config key type

* added feature config placeholders

* prettier

* added passing locale to page config placeholder callback

* refactored passing locale to placeholder to pass test

* added config placeholder feature to README

* fixed typo in README
2021-02-09 14:03:57 +01:00
Manuel
08b2ea45b0 Add account unlock on password reset (#7146)
* added account unlock on password reset

* added account policy option

* added changelog entry

* Added docs entry

* moved changelog entry to correct position

* improved tests to ensure requesting password reset email does not unlock account

* run prettier
2021-02-01 01:07:04 +01:00
Manuel
e08618e377 Fix fileupload defaults not applied (#7086)
* added fileUpload definition default value

* added undefined and null as invalid

* removed explicit default value reference

* improved test grouping in describes
2021-01-11 21:26:56 +01:00
dblythy
97c3046f3f FileUpload options for Server Config (#7071)
* New: fileUpload options to restrict file uploads

* review changes

* update review

* Update helper.js

* added complete fileUpload values for tests

* fixed config validation

* allow file upload only for authenicated user by default

* fixed inconsistent error messages

* consolidated and extended tests

* minor compacting

* removed irregular whitespace

* added changelog entry

* always allow file upload with master key

* fix lint

* removed fit

Co-authored-by: Manuel Trezza <trezza.m@gmail.com>
2020-12-17 10:16:37 +01:00
Diamond Lewis
033a0bd443 Fix Prettier (#7066) 2020-12-13 11:19:04 -06:00
dblythy
e634eba57c fix: definitions for accountLockout and passwordPolicy (#7040)
* fix: definitions for accountLockout and passwordPolicy

* redo env prefix
2020-12-03 15:03:29 -06:00
dblythy
c8ff445c10 Fix typo in server definitions for emailVerifyTokenReuseIfValid (#7037)
* Update index.js

* run docs
2020-12-03 13:40:13 -06:00
dblythy
e88f2e38f9 Feature: Reuse tokens if they haven't expired (#7017)
* Reuse tokens if they haven't expired

* Fix failing tests

* Update UserController.js

* Update tests

* Tests for invalid config

* restart tests
2020-11-25 09:30:52 -08:00
dblythy
b4ec63e8a7 Init (#6999) 2020-11-09 16:36:45 -08:00
Corey
7f3ea3fe80 Add fileKey rotation to GridFSBucketAdapter (#6768)
* add fileKey encryption to GridFSBucketStorageAdapter

* remove fileAdapter options from test spec

* ensure promise doesn't fall through in getFileData

* switch secretKey to fileKey

* add fileKey rotation for GridFSBucketAdapter

* improve catching decryption errors in testcases

* add testcase for rotating key from oldKey to noKey leaving all files decrypted

* removed fileKey from legacy test links. From the looks of the tests and the fileKey was appended to links. This key is now an encryption key

* clean up code

* make more consistant with FSAdapter

* use encryptionKey instead of fileKey

* Update ParseFile.spec.js

revert
2020-10-25 22:17:43 -07: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
Antonio Davi Macedo Coelho de Castro
78b59fb26b Merge pull request from GHSA-2xm2-xj2q-qgpj
* Test case and fixes

* Change requestTimeout default to 5s

* Document new function argument
2020-10-21 16:32:07 -07:00
Antoine Cormouls
62048260c9 GraphQL: Optimize queries, fixes some null returns (on object), fix stitched GraphQLUpload (#6709)
* Optimize query, fixes some null returns, fix stitched GraphQLUpload

* Fix authData key selection

* Prefer Iso string since other GraphQL solutions use this format

* fix tests

Co-authored-by: Antonio Davi Macedo Coelho de Castro <adavimacedo@gmail.com>
2020-10-01 15:19:26 -07:00
Manuel
3bd5684f67 Add idempotency (#6748)
* added idempotency router and middleware

* added idempotency rules for routes classes, functions, jobs, installaions, users

* fixed typo

* ignore requests without header

* removed unused var

* enabled feature only for MongoDB

* changed code comment

* fixed inconsistend storage adapter specification

* Trigger notification

* Travis CI trigger

* Travis CI trigger

* Travis CI trigger

* rebuilt option definitions

* fixed incorrect import path

* added new request ID header to allowed headers

* fixed typescript typos

* add new system class to spec helper

* fixed typescript typos

* re-added postgres conn parameter

* removed postgres conn parameter

* fixed incorrect schema for index creation

* temporarily disabling index creation to fix postgres issue

* temporarily disabling index creation to fix postgres issue

* temporarily disabling index creation to fix postgres issue

* temporarily disabling index creation to fix postgres issue

* temporarily disabling index creation to fix postgres issue

* temporarily disabling index creation to fix postgres issue

* temporarily disabling index creation to fix postgres issue

* trying to fix postgres issue

* fixed incorrect auth when writing to _Idempotency

* trying to fix postgres issue

* Travis CI trigger

* added test cases

* removed number grouping

* fixed test description

* trying to fix postgres issue

* added Github readme docs

* added change log

* refactored tests; fixed some typos

* fixed test case

* fixed default TTL value

* Travis CI Trigger

* Travis CI Trigger

* Travis CI Trigger

* added test case to increase coverage

* Trigger Travis CI

* changed configuration syntax to use regex; added test cases

* removed unused vars

* removed IdempotencyRouter

* Trigger Travis CI

* updated docs

* updated docs

* updated docs

* updated docs

* update docs

* Trigger Travis CI

* fixed coverage

* removed code comments
2020-07-15 13:10:33 -05:00
Diamond Lewis
e6a6354b29 Run Prettier JS (#6795) 2020-07-13 13:06:52 -05:00
Jerome De Leon
0abe9bb42d Make clear description of anonymous user (#6655)
* Make clear description of anonymous user

* Properly generate definitions

Co-authored-by: dplewis <findlewis@gmail.com>
2020-07-13 10:00:55 -05:00
Kevin Yao
d03ec18bcc feat: allow custom cors origin header (#6772) 2020-07-10 13:48:57 -05:00
Arthur Cinader
5c7918980c Set min mongodb to 3.6 in prep for parse-server 4.0 (#6445)
* Set min mongodb to 3.6 in prep for parse-server 4.0

fixes: 6444

* don't use anonymous functions when we can just
pass the function.

Also remove the boolean argument in tests that no longer exists.

* generate the correct lock file.  ooops.
2020-02-27 10:56:14 -08:00
Diamond Lewis
1a99cb3f2e Add maxLogFiles option (#6296)
https://community.parseplatform.org/t/server-log-retention/867/2

Maximum number of logs to keep. If not set, no logs will be removed. This can be a number of files or number of days. If using days, add 'd' as the suffix. (default: null).

I'll run this in production for a few days. I assume it works.

Useful for saving disk space.

Update winston-daily-rotate-file package to 4.4.0
2019-12-24 11:35:28 -06:00
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
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
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
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
Diamond Lewis
218c3499f9 Implement WebSocketServer Adapter (#5866)
* Implement WebSocketServerAdapter

* lint

* clean up
2019-07-30 09:05:41 -05:00
Antonio Davi Macedo Coelho de Castro
a6f441248b GraphQL custom schema on CLI (#5828)
* Add --graphQLSchema to CLI

* Add custom graphql schema instructions to readme file

* Update README.md

Co-Authored-By: Tom Fox <tomfox@surprises.io>

* Update src/Options/Definitions.js

Co-Authored-By: Tom Fox <tomfox@surprises.io>

* Update src/Options/docs.js

Co-Authored-By: Tom Fox <tomfox@surprises.io>

* Update src/Options/index.js

Co-Authored-By: Tom Fox <tomfox@surprises.io>
2019-07-19 12:29:45 -07:00
Antonio Davi Macedo Coelho de Castro
5bc79cc3db GraphQL support via cli (#5697)
* Including GraphQL options in CLI - now it was auto-generated

* Improving the way that the headers are passed to the playground

* Including README notes about GraphQL

* Improving final text
2019-06-25 14:44:23 -07:00
Jack Wearden
559096f1c2 Allow disabling workaround for since-fixed MongoDB bug (#5617)
* Allow disabling workaround for fixed MongoDB bug

* skipMongoDBServer13732Workaround description fix

* flip test boolean

* Remove CLI flag, use databaseVersion & engine

* Revert "Remove CLI flag, use databaseVersion & engine"

This reverts commit 042d1ba19f636fe0da06074168c6fd5db37ea048.

* clean up
2019-06-19 17:30:08 -05:00
Yao Bin
2a45ee02fb 📝 Document custom pages options (#5687) 2019-06-14 15:35:09 -05:00
Antonio Davi Macedo Coelho de Castro
893f1d376e Remove test delays (#5579)
* Changing __indexBuildCompletionCallbackForTests callback to serverStartComplete

* Improving serverStartComplete callback to avoid production unhandled promise rejection

* Add test to check inexistence of unhandled promise rejection on server fail

* Removing some hooks delays

* Removing delay after reconfigureServer

* Improving code style
2019-05-14 11:34:51 -07:00
William George
5a8a9472e9 Remove userSensitiveFields default value. (#5588) 2019-05-13 17:14:31 -07:00
Diamond Lewis
0ce4eeae72 LiveQuery: Add options for Redis (#5584)
Closes: https://github.com/parse-community/parse-server/issues/5387
2019-05-11 19:13:41 -05:00
Diamond Lewis
b9c936f594 Add Docs for Server Config Definitions (#5581)
* Add Docs for Server Config Definitions

* protected field and sort alphabetically

* Add links

* nits
2019-05-11 15:25:31 -05:00
Diamond Lewis
b4d915bbbb Support direct access server option (#5550)
* Support direct access config

test options

* add test

* fix test

* fix definitions

* improve docs

* Update .travis.yml

* Revert "Update .travis.yml"

This reverts commit 407f1384953b64bad9e63068db8564c3584ca3a4.
2019-05-10 14:34:19 -05: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
95831a5b22 Add new definition and update tests to reflect 2019-02-23 07:28:39 -08:00
Florent Vilmart
617e8405ff Updates definition build script for babel 7.0 (#5024)
* Updates definition build script for babel 7.0

* run eslint on staged files
2018-09-08 14:12: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
942b9b5b1a Adds documentations for adapters and main constructors (#4951)
* wip

* Adds documentations for adapters, and constructors

* nits

* nit
2018-08-15 10:47:21 -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
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
Tyler Brock
c5e8470e36 Always use http-agent for hooks and triggers (#4800) 2018-06-01 09:31:10 -04:00
Tyler Brock
f4422c491e Update defs for new hookKeepAlive config option (#4794)
All tests pass on re-run. :-)
2018-05-29 17:30:26 -07:00
Tyler Brock
82fb06f9c9 Use http agents for hook requests (#4791) 2018-05-29 17:48:06 -04:00
Arthur Cinader
d19ac077b6 Live query defaults reference ParseServer instead of LiverQuery server. (#4613)
* fix workding for live query defaults help

* generate the definition file.
2018-03-08 17:30:18 -05:00
Florent Vilmart
6a1510729a Bump nodejs version to 6+ (#4272)
* let travis build against 3.x

* Cleanup dependencies and bump min version to current LTS

* Makes npm-git push all branches to -preview

* restores releases

* Bumps mime to 2.0.3 (requires node 6+)

* Bumps express to latest version

* Fixes linting issue after upgrade

* Use travis-branch for partial releases
2017-11-25 15:39:31 -05:00
Florent Vilmart
de73f3723c Scoped packages (#4354)
* Updates for scoped packages dependencies

* bumps s3 adapter

* Update README.md

* Update README.md

* Update README.md
2017-11-17 08:32:58 -05:00