diff --git a/doc/source/configuration/configref.rst b/doc/source/configuration/configref.rst index d39bf2e66e..280be6e16d 100644 --- a/doc/source/configuration/configref.rst +++ b/doc/source/configuration/configref.rst @@ -26,4 +26,5 @@ Octavia Configuration Options oslo.db oslo.log oslo.messaging + oslo.middleware.sizelimit cotyledon diff --git a/etc/config/octavia-config-generator.conf b/etc/config/octavia-config-generator.conf index bb787bdd98..78b9f6d876 100644 --- a/etc/config/octavia-config-generator.conf +++ b/etc/config/octavia-config-generator.conf @@ -9,6 +9,7 @@ namespace = oslo.messaging namespace = oslo.middleware.cors namespace = oslo.middleware.http_proxy_to_wsgi namespace = oslo.middleware.healthcheck +namespace = oslo.middleware.sizelimit namespace = oslo.policy namespace = keystonemiddleware.audit namespace = keystonemiddleware.auth_token diff --git a/octavia/api/app.py b/octavia/api/app.py index 6e2a5ebce8..2eb0abb62a 100644 --- a/octavia/api/app.py +++ b/octavia/api/app.py @@ -20,6 +20,7 @@ from oslo_log import log as logging from oslo_middleware import cors from oslo_middleware import http_proxy_to_wsgi from oslo_middleware import request_id +from oslo_middleware import sizelimit from pecan import configuration as pecan_configuration from pecan import make_app as pecan_make_app @@ -103,4 +104,6 @@ def _wrap_app(app): expose_headers=['X-Auth-Token', 'X-Openstack-Request-Id'] ) + app = sizelimit.RequestBodySizeLimiter(app, cfg.CONF) + return app diff --git a/releasenotes/notes/add-sizelimit-middleware-91dc6078522f81ec.yaml b/releasenotes/notes/add-sizelimit-middleware-91dc6078522f81ec.yaml new file mode 100644 index 0000000000..cbd8a796cb --- /dev/null +++ b/releasenotes/notes/add-sizelimit-middleware-91dc6078522f81ec.yaml @@ -0,0 +1,7 @@ +--- +upgrade: + - | + Octavia now uses the oslo middleware sizelimit module. It allows to limit + the size of the incoming requests in the API. Admins may need to ajust the + ``[oslo_middleware].max_request_body_size`` setting to their needs. The + default value for ``max_request_body_size`` is 114688 bytes.