neutron/neutron/api/v2
Slawek Kaplonski 51d1899bac 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
2022-03-30 14:52:37 +00:00
..
__init__.py Remove invalid copyright headers under API module 2014-04-02 11:09:03 -07:00
base.py Handle properly InvalidScope exceptions to not return error 500 2022-03-30 14:52:37 +00:00
resource.py Make code follow log translation guideline 2017-08-14 02:01:48 +00:00
resource_helper.py Add API extension for QoS minimum pps rule 2021-09-29 12:27:30 +02:00
router.py Delete dead API v2 router code 2017-09-13 15:11:49 -07:00