diff options
author | rinpatch <rinpatch@sdf.org> | 2020-05-05 12:08:58 +0000 |
---|---|---|
committer | rinpatch <rinpatch@sdf.org> | 2020-05-05 12:08:58 +0000 |
commit | 5482a1f6efdb771f586ed539ec8f57953a8fac69 (patch) | |
tree | 63c67e6ee785778e4dc918f24f2779a5ca3baef2 /config | |
parent | c297667f16db40654bb16608c01dc4a2dc7c0e4b (diff) | |
parent | cc922e7d8ccbf22a0f7e0898a6ff4639123f0c7f (diff) | |
download | pleroma-5482a1f6efdb771f586ed539ec8f57953a8fac69.tar.gz pleroma-5482a1f6efdb771f586ed539ec8f57953a8fac69.zip |
Merge branch 'openapi/validation-plug' into 'develop'
Ignore unexpected query params and ENUM values
Closes #1719
See merge request pleroma/pleroma!2468
Diffstat (limited to 'config')
-rw-r--r-- | config/config.exs | 2 | ||||
-rw-r--r-- | config/description.exs | 14 | ||||
-rw-r--r-- | config/dev.exs | 2 | ||||
-rw-r--r-- | config/test.exs | 2 |
4 files changed, 20 insertions, 0 deletions
diff --git a/config/config.exs b/config/config.exs index a6c6d6f99..ca9bbab64 100644 --- a/config/config.exs +++ b/config/config.exs @@ -653,6 +653,8 @@ config :pleroma, :restrict_unauthenticated, profiles: %{local: false, remote: false}, activities: %{local: false, remote: false} +config :pleroma, Pleroma.Web.ApiSpec.CastAndValidate, strict: false + # Import environment specific config. This must remain at the bottom # of this file so it overrides the configuration defined above. import_config "#{Mix.env()}.exs" diff --git a/config/description.exs b/config/description.exs index d7788a63d..1b2afebef 100644 --- a/config/description.exs +++ b/config/description.exs @@ -3195,5 +3195,19 @@ config :pleroma, :config_description, [ ] } ] + }, + %{ + group: :pleroma, + key: Pleroma.Web.ApiSpec.CastAndValidate, + type: :group, + children: [ + %{ + key: :strict, + type: :boolean, + description: + "Enables strict input validation (useful in development, not recommended in production)", + suggestions: [false] + } + ] } ] diff --git a/config/dev.exs b/config/dev.exs index 7e1e3b4be..4faaeff5b 100644 --- a/config/dev.exs +++ b/config/dev.exs @@ -52,6 +52,8 @@ config :pleroma, Pleroma.Repo, hostname: "localhost", pool_size: 10 +config :pleroma, Pleroma.Web.ApiSpec.CastAndValidate, strict: true + if File.exists?("./config/dev.secret.exs") do import_config "dev.secret.exs" else diff --git a/config/test.exs b/config/test.exs index 040e67e4a..cbf775109 100644 --- a/config/test.exs +++ b/config/test.exs @@ -96,6 +96,8 @@ config :pleroma, Pleroma.Emails.NewUsersDigestEmail, enabled: true config :pleroma, Pleroma.Plugs.RemoteIp, enabled: false +config :pleroma, Pleroma.Web.ApiSpec.CastAndValidate, strict: true + if File.exists?("./config/test.secret.exs") do import_config "test.secret.exs" else |