oslo.context 6.2.0__tar.gz → 6.3.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {oslo_context-6.2.0 → oslo_context-6.3.0}/.pre-commit-config.yaml +2 -12
- {oslo_context-6.2.0 → oslo_context-6.3.0}/ChangeLog +14 -0
- {oslo_context-6.2.0 → oslo_context-6.3.0}/PKG-INFO +21 -19
- {oslo_context-6.2.0 → oslo_context-6.3.0}/README.rst +16 -17
- {oslo_context-6.2.0 → oslo_context-6.3.0}/oslo.context.egg-info/PKG-INFO +21 -19
- oslo_context-6.3.0/oslo.context.egg-info/pbr.json +1 -0
- {oslo_context-6.2.0 → oslo_context-6.3.0}/oslo_context/context.py +14 -5
- {oslo_context-6.2.0 → oslo_context-6.3.0}/oslo_context/tests/test_context.py +4 -1
- {oslo_context-6.2.0 → oslo_context-6.3.0}/pyproject.toml +16 -41
- {oslo_context-6.2.0 → oslo_context-6.3.0}/tox.ini +12 -2
- oslo_context-6.2.0/oslo.context.egg-info/pbr.json +0 -1
- {oslo_context-6.2.0 → oslo_context-6.3.0}/.coveragerc +0 -0
- {oslo_context-6.2.0 → oslo_context-6.3.0}/.mailmap +0 -0
- {oslo_context-6.2.0 → oslo_context-6.3.0}/.stestr.conf +0 -0
- {oslo_context-6.2.0 → oslo_context-6.3.0}/.zuul.yaml +0 -0
- {oslo_context-6.2.0 → oslo_context-6.3.0}/AUTHORS +0 -0
- {oslo_context-6.2.0 → oslo_context-6.3.0}/CONTRIBUTING.rst +0 -0
- {oslo_context-6.2.0 → oslo_context-6.3.0}/HACKING.rst +0 -0
- {oslo_context-6.2.0 → oslo_context-6.3.0}/LICENSE +0 -0
- {oslo_context-6.2.0 → oslo_context-6.3.0}/doc/requirements.txt +0 -0
- {oslo_context-6.2.0 → oslo_context-6.3.0}/doc/source/conf.py +0 -0
- {oslo_context-6.2.0 → oslo_context-6.3.0}/doc/source/contributor/index.rst +0 -0
- {oslo_context-6.2.0 → oslo_context-6.3.0}/doc/source/index.rst +0 -0
- {oslo_context-6.2.0 → oslo_context-6.3.0}/doc/source/install/index.rst +0 -0
- {oslo_context-6.2.0 → oslo_context-6.3.0}/doc/source/reference/context.rst +0 -0
- {oslo_context-6.2.0 → oslo_context-6.3.0}/doc/source/reference/fixture.rst +0 -0
- {oslo_context-6.2.0 → oslo_context-6.3.0}/doc/source/reference/index.rst +0 -0
- {oslo_context-6.2.0 → oslo_context-6.3.0}/doc/source/user/examples/usage.py +0 -0
- {oslo_context-6.2.0 → oslo_context-6.3.0}/doc/source/user/examples/usage_simple.py +0 -0
- {oslo_context-6.2.0 → oslo_context-6.3.0}/doc/source/user/examples/usage_user_identity.py +0 -0
- {oslo_context-6.2.0 → oslo_context-6.3.0}/doc/source/user/examples.rst +0 -0
- {oslo_context-6.2.0 → oslo_context-6.3.0}/doc/source/user/history.rst +0 -0
- {oslo_context-6.2.0 → oslo_context-6.3.0}/doc/source/user/index.rst +0 -0
- {oslo_context-6.2.0 → oslo_context-6.3.0}/doc/source/user/usage.rst +0 -0
- {oslo_context-6.2.0 → oslo_context-6.3.0}/oslo.context.egg-info/SOURCES.txt +0 -0
- {oslo_context-6.2.0 → oslo_context-6.3.0}/oslo.context.egg-info/dependency_links.txt +0 -0
- {oslo_context-6.2.0 → oslo_context-6.3.0}/oslo.context.egg-info/not-zip-safe +0 -0
- {oslo_context-6.2.0 → oslo_context-6.3.0}/oslo.context.egg-info/requires.txt +0 -0
- {oslo_context-6.2.0 → oslo_context-6.3.0}/oslo.context.egg-info/top_level.txt +0 -0
- {oslo_context-6.2.0 → oslo_context-6.3.0}/oslo_context/__init__.py +0 -0
- {oslo_context-6.2.0 → oslo_context-6.3.0}/oslo_context/fixture.py +0 -0
- {oslo_context-6.2.0 → oslo_context-6.3.0}/oslo_context/py.typed +0 -0
- {oslo_context-6.2.0 → oslo_context-6.3.0}/oslo_context/tests/__init__.py +0 -0
- {oslo_context-6.2.0 → oslo_context-6.3.0}/oslo_context/tests/test_fixture.py +0 -0
- {oslo_context-6.2.0 → oslo_context-6.3.0}/oslo_context/version.py +0 -0
- {oslo_context-6.2.0 → oslo_context-6.3.0}/releasenotes/notes/Fix-system-scope-from_dict-29615af90723ba4d.yaml +0 -0
- {oslo_context-6.2.0 → oslo_context-6.3.0}/releasenotes/notes/add_reno-3b4ae0789e9c45b4.yaml +0 -0
- {oslo_context-6.2.0 → oslo_context-6.3.0}/releasenotes/notes/dont-leak-auth-token-fb7075316cf87b7c.yaml +0 -0
- {oslo_context-6.2.0 → oslo_context-6.3.0}/releasenotes/notes/drop-python27-support-b421329839e69d41.yaml +0 -0
- {oslo_context-6.2.0 → oslo_context-6.3.0}/releasenotes/notes/redacted-copy-efd02c83c287451f.yaml +0 -0
- {oslo_context-6.2.0 → oslo_context-6.3.0}/releasenotes/notes/remove-deprecated-args-044bc6bd79638988.yaml +0 -0
- {oslo_context-6.2.0 → oslo_context-6.3.0}/releasenotes/notes/remove-py38-f21fbda6dac198c4.yaml +0 -0
- {oslo_context-6.2.0 → oslo_context-6.3.0}/releasenotes/notes/remove-py39-643032e829d29b78.yaml +0 -0
- {oslo_context-6.2.0 → oslo_context-6.3.0}/releasenotes/notes/remove_deprecated_args_tenant-77724de1422f46d9.yaml +0 -0
- {oslo_context-6.2.0 → oslo_context-6.3.0}/releasenotes/source/2023.1.rst +0 -0
- {oslo_context-6.2.0 → oslo_context-6.3.0}/releasenotes/source/2023.2.rst +0 -0
- {oslo_context-6.2.0 → oslo_context-6.3.0}/releasenotes/source/2024.1.rst +0 -0
- {oslo_context-6.2.0 → oslo_context-6.3.0}/releasenotes/source/2024.2.rst +0 -0
- {oslo_context-6.2.0 → oslo_context-6.3.0}/releasenotes/source/2025.1.rst +0 -0
- {oslo_context-6.2.0 → oslo_context-6.3.0}/releasenotes/source/2025.2.rst +0 -0
- {oslo_context-6.2.0 → oslo_context-6.3.0}/releasenotes/source/_static/.placeholder +0 -0
- {oslo_context-6.2.0 → oslo_context-6.3.0}/releasenotes/source/_templates/.placeholder +0 -0
- {oslo_context-6.2.0 → oslo_context-6.3.0}/releasenotes/source/conf.py +0 -0
- {oslo_context-6.2.0 → oslo_context-6.3.0}/releasenotes/source/index.rst +0 -0
- {oslo_context-6.2.0 → oslo_context-6.3.0}/releasenotes/source/newton.rst +0 -0
- {oslo_context-6.2.0 → oslo_context-6.3.0}/releasenotes/source/ocata.rst +0 -0
- {oslo_context-6.2.0 → oslo_context-6.3.0}/releasenotes/source/pike.rst +0 -0
- {oslo_context-6.2.0 → oslo_context-6.3.0}/releasenotes/source/queens.rst +0 -0
- {oslo_context-6.2.0 → oslo_context-6.3.0}/releasenotes/source/rocky.rst +0 -0
- {oslo_context-6.2.0 → oslo_context-6.3.0}/releasenotes/source/stein.rst +0 -0
- {oslo_context-6.2.0 → oslo_context-6.3.0}/releasenotes/source/train.rst +0 -0
- {oslo_context-6.2.0 → oslo_context-6.3.0}/releasenotes/source/unreleased.rst +0 -0
- {oslo_context-6.2.0 → oslo_context-6.3.0}/releasenotes/source/ussuri.rst +0 -0
- {oslo_context-6.2.0 → oslo_context-6.3.0}/releasenotes/source/victoria.rst +0 -0
- {oslo_context-6.2.0 → oslo_context-6.3.0}/releasenotes/source/wallaby.rst +0 -0
- {oslo_context-6.2.0 → oslo_context-6.3.0}/releasenotes/source/xena.rst +0 -0
- {oslo_context-6.2.0 → oslo_context-6.3.0}/releasenotes/source/yoga.rst +0 -0
- {oslo_context-6.2.0 → oslo_context-6.3.0}/releasenotes/source/zed.rst +0 -0
- {oslo_context-6.2.0 → oslo_context-6.3.0}/requirements.txt +0 -0
- {oslo_context-6.2.0 → oslo_context-6.3.0}/setup.cfg +0 -0
- {oslo_context-6.2.0 → oslo_context-6.3.0}/setup.py +0 -0
- {oslo_context-6.2.0 → oslo_context-6.3.0}/test-requirements.txt +0 -0
|
@@ -13,24 +13,14 @@ repos:
|
|
|
13
13
|
- id: check-yaml
|
|
14
14
|
files: .*\.(yaml|yml)$
|
|
15
15
|
- repo: https://github.com/astral-sh/ruff-pre-commit
|
|
16
|
-
rev: v0.
|
|
16
|
+
rev: v0.14.8
|
|
17
17
|
hooks:
|
|
18
18
|
- id: ruff-check
|
|
19
19
|
args: ['--fix', '--unsafe-fixes']
|
|
20
20
|
- id: ruff-format
|
|
21
21
|
- repo: https://opendev.org/openstack/hacking
|
|
22
|
-
rev:
|
|
22
|
+
rev: 8.0.0
|
|
23
23
|
hooks:
|
|
24
24
|
- id: hacking
|
|
25
25
|
additional_dependencies: []
|
|
26
26
|
exclude: '^(doc|releasenotes)/.*$'
|
|
27
|
-
- repo: https://github.com/pre-commit/mirrors-mypy
|
|
28
|
-
rev: v1.17.1
|
|
29
|
-
hooks:
|
|
30
|
-
- id: mypy
|
|
31
|
-
exclude: |
|
|
32
|
-
(?x)(
|
|
33
|
-
oslo_context/fixture.py
|
|
34
|
-
| doc/.*
|
|
35
|
-
| releasenotes/.*
|
|
36
|
-
)
|
|
@@ -1,6 +1,20 @@
|
|
|
1
1
|
CHANGES
|
|
2
2
|
=======
|
|
3
3
|
|
|
4
|
+
6.3.0
|
|
5
|
+
-----
|
|
6
|
+
|
|
7
|
+
* Add interface to override is\_admin check
|
|
8
|
+
* Add link for governance badges
|
|
9
|
+
* Add typing badge
|
|
10
|
+
* Add typing classifier
|
|
11
|
+
* Enable logging related ruff checks
|
|
12
|
+
* ruff: Enable missing E5 check
|
|
13
|
+
* typing: Simplify return type of RequestContext.to\_policy\_values
|
|
14
|
+
* Run mypy from tox
|
|
15
|
+
* Delay string interpolations at logging calls
|
|
16
|
+
* Remove reference to tag framework
|
|
17
|
+
|
|
4
18
|
6.2.0
|
|
5
19
|
-----
|
|
6
20
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: oslo.context
|
|
3
|
-
Version: 6.
|
|
3
|
+
Version: 6.3.0
|
|
4
4
|
Summary: Oslo Context library
|
|
5
5
|
Author-email: OpenStack <openstack-discuss@lists.openstack.org>
|
|
6
6
|
License: Apache-2.0
|
|
@@ -19,17 +19,35 @@ Classifier: Programming Language :: Python :: 3.12
|
|
|
19
19
|
Classifier: Programming Language :: Python :: 3.13
|
|
20
20
|
Classifier: Programming Language :: Python :: 3 :: Only
|
|
21
21
|
Classifier: Programming Language :: Python :: Implementation :: CPython
|
|
22
|
+
Classifier: Typing :: Typed
|
|
22
23
|
Requires-Python: >=3.10
|
|
23
24
|
Description-Content-Type: text/x-rst
|
|
24
25
|
License-File: LICENSE
|
|
25
26
|
Requires-Dist: pbr>=2.0.0
|
|
26
27
|
Requires-Dist: typing-extensions>=4.12.0
|
|
28
|
+
Dynamic: license-file
|
|
29
|
+
Dynamic: requires-dist
|
|
27
30
|
|
|
28
31
|
====================
|
|
29
32
|
Oslo Context Library
|
|
30
33
|
====================
|
|
31
34
|
|
|
32
|
-
|
|
35
|
+
.. image:: https://governance.openstack.org/tc/badges/oslo.context.svg
|
|
36
|
+
:target: https://governance.openstack.org/tc/reference/projects/oslo.html
|
|
37
|
+
|
|
38
|
+
.. image:: https://img.shields.io/pypi/v/oslo.context
|
|
39
|
+
:target: https://pypi.org/project/oslo.context/
|
|
40
|
+
:alt: Latest Version
|
|
41
|
+
|
|
42
|
+
.. image:: https://img.shields.io/pypi/dm/oslo.context
|
|
43
|
+
:target: https://pypi.org/project/oslo.context/
|
|
44
|
+
:alt: Downloads
|
|
45
|
+
|
|
46
|
+
.. image:: https://img.shields.io/pypi/types/oslo.context
|
|
47
|
+
:target: https://pypi.org/project/oslo.context/
|
|
48
|
+
:alt: Typing Status
|
|
49
|
+
|
|
50
|
+
The oslo.context library has helpers to maintain useful information
|
|
33
51
|
about a request context. The request context is usually populated in
|
|
34
52
|
the WSGI pipeline and used by various modules such as logging.
|
|
35
53
|
|
|
@@ -38,19 +56,3 @@ the WSGI pipeline and used by various modules such as logging.
|
|
|
38
56
|
* Source: https://opendev.org/openstack/oslo.context
|
|
39
57
|
* Bugs: https://bugs.launchpad.net/oslo.context
|
|
40
58
|
* Release notes: https://docs.openstack.org/releasenotes/oslo.context/
|
|
41
|
-
|
|
42
|
-
Team and repository tags
|
|
43
|
-
========================
|
|
44
|
-
|
|
45
|
-
.. image:: https://governance.openstack.org/tc/badges/oslo.context.svg
|
|
46
|
-
:target: https://governance.openstack.org/tc/reference/tags/index.html
|
|
47
|
-
|
|
48
|
-
.. Change things from this point on
|
|
49
|
-
|
|
50
|
-
.. image:: https://img.shields.io/pypi/v/oslo.context.svg
|
|
51
|
-
:target: https://pypi.org/project/oslo.context/
|
|
52
|
-
:alt: Latest Version
|
|
53
|
-
|
|
54
|
-
.. image:: https://img.shields.io/pypi/dm/oslo.context.svg
|
|
55
|
-
:target: https://pypi.org/project/oslo.context/
|
|
56
|
-
:alt: Downloads
|
|
@@ -2,7 +2,22 @@
|
|
|
2
2
|
Oslo Context Library
|
|
3
3
|
====================
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
.. image:: https://governance.openstack.org/tc/badges/oslo.context.svg
|
|
6
|
+
:target: https://governance.openstack.org/tc/reference/projects/oslo.html
|
|
7
|
+
|
|
8
|
+
.. image:: https://img.shields.io/pypi/v/oslo.context
|
|
9
|
+
:target: https://pypi.org/project/oslo.context/
|
|
10
|
+
:alt: Latest Version
|
|
11
|
+
|
|
12
|
+
.. image:: https://img.shields.io/pypi/dm/oslo.context
|
|
13
|
+
:target: https://pypi.org/project/oslo.context/
|
|
14
|
+
:alt: Downloads
|
|
15
|
+
|
|
16
|
+
.. image:: https://img.shields.io/pypi/types/oslo.context
|
|
17
|
+
:target: https://pypi.org/project/oslo.context/
|
|
18
|
+
:alt: Typing Status
|
|
19
|
+
|
|
20
|
+
The oslo.context library has helpers to maintain useful information
|
|
6
21
|
about a request context. The request context is usually populated in
|
|
7
22
|
the WSGI pipeline and used by various modules such as logging.
|
|
8
23
|
|
|
@@ -11,19 +26,3 @@ the WSGI pipeline and used by various modules such as logging.
|
|
|
11
26
|
* Source: https://opendev.org/openstack/oslo.context
|
|
12
27
|
* Bugs: https://bugs.launchpad.net/oslo.context
|
|
13
28
|
* Release notes: https://docs.openstack.org/releasenotes/oslo.context/
|
|
14
|
-
|
|
15
|
-
Team and repository tags
|
|
16
|
-
========================
|
|
17
|
-
|
|
18
|
-
.. image:: https://governance.openstack.org/tc/badges/oslo.context.svg
|
|
19
|
-
:target: https://governance.openstack.org/tc/reference/tags/index.html
|
|
20
|
-
|
|
21
|
-
.. Change things from this point on
|
|
22
|
-
|
|
23
|
-
.. image:: https://img.shields.io/pypi/v/oslo.context.svg
|
|
24
|
-
:target: https://pypi.org/project/oslo.context/
|
|
25
|
-
:alt: Latest Version
|
|
26
|
-
|
|
27
|
-
.. image:: https://img.shields.io/pypi/dm/oslo.context.svg
|
|
28
|
-
:target: https://pypi.org/project/oslo.context/
|
|
29
|
-
:alt: Downloads
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: oslo.context
|
|
3
|
-
Version: 6.
|
|
3
|
+
Version: 6.3.0
|
|
4
4
|
Summary: Oslo Context library
|
|
5
5
|
Author-email: OpenStack <openstack-discuss@lists.openstack.org>
|
|
6
6
|
License: Apache-2.0
|
|
@@ -19,17 +19,35 @@ Classifier: Programming Language :: Python :: 3.12
|
|
|
19
19
|
Classifier: Programming Language :: Python :: 3.13
|
|
20
20
|
Classifier: Programming Language :: Python :: 3 :: Only
|
|
21
21
|
Classifier: Programming Language :: Python :: Implementation :: CPython
|
|
22
|
+
Classifier: Typing :: Typed
|
|
22
23
|
Requires-Python: >=3.10
|
|
23
24
|
Description-Content-Type: text/x-rst
|
|
24
25
|
License-File: LICENSE
|
|
25
26
|
Requires-Dist: pbr>=2.0.0
|
|
26
27
|
Requires-Dist: typing-extensions>=4.12.0
|
|
28
|
+
Dynamic: license-file
|
|
29
|
+
Dynamic: requires-dist
|
|
27
30
|
|
|
28
31
|
====================
|
|
29
32
|
Oslo Context Library
|
|
30
33
|
====================
|
|
31
34
|
|
|
32
|
-
|
|
35
|
+
.. image:: https://governance.openstack.org/tc/badges/oslo.context.svg
|
|
36
|
+
:target: https://governance.openstack.org/tc/reference/projects/oslo.html
|
|
37
|
+
|
|
38
|
+
.. image:: https://img.shields.io/pypi/v/oslo.context
|
|
39
|
+
:target: https://pypi.org/project/oslo.context/
|
|
40
|
+
:alt: Latest Version
|
|
41
|
+
|
|
42
|
+
.. image:: https://img.shields.io/pypi/dm/oslo.context
|
|
43
|
+
:target: https://pypi.org/project/oslo.context/
|
|
44
|
+
:alt: Downloads
|
|
45
|
+
|
|
46
|
+
.. image:: https://img.shields.io/pypi/types/oslo.context
|
|
47
|
+
:target: https://pypi.org/project/oslo.context/
|
|
48
|
+
:alt: Typing Status
|
|
49
|
+
|
|
50
|
+
The oslo.context library has helpers to maintain useful information
|
|
33
51
|
about a request context. The request context is usually populated in
|
|
34
52
|
the WSGI pipeline and used by various modules such as logging.
|
|
35
53
|
|
|
@@ -38,19 +56,3 @@ the WSGI pipeline and used by various modules such as logging.
|
|
|
38
56
|
* Source: https://opendev.org/openstack/oslo.context
|
|
39
57
|
* Bugs: https://bugs.launchpad.net/oslo.context
|
|
40
58
|
* Release notes: https://docs.openstack.org/releasenotes/oslo.context/
|
|
41
|
-
|
|
42
|
-
Team and repository tags
|
|
43
|
-
========================
|
|
44
|
-
|
|
45
|
-
.. image:: https://governance.openstack.org/tc/badges/oslo.context.svg
|
|
46
|
-
:target: https://governance.openstack.org/tc/reference/tags/index.html
|
|
47
|
-
|
|
48
|
-
.. Change things from this point on
|
|
49
|
-
|
|
50
|
-
.. image:: https://img.shields.io/pypi/v/oslo.context.svg
|
|
51
|
-
:target: https://pypi.org/project/oslo.context/
|
|
52
|
-
:alt: Latest Version
|
|
53
|
-
|
|
54
|
-
.. image:: https://img.shields.io/pypi/dm/oslo.context.svg
|
|
55
|
-
:target: https://pypi.org/project/oslo.context/
|
|
56
|
-
:alt: Downloads
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"git_version": "45fea5f", "is_release": true}
|
|
@@ -153,7 +153,7 @@ class RequestContext:
|
|
|
153
153
|
domain_id: str | None = None,
|
|
154
154
|
user_domain_id: str | None = None,
|
|
155
155
|
project_domain_id: str | None = None,
|
|
156
|
-
is_admin: bool = False,
|
|
156
|
+
is_admin: bool | None = False,
|
|
157
157
|
read_only: bool = False,
|
|
158
158
|
show_deleted: bool = False,
|
|
159
159
|
request_id: str | None = None,
|
|
@@ -186,12 +186,10 @@ class RequestContext:
|
|
|
186
186
|
:param is_admin_project: Whether the specified project is specified in
|
|
187
187
|
the token as the admin project. Defaults to
|
|
188
188
|
True for backwards compatibility.
|
|
189
|
-
:type is_admin_project: bool
|
|
190
189
|
:param system_scope: The system scope of a token. The value ``all``
|
|
191
190
|
represents the entire deployment system. A service
|
|
192
191
|
ID represents a specific service within the
|
|
193
192
|
deployment system.
|
|
194
|
-
:type system_scope: string
|
|
195
193
|
"""
|
|
196
194
|
# setting to private variables to avoid triggering subclass properties
|
|
197
195
|
self.user_id = user_id
|
|
@@ -207,7 +205,7 @@ class RequestContext:
|
|
|
207
205
|
self.system_scope = system_scope
|
|
208
206
|
self.user_domain_name = user_domain_name
|
|
209
207
|
self.project_domain_name = project_domain_name
|
|
210
|
-
self.
|
|
208
|
+
self._is_admin = is_admin
|
|
211
209
|
self.is_admin_project = is_admin_project
|
|
212
210
|
self.read_only = read_only
|
|
213
211
|
self.show_deleted = show_deleted
|
|
@@ -234,11 +232,22 @@ class RequestContext:
|
|
|
234
232
|
if overwrite or not get_current():
|
|
235
233
|
self.update_store()
|
|
236
234
|
|
|
235
|
+
@property
|
|
236
|
+
def is_admin(self) -> bool | None:
|
|
237
|
+
# NOTE(tkajinam): Provide the property interface so that additional
|
|
238
|
+
# mechanism to detect its value from Context instance can be
|
|
239
|
+
# implemented by override
|
|
240
|
+
return self._is_admin
|
|
241
|
+
|
|
242
|
+
@is_admin.setter
|
|
243
|
+
def is_admin(self, value: bool | None) -> None:
|
|
244
|
+
self._is_admin = value
|
|
245
|
+
|
|
237
246
|
def update_store(self) -> None:
|
|
238
247
|
"""Store the context in the current thread."""
|
|
239
248
|
_request_store.context = self
|
|
240
249
|
|
|
241
|
-
def to_policy_values(self) ->
|
|
250
|
+
def to_policy_values(self) -> _MutableMapping:
|
|
242
251
|
"""A dictionary of context attributes to enforce policy with.
|
|
243
252
|
|
|
244
253
|
oslo.policy enforcement requires a dictionary of attributes
|
|
@@ -492,7 +492,10 @@ class ContextTest(test_base.BaseTestCase):
|
|
|
492
492
|
self.assertEqual(show_deleted, d['show_deleted'])
|
|
493
493
|
self.assertEqual(request_id, d['request_id'])
|
|
494
494
|
self.assertEqual(resource_uuid, d['resource_uuid'])
|
|
495
|
-
user_identity =
|
|
495
|
+
user_identity = (
|
|
496
|
+
f"{user_id} {project_id} {domain_id} {user_domain_id} "
|
|
497
|
+
f"{project_domain_id}"
|
|
498
|
+
)
|
|
496
499
|
self.assertEqual(user_identity, d['user_identity'])
|
|
497
500
|
self.assertEqual([], d['roles'])
|
|
498
501
|
|
|
@@ -26,6 +26,7 @@ classifiers = [
|
|
|
26
26
|
"Programming Language :: Python :: 3.13",
|
|
27
27
|
"Programming Language :: Python :: 3 :: Only",
|
|
28
28
|
"Programming Language :: Python :: Implementation :: CPython",
|
|
29
|
+
"Typing :: Typed",
|
|
29
30
|
]
|
|
30
31
|
|
|
31
32
|
[project.urls]
|
|
@@ -37,6 +38,20 @@ packages = [
|
|
|
37
38
|
"oslo_context"
|
|
38
39
|
]
|
|
39
40
|
|
|
41
|
+
[tool.mypy]
|
|
42
|
+
python_version = "3.10"
|
|
43
|
+
show_column_numbers = true
|
|
44
|
+
show_error_context = true
|
|
45
|
+
strict = true
|
|
46
|
+
ignore_missing_imports = true
|
|
47
|
+
exclude = '(?x)(doc | releasenotes)'
|
|
48
|
+
|
|
49
|
+
[[tool.mypy.overrides]]
|
|
50
|
+
module = ["oslo_context.tests.*"]
|
|
51
|
+
disallow_untyped_calls = false
|
|
52
|
+
disallow_untyped_defs = false
|
|
53
|
+
disallow_subclassing_any = false
|
|
54
|
+
|
|
40
55
|
[tool.ruff]
|
|
41
56
|
line-length = 79
|
|
42
57
|
|
|
@@ -45,47 +60,7 @@ quote-style = "preserve"
|
|
|
45
60
|
docstring-code-format = true
|
|
46
61
|
|
|
47
62
|
[tool.ruff.lint]
|
|
48
|
-
select = ["E4", "E7", "E9", "F", "S", "UP"]
|
|
63
|
+
select = ["E4", "E5", "E7", "E9", "F", "G", "LOG", "S", "UP"]
|
|
49
64
|
|
|
50
65
|
[tool.ruff.lint.per-file-ignores]
|
|
51
66
|
"oslo_context/tests/*" = ["S"]
|
|
52
|
-
|
|
53
|
-
[tool.mypy]
|
|
54
|
-
python_version = "3.10"
|
|
55
|
-
show_column_numbers = true
|
|
56
|
-
show_error_context = true
|
|
57
|
-
ignore_missing_imports = true
|
|
58
|
-
follow_imports = "normal"
|
|
59
|
-
check_untyped_defs = true
|
|
60
|
-
warn_unused_ignores = false
|
|
61
|
-
warn_return_any = true
|
|
62
|
-
warn_unused_configs = true
|
|
63
|
-
warn_redundant_casts = true
|
|
64
|
-
strict_equality = true
|
|
65
|
-
disallow_untyped_decorators = true
|
|
66
|
-
disallow_any_generics = true
|
|
67
|
-
disallow_subclassing_any = true
|
|
68
|
-
disallow_untyped_calls = true
|
|
69
|
-
disallow_incomplete_defs = true
|
|
70
|
-
disallow_untyped_defs = true
|
|
71
|
-
no_implicit_reexport = true
|
|
72
|
-
extra_checks = true
|
|
73
|
-
# keep this in-sync with 'mypy.exclude' in '.pre-commit-config.yaml'
|
|
74
|
-
exclude = '''
|
|
75
|
-
(?x)(
|
|
76
|
-
doc
|
|
77
|
-
| releasenotes
|
|
78
|
-
)
|
|
79
|
-
'''
|
|
80
|
-
|
|
81
|
-
[[tool.mypy.overrides]]
|
|
82
|
-
module = [
|
|
83
|
-
"oslo_context.fixture",
|
|
84
|
-
"oslo_context.tests.*",
|
|
85
|
-
]
|
|
86
|
-
warn_return_any = false
|
|
87
|
-
disallow_untyped_decorators = false
|
|
88
|
-
disallow_any_generics = false
|
|
89
|
-
disallow_subclassing_any = false
|
|
90
|
-
disallow_untyped_calls = false
|
|
91
|
-
disallow_untyped_defs = false
|
|
@@ -9,13 +9,23 @@ deps =
|
|
|
9
9
|
commands = stestr run --slowest {posargs}
|
|
10
10
|
|
|
11
11
|
[testenv:pep8]
|
|
12
|
-
skip_install = true
|
|
13
12
|
description =
|
|
14
|
-
Run
|
|
13
|
+
Run style checks.
|
|
15
14
|
deps =
|
|
16
15
|
pre-commit
|
|
16
|
+
{[testenv:mypy]deps}
|
|
17
17
|
commands =
|
|
18
18
|
pre-commit run -a
|
|
19
|
+
{[testenv:mypy]commands}
|
|
20
|
+
|
|
21
|
+
[testenv:mypy]
|
|
22
|
+
description =
|
|
23
|
+
Run type checks.
|
|
24
|
+
deps =
|
|
25
|
+
{[testenv]deps}
|
|
26
|
+
mypy
|
|
27
|
+
commands =
|
|
28
|
+
mypy --cache-dir="{envdir}/mypy_cache" {posargs:oslo_context}
|
|
19
29
|
|
|
20
30
|
[testenv:venv]
|
|
21
31
|
commands = {posargs}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"git_version": "0184e52", "is_release": true}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{oslo_context-6.2.0 → oslo_context-6.3.0}/releasenotes/notes/redacted-copy-efd02c83c287451f.yaml
RENAMED
|
File without changes
|
|
File without changes
|
{oslo_context-6.2.0 → oslo_context-6.3.0}/releasenotes/notes/remove-py38-f21fbda6dac198c4.yaml
RENAMED
|
File without changes
|
{oslo_context-6.2.0 → oslo_context-6.3.0}/releasenotes/notes/remove-py39-643032e829d29b78.yaml
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|