Rules engine to enforce access control policy
Go to file
Ben Nemec 3d85afb24a Fix sample config value when set_defaults is used
By calling set_default[1] on a conf object it only applies to opts
registered to that object. This causes an incorrect value to appear in
the generated sample config because it deals with a list of raw opts,
not a conf object.

To fix this, we can call the global set_defaults[2] on the cfg module
which alters the opts directly. This is the method used in the cors
middleware[3] and works as expected there.

This does complicate the unit tests, however. Because we're altering
global state we need to save the original opts and restore them after
the test. Furthermore, the conf.reset() call in the config fixture
doesn't sufficiently reset the conf object to allow it to recognize
the replaced opts. For the purposes of this test we can just create
a standalone conf object though, which gets past that problem.

It's possible that we should fix reset() so it actually removes opts
in groups completely, but I'm unsure what implications that might
have for other users of the function.

1: b5df53543f/oslo_config/cfg.py (L2433)
2: b5df53543f/oslo_config/cfg.py (L391)
3: 8c7fa5bb10/oslo_middleware/cors.py (L88)

Change-Id: I3af9de1b39b6360ecfcb448d8c37b463e1a42ca7
Closes-Bug: 1807184
2019-01-07 18:11:41 +00:00
doc/source Correct typo in docs 2018-11-26 15:15:26 -05:00
oslo_policy Fix sample config value when set_defaults is used 2019-01-07 18:11:41 +00:00
releasenotes Add ability to pass in target data for the oslopolicy-checker 2018-11-02 14:14:21 +02:00
sample_data Add oslopolicy-checker command-line tool 2016-01-12 15:44:03 -06:00
.coveragerc Fix coverage configuration and execution 2015-10-01 15:39:58 +00:00
.gitignore Clean up .gitignore references to personal tools 2018-10-15 11:50:32 +08:00
.gitreview exported from oslo-incubator by graduate.sh 2014-12-09 14:40:01 -03:00
.mailmap exported from oslo-incubator by graduate.sh 2014-12-09 14:40:01 -03:00
.stestr.conf Fix requirements and convert to stestr 2018-07-02 17:30:07 +00:00
.zuul.yaml Use template for lower-constraints 2018-12-20 20:14:02 +01:00
CONTRIBUTING.rst Optimize the link address 2017-04-08 23:36:11 +08:00
HACKING.rst Update URLs in documents according to document migration 2017-07-12 23:01:31 +08:00
LICENSE exported from oslo-incubator by graduate.sh 2014-12-09 14:40:01 -03:00
README.rst Remove PyPI downloads 2018-08-07 06:00:35 +00:00
babel.cfg exported from oslo-incubator by graduate.sh 2014-12-09 14:40:01 -03:00
lower-constraints.txt Add domain scope support for scope types 2018-11-30 14:52:36 +00:00
requirements.txt Add domain scope support for scope types 2018-11-30 14:52:36 +00:00
setup.cfg Change openstack-dev to openstack-discuss 2018-12-04 09:47:03 +08:00
setup.py Updated from global requirements 2017-03-03 03:07:08 +00:00
test-requirements.txt Add domain scope support for scope types 2018-11-30 14:52:36 +00:00
tox.ini Fix requirements and convert to stestr 2018-07-02 17:30:07 +00:00

README.rst

Team and repository tags

image

oslo.policy

Latest Version

The Oslo Policy library provides support for RBAC policy enforcement across all OpenStack services.