MongoDB option keys incorrectly identified as invalid #9211
Labels
state:released
Released as stable version
state:released-alpha
Released as alpha version
state:released-beta
Released as beta version
type:bug
Impaired feature or lacking behavior that is likely assumed
New Issue Checklist
Issue Description
#8987 introduced a feature that prevents Parse Server to start when an invalid option is identified. This was to prevent a misconfigured Parse Server to be deployed and potentially be insecure or for example cause damage to data integrity.
This currently incorrectly identifies some nested keys of
databaseOptions
as invalid keys. Some of the nested keys are directly passed to the MongoDB driver without being validated by Parse Server, as to allow developers to customize the MongoDB driver using its low-level options, for example:Other nested keys are parsed by Parse Server, for example:
Other nested keys are used for Parse Server's internal configuration and not passed to the MongoDB driver, for example:
In short, as long as
databaseOptions
is a potpourri of key types, its keys cannot be reasonably validated for correctness. There are various possible solutions to this; the easiest ones:databaseOptions
; con: disables validation for parts of the Parse Server config.unsafeDriverOptions
key whose nested keys are "unsafe", i.e. not validated and passed directly to the DB driver. Con: not practical as the MongoDB driver is a Parse Server dependency that can change at any time and may break "unsafe" driver options set in the Server config.(b) looks like the correct approach, since the options are set via the Parse Server config and because (c) is too unstable.
Steps to reproduce
Start Parse Server with config:
Actual Outcome
Error logged:
Expected Outcome
No error logged, as these are all valid keys.
Environment
Server
7.2.0
The text was updated successfully, but these errors were encountered: