neutron/neutron/api
Slawek Kaplonski dcb3546648 Handle properly InvalidScope exceptions to not return error 500
When new default policy rules and scope enforcement are enabled, Neutron
needs to handle properly not only PolicyNotAuthorized exception from
oslo_policy module but also InvalidScope exception.
This patch adds handling of that exception to the neutron policy
modules.

In the check() method from the neutron.policy module we are calling
ENFORCER.enforce() method with do_raise=False which means that
PolicyNotAuthorized isn't rasised. Unfortunately it seems that there is
bug in oslo.policy module and InvalidScope is raised even with
do_raise=False.
For now, lets workaround it in Neutron by properly handling InvalidScope
exception in the check() method.
This workaround can be cleaned when bug [1] will be fixed in
oslo.policy.

[1] https://bugs.launchpad.net/oslo.policy/+bug/1965315

Partial-Bug: #1959333
Change-Id: I973f8896248c8222031c53343bb53ce48254da74
(cherry picked from commit 51d1899bac)
2022-04-20 14:51:05 +00:00
..
rpc Pass host parameter to the get_network_info method 2022-02-01 08:28:15 +01:00
v2 Handle properly InvalidScope exceptions to not return error 500 2022-04-20 14:51:05 +00:00
views Add a new configuration variable for api links. 2017-04-18 15:16:41 +00:00
__init__.py Added API extensions to detect sorting/pagination features 2016-08-01 22:57:15 +02:00
api_common.py Remove "six" library 2020-07-28 16:55:52 +00:00
converters.py Sanitize profile column of ml2_port_bindings table in the DB 2021-10-21 15:17:24 +02:00
extensions.py Don't use singleton in routes.middleware.RoutesMiddleware 2021-09-04 09:25:19 +00:00