From c0a5572814e96f90d3d4b9ea0f10d35d88f5cd68 Mon Sep 17 00:00:00 2001 From: Erik Olof Gunnar Andersson Date: Tue, 19 Sep 2023 13:23:12 -0700 Subject: [PATCH] Add middleware to limit request body size to api-paste Closes-Bug: #2036642 Change-Id: Ia4d50ff0b39e3a7ed31829fbabeae4fd24cf49c9 --- etc/designate/api-paste.ini | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/etc/designate/api-paste.ini b/etc/designate/api-paste.ini index 59049d0d5..eeff0cdc0 100644 --- a/etc/designate/api-paste.ini +++ b/etc/designate/api-paste.ini @@ -16,16 +16,16 @@ paste.app_factory = designate.api.versions:factory [composite:osapi_dns_v2] use = call:designate.api.middleware:auth_pipeline_factory -noauth = http_proxy_to_wsgi cors request_id faultwrapper validation_API_v2 osprofiler noauthcontext maintenance normalizeuri osapi_dns_app_v2 -keystone = http_proxy_to_wsgi cors request_id faultwrapper validation_API_v2 osprofiler authtoken keystonecontext maintenance normalizeuri osapi_dns_app_v2 +noauth = http_proxy_to_wsgi cors request_id faultwrapper validation_API_v2 sizelimit osprofiler noauthcontext maintenance normalizeuri osapi_dns_app_v2 +keystone = http_proxy_to_wsgi cors request_id faultwrapper validation_API_v2 sizelimit osprofiler authtoken keystonecontext maintenance normalizeuri osapi_dns_app_v2 [app:osapi_dns_app_v2] paste.app_factory = designate.api.v2:factory [composite:osapi_dns_admin] use = call:designate.api.middleware:auth_pipeline_factory -noauth = http_proxy_to_wsgi cors request_id faultwrapper osprofiler noauthcontext maintenance normalizeuri osapi_dns_app_admin -keystone = http_proxy_to_wsgi cors request_id faultwrapper osprofiler authtoken keystonecontext maintenance normalizeuri osapi_dns_app_admin +noauth = http_proxy_to_wsgi cors request_id faultwrapper sizelimit osprofiler noauthcontext maintenance normalizeuri osapi_dns_app_admin +keystone = http_proxy_to_wsgi cors request_id faultwrapper sizelimit osprofiler authtoken keystonecontext maintenance normalizeuri osapi_dns_app_admin [app:osapi_dns_app_admin] paste.app_factory = designate.api.admin:factory @@ -43,6 +43,9 @@ paste.filter_factory = oslo_middleware:HTTPProxyToWSGI.factory [filter:osprofiler] paste.filter_factory = designate.common.profiler:WsgiMiddleware.factory +[filter:sizelimit] +paste.filter_factory = oslo_middleware:RequestBodySizeLimiter.factory + [filter:noauthcontext] paste.filter_factory = designate.api.middleware:NoAuthContextMiddleware.factory