Merge "cors: Remove multiple config block parsing"

This commit is contained in:
Zuul
2025-11-18 17:07:47 +00:00
committed by Gerrit Code Review
4 changed files with 339 additions and 476 deletions

View File

@@ -18,7 +18,6 @@ import copy
import logging
import typing as ty
import debtcollector
from oslo_config import cfg
from oslo_middleware import base
import webob.exc
@@ -225,21 +224,6 @@ class CORS(base.ConfigurableMiddleware):
allow_headers=allow_headers,
)
# Iterate through all the loaded config sections, looking for ones
# prefixed with 'cors.'
for section in self.oslo_conf.list_all_sections():
if section.startswith('cors.'):
debtcollector.deprecate(
'Multiple configuration blocks are '
'deprecated and will be removed in '
'future versions. Please consolidate '
'your configuration in the [cors] '
'configuration block.'
)
# Register with the preconstructed defaults
self.oslo_conf.register_opts(subgroup_opts, section)
self.add_origin(**self.oslo_conf[section])
def add_origin(
self,
allowed_origin: str | list[str],

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,5 @@
---
upgrade:
- |
The CORS middleware no longer support multiple configuration blocks.
Sections with ``cors.`` prefix are no longer used and should be removed.

View File

@@ -3,7 +3,6 @@
# you find any incorrect lower bounds, let us know or propose a fix.
bcrypt>=3.1.3 # Apache-2.0
debtcollector>=1.2.0 # Apache-2.0
Jinja2>=2.10 # BSD License (3 clause)
oslo.config>=5.2.0 # Apache-2.0
oslo.context>=2.19.2 # Apache-2.0