Merge "cors: Remove multiple config block parsing"
This commit is contained in:
@@ -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
@@ -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.
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user