Ghost/core/server/data
Fabien 'egg' O'Carroll 8f660c3259
Improved settings validation (#12048)
closes #12001

* Moved settings validation to the model

This moves the settings validation out of the validation file and into
the model, as it is _only_ used there.

It also sets us up in the future for custom validators on individual
settings.

* Improved validation of stripe_plans setting

- Checks `interval` is a valid string
- Checks `name` & `currency` are strings

* Moved stripe key validation into model

The stripe key settings are all nullable and the regex validation fails
when the input is `null`. Rather than reworking the entirety of how we
validate with default-settings validation objects, this moves the
validation into methods on the Settings model.

* Added tests for new setting validations

Adds tests for both valid and invalid settings, as well as helpers
making future tests easier and less repetitive
2020-07-15 17:11:27 +02:00
..
db Moved core/server/lib/common/logging to core/shared/logging (#11857) 2020-05-28 19:30:23 +01:00
exporter Removed use of deprecated setting flags from the codebase 2020-06-23 11:58:19 +12:00
importer Remove references to bulk email settings (#12000) 2020-07-03 16:30:54 +02:00
migrations Fixed version for amp_gtag_id setting migration 2020-07-15 15:33:37 +02:00
schema Added amp_gtag_id setting migration & default 2020-07-15 13:43:25 +02:00
validation Improved settings validation (#12048) 2020-07-15 17:11:27 +02:00