oidcauthlib 3.0.30__tar.gz → 3.1.1__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.
- {oidcauthlib-3.0.30/oidcauthlib.egg-info → oidcauthlib-3.1.1}/PKG-INFO +59 -1
- oidcauthlib-3.1.1/README.md +101 -0
- oidcauthlib-3.1.1/VERSION +1 -0
- oidcauthlib-3.1.1/oidcauthlib/authorization/__init__.py +43 -0
- oidcauthlib-3.1.1/oidcauthlib/authorization/admin_access.py +140 -0
- oidcauthlib-3.1.1/oidcauthlib/authorization/client_keys.py +102 -0
- oidcauthlib-3.1.1/oidcauthlib/authorization/client_slugs.py +119 -0
- oidcauthlib-3.1.1/oidcauthlib/authorization/reader_configuration.py +85 -0
- oidcauthlib-3.1.1/oidcauthlib/authorization/scopes.py +51 -0
- {oidcauthlib-3.0.30 → oidcauthlib-3.1.1/oidcauthlib.egg-info}/PKG-INFO +59 -1
- {oidcauthlib-3.0.30 → oidcauthlib-3.1.1}/oidcauthlib.egg-info/SOURCES.txt +6 -0
- oidcauthlib-3.0.30/README.md +0 -43
- oidcauthlib-3.0.30/VERSION +0 -1
- {oidcauthlib-3.0.30 → oidcauthlib-3.1.1}/LICENSE +0 -0
- {oidcauthlib-3.0.30 → oidcauthlib-3.1.1}/MANIFEST.in +0 -0
- {oidcauthlib-3.0.30 → oidcauthlib-3.1.1}/oidcauthlib/__init__.py +0 -0
- {oidcauthlib-3.0.30 → oidcauthlib-3.1.1}/oidcauthlib/auth/__init__.py +0 -0
- {oidcauthlib-3.0.30 → oidcauthlib-3.1.1}/oidcauthlib/auth/auth_helper.py +0 -0
- {oidcauthlib-3.0.30 → oidcauthlib-3.1.1}/oidcauthlib/auth/auth_manager.py +0 -0
- {oidcauthlib-3.0.30 → oidcauthlib-3.1.1}/oidcauthlib/auth/cache/__init__.py +0 -0
- {oidcauthlib-3.0.30 → oidcauthlib-3.1.1}/oidcauthlib/auth/cache/oauth_cache.py +0 -0
- {oidcauthlib-3.0.30 → oidcauthlib-3.1.1}/oidcauthlib/auth/cache/oauth_memory_cache.py +0 -0
- {oidcauthlib-3.0.30 → oidcauthlib-3.1.1}/oidcauthlib/auth/cache/oauth_mongo_cache.py +0 -0
- {oidcauthlib-3.0.30 → oidcauthlib-3.1.1}/oidcauthlib/auth/config/__init__.py +0 -0
- {oidcauthlib-3.0.30 → oidcauthlib-3.1.1}/oidcauthlib/auth/config/auth_config.py +0 -0
- {oidcauthlib-3.0.30 → oidcauthlib-3.1.1}/oidcauthlib/auth/config/auth_config_reader.py +0 -0
- {oidcauthlib-3.0.30 → oidcauthlib-3.1.1}/oidcauthlib/auth/dcr/__init__.py +0 -0
- {oidcauthlib-3.0.30 → oidcauthlib-3.1.1}/oidcauthlib/auth/dcr/dcr_client.py +0 -0
- {oidcauthlib-3.0.30 → oidcauthlib-3.1.1}/oidcauthlib/auth/dcr/dcr_manager.py +0 -0
- {oidcauthlib-3.0.30 → oidcauthlib-3.1.1}/oidcauthlib/auth/dcr/dcr_registration.py +0 -0
- {oidcauthlib-3.0.30 → oidcauthlib-3.1.1}/oidcauthlib/auth/exceptions/__init__.py +0 -0
- {oidcauthlib-3.0.30 → oidcauthlib-3.1.1}/oidcauthlib/auth/exceptions/authorization_bearer_token_expired_exception.py +0 -0
- {oidcauthlib-3.0.30 → oidcauthlib-3.1.1}/oidcauthlib/auth/exceptions/authorization_bearer_token_invalid_exception.py +0 -0
- {oidcauthlib-3.0.30 → oidcauthlib-3.1.1}/oidcauthlib/auth/exceptions/authorization_bearer_token_missing_exception.py +0 -0
- {oidcauthlib-3.0.30 → oidcauthlib-3.1.1}/oidcauthlib/auth/exceptions/authorization_needed_exception.py +0 -0
- {oidcauthlib-3.0.30 → oidcauthlib-3.1.1}/oidcauthlib/auth/fastapi_auth_manager.py +0 -0
- {oidcauthlib-3.0.30 → oidcauthlib-3.1.1}/oidcauthlib/auth/middleware/__init__.py +0 -0
- {oidcauthlib-3.0.30 → oidcauthlib-3.1.1}/oidcauthlib/auth/middleware/request_scope_middleware.py +0 -0
- {oidcauthlib-3.0.30 → oidcauthlib-3.1.1}/oidcauthlib/auth/middleware/token_reader_middleware.py +0 -0
- {oidcauthlib-3.0.30 → oidcauthlib-3.1.1}/oidcauthlib/auth/models/__init__.py +0 -0
- {oidcauthlib-3.0.30 → oidcauthlib-3.1.1}/oidcauthlib/auth/models/auth.py +0 -0
- {oidcauthlib-3.0.30 → oidcauthlib-3.1.1}/oidcauthlib/auth/models/base_db_model.py +0 -0
- {oidcauthlib-3.0.30 → oidcauthlib-3.1.1}/oidcauthlib/auth/models/cache_item.py +0 -0
- {oidcauthlib-3.0.30 → oidcauthlib-3.1.1}/oidcauthlib/auth/models/client_key_set.py +0 -0
- {oidcauthlib-3.0.30 → oidcauthlib-3.1.1}/oidcauthlib/auth/models/token.py +0 -0
- {oidcauthlib-3.0.30 → oidcauthlib-3.1.1}/oidcauthlib/auth/repository/__init__.py +0 -0
- {oidcauthlib-3.0.30 → oidcauthlib-3.1.1}/oidcauthlib/auth/repository/base_repository.py +0 -0
- {oidcauthlib-3.0.30 → oidcauthlib-3.1.1}/oidcauthlib/auth/repository/memory/__init__.py +0 -0
- {oidcauthlib-3.0.30 → oidcauthlib-3.1.1}/oidcauthlib/auth/repository/memory/memory_repository.py +0 -0
- {oidcauthlib-3.0.30 → oidcauthlib-3.1.1}/oidcauthlib/auth/repository/mongo/__init__.py +0 -0
- {oidcauthlib-3.0.30 → oidcauthlib-3.1.1}/oidcauthlib/auth/repository/mongo/mongo_repository.py +0 -0
- {oidcauthlib-3.0.30 → oidcauthlib-3.1.1}/oidcauthlib/auth/repository/repository_factory.py +0 -0
- {oidcauthlib-3.0.30 → oidcauthlib-3.1.1}/oidcauthlib/auth/routers/__init__.py +0 -0
- {oidcauthlib-3.0.30 → oidcauthlib-3.1.1}/oidcauthlib/auth/routers/auth_router.py +0 -0
- {oidcauthlib-3.0.30 → oidcauthlib-3.1.1}/oidcauthlib/auth/token_reader.py +0 -0
- {oidcauthlib-3.0.30 → oidcauthlib-3.1.1}/oidcauthlib/auth/userinfo/__init__.py +0 -0
- {oidcauthlib-3.0.30 → oidcauthlib-3.1.1}/oidcauthlib/auth/userinfo/oidc_userinfo_manager.py +0 -0
- {oidcauthlib-3.0.30 → oidcauthlib-3.1.1}/oidcauthlib/auth/well_known_configuration/__init__.py +0 -0
- {oidcauthlib-3.0.30 → oidcauthlib-3.1.1}/oidcauthlib/auth/well_known_configuration/auth_server_metadata.py +0 -0
- {oidcauthlib-3.0.30 → oidcauthlib-3.1.1}/oidcauthlib/auth/well_known_configuration/auth_server_metadata_discovery.py +0 -0
- {oidcauthlib-3.0.30 → oidcauthlib-3.1.1}/oidcauthlib/auth/well_known_configuration/well_known_configuration_cache.py +0 -0
- {oidcauthlib-3.0.30 → oidcauthlib-3.1.1}/oidcauthlib/auth/well_known_configuration/well_known_configuration_cache_result.py +0 -0
- {oidcauthlib-3.0.30 → oidcauthlib-3.1.1}/oidcauthlib/auth/well_known_configuration/well_known_configuration_manager.py +0 -0
- {oidcauthlib-3.0.30 → oidcauthlib-3.1.1}/oidcauthlib/cache_gate/__init__.py +0 -0
- {oidcauthlib-3.0.30 → oidcauthlib-3.1.1}/oidcauthlib/cache_gate/advisory_lock.py +0 -0
- {oidcauthlib-3.0.30 → oidcauthlib-3.1.1}/oidcauthlib/cache_gate/version_gate.py +0 -0
- {oidcauthlib-3.0.30 → oidcauthlib-3.1.1}/oidcauthlib/container/__init__.py +0 -0
- {oidcauthlib-3.0.30 → oidcauthlib-3.1.1}/oidcauthlib/container/oidc_authlib_container_factory.py +0 -0
- {oidcauthlib-3.0.30 → oidcauthlib-3.1.1}/oidcauthlib/open_telemetry/__init__.py +0 -0
- {oidcauthlib-3.0.30 → oidcauthlib-3.1.1}/oidcauthlib/open_telemetry/attribute_names.py +0 -0
- {oidcauthlib-3.0.30 → oidcauthlib-3.1.1}/oidcauthlib/open_telemetry/configurator.py +0 -0
- {oidcauthlib-3.0.30 → oidcauthlib-3.1.1}/oidcauthlib/open_telemetry/filtering_sampler.py +0 -0
- {oidcauthlib-3.0.30 → oidcauthlib-3.1.1}/oidcauthlib/open_telemetry/filtering_span_exporter.py +0 -0
- {oidcauthlib-3.0.30 → oidcauthlib-3.1.1}/oidcauthlib/open_telemetry/filtering_span_processor.py +0 -0
- {oidcauthlib-3.0.30 → oidcauthlib-3.1.1}/oidcauthlib/open_telemetry/otel_setup.py +0 -0
- {oidcauthlib-3.0.30 → oidcauthlib-3.1.1}/oidcauthlib/open_telemetry/span_names.py +0 -0
- {oidcauthlib-3.0.30 → oidcauthlib-3.1.1}/oidcauthlib/py.typed +0 -0
- {oidcauthlib-3.0.30 → oidcauthlib-3.1.1}/oidcauthlib/storage/__init__.py +0 -0
- {oidcauthlib-3.0.30 → oidcauthlib-3.1.1}/oidcauthlib/storage/cache_to_collection_mapper.py +0 -0
- {oidcauthlib-3.0.30 → oidcauthlib-3.1.1}/oidcauthlib/storage/memory_storage_factory.py +0 -0
- {oidcauthlib-3.0.30 → oidcauthlib-3.1.1}/oidcauthlib/storage/mongo_gridfs_db.py +0 -0
- {oidcauthlib-3.0.30 → oidcauthlib-3.1.1}/oidcauthlib/storage/mongo_gridfs_exception.py +0 -0
- {oidcauthlib-3.0.30 → oidcauthlib-3.1.1}/oidcauthlib/storage/mongo_storage_factory.py +0 -0
- {oidcauthlib-3.0.30 → oidcauthlib-3.1.1}/oidcauthlib/storage/storage_factory.py +0 -0
- {oidcauthlib-3.0.30 → oidcauthlib-3.1.1}/oidcauthlib/storage/storage_factory_creator.py +0 -0
- {oidcauthlib-3.0.30 → oidcauthlib-3.1.1}/oidcauthlib/utilities/__init__.py +0 -0
- {oidcauthlib-3.0.30 → oidcauthlib-3.1.1}/oidcauthlib/utilities/cached.py +0 -0
- {oidcauthlib-3.0.30 → oidcauthlib-3.1.1}/oidcauthlib/utilities/environment/__init__.py +0 -0
- {oidcauthlib-3.0.30 → oidcauthlib-3.1.1}/oidcauthlib/utilities/environment/abstract_environment_variables.py +0 -0
- {oidcauthlib-3.0.30 → oidcauthlib-3.1.1}/oidcauthlib/utilities/environment/oidc_environment_variables.py +0 -0
- {oidcauthlib-3.0.30 → oidcauthlib-3.1.1}/oidcauthlib/utilities/logger/__init__.py +0 -0
- {oidcauthlib-3.0.30 → oidcauthlib-3.1.1}/oidcauthlib/utilities/logger/log_levels.py +0 -0
- {oidcauthlib-3.0.30 → oidcauthlib-3.1.1}/oidcauthlib/utilities/logger/logging_response.py +0 -0
- {oidcauthlib-3.0.30 → oidcauthlib-3.1.1}/oidcauthlib/utilities/logger/logging_transport.py +0 -0
- {oidcauthlib-3.0.30 → oidcauthlib-3.1.1}/oidcauthlib/utilities/mongo_url_utils.py +0 -0
- {oidcauthlib-3.0.30 → oidcauthlib-3.1.1}/oidcauthlib/utilities/url_validator.py +0 -0
- {oidcauthlib-3.0.30 → oidcauthlib-3.1.1}/oidcauthlib.egg-info/dependency_links.txt +0 -0
- {oidcauthlib-3.0.30 → oidcauthlib-3.1.1}/oidcauthlib.egg-info/requires.txt +0 -0
- {oidcauthlib-3.0.30 → oidcauthlib-3.1.1}/oidcauthlib.egg-info/top_level.txt +0 -0
- {oidcauthlib-3.0.30 → oidcauthlib-3.1.1}/pyproject.toml +0 -0
- {oidcauthlib-3.0.30 → oidcauthlib-3.1.1}/setup.cfg +0 -0
- {oidcauthlib-3.0.30 → oidcauthlib-3.1.1}/tests/test_mongo_url_utils.py +0 -0
- {oidcauthlib-3.0.30 → oidcauthlib-3.1.1}/tests/test_simple.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: oidcauthlib
|
|
3
|
-
Version: 3.
|
|
3
|
+
Version: 3.1.1
|
|
4
4
|
Summary: oidcauthlib
|
|
5
5
|
Author-email: Imran Qureshi <imran.qureshi@bwell.com>
|
|
6
6
|
License: Apache-2.0
|
|
@@ -69,3 +69,61 @@ scopes = await manager.get_scopes_from_user_info_async(access_token=token)
|
|
|
69
69
|
malformed entry is logged and treated as a miss, and the refetched scopes overwrite the bad entry. A
|
|
70
70
|
userinfo HTTP error, a missing provider or a mismatched subject is raised, so each service decides whether
|
|
71
71
|
to fail closed or degrade.
|
|
72
|
+
|
|
73
|
+
## Administrator and tenant-reader tiers (`oidcauthlib.authorization`)
|
|
74
|
+
|
|
75
|
+
Pure helpers that turn a caller's merged scopes (for example the result of `OidcUserInfoManager`) into a
|
|
76
|
+
tier: `admin` (unrestricted), `reader` (limited to the client keys its `access/<slug>.*` scopes select), or
|
|
77
|
+
denied. The subpackage reads no environment variable, does no I/O and imports nothing else from
|
|
78
|
+
`oidcauthlib`; the caller verifies the token, looks up the user and passes the configuration in. The
|
|
79
|
+
`access/<slug>.*` and `patient/` scope convention is the FHIR server's, described in its
|
|
80
|
+
[security guide](https://github.com/icanbwell/fhir-server/blob/main/readme/security.md) (section 5); the tier
|
|
81
|
+
model is recorded in [ADR 0001](adrs/0001-authorization-tiers-from-scopes.md).
|
|
82
|
+
|
|
83
|
+
```python
|
|
84
|
+
from oidcauthlib.authorization import (
|
|
85
|
+
ClientSlugResolver,
|
|
86
|
+
parse_client_keys_lenient,
|
|
87
|
+
resolve_admin_access,
|
|
88
|
+
validate_reader_configuration,
|
|
89
|
+
)
|
|
90
|
+
|
|
91
|
+
RAW_CLIENTS = "One=key-1,Two=key-2" # the setting that holds the client-key mapping
|
|
92
|
+
|
|
93
|
+
# At startup: refuse an unsafe configuration (a no-op when no reader scopes are set).
|
|
94
|
+
validate_reader_configuration(
|
|
95
|
+
reader_scopes=["example/reader"],
|
|
96
|
+
admin_scopes=["example/admin"],
|
|
97
|
+
client_keys_raw=RAW_CLIENTS,
|
|
98
|
+
)
|
|
99
|
+
|
|
100
|
+
clients = ClientSlugResolver.from_client_keys(clients=parse_client_keys_lenient(raw=RAW_CLIENTS))
|
|
101
|
+
access = resolve_admin_access(
|
|
102
|
+
scopes=["example/reader", "access/one.*"],
|
|
103
|
+
admin_scopes=["example/admin"],
|
|
104
|
+
reader_scopes=["example/reader"],
|
|
105
|
+
clients=clients,
|
|
106
|
+
allow_all_tenants=False,
|
|
107
|
+
)
|
|
108
|
+
# access.tier is AdminTier.READER and access.allowed_client_keys == frozenset({"key-1"})
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
- **Order:** any `patient/` scope (trimmed, case-insensitive) denies first; then holding every admin scope
|
|
112
|
+
gives `admin`; then every reader scope plus at least one `access/<slug>.*` that selects a client gives
|
|
113
|
+
`reader`; anything else is denied with a `DenialReason`. An empty admin or reader requirement admits nobody.
|
|
114
|
+
- **Slugs:** `access/<slug>.*` selects the client whose name, stripped and casefolded, equals the slug. Two
|
|
115
|
+
names that casefold alike make the slug ambiguous and it selects nothing. The suffix must be exactly `.*`.
|
|
116
|
+
`access/*.*` selects every client only when `allow_all_tenants=True`, including a client whose own slug is
|
|
117
|
+
ambiguous. An ambiguous slug is logged by slug only, through the standard `logging` module (the package
|
|
118
|
+
configures no logger of its own).
|
|
119
|
+
- **Blank scopes:** an admin or reader scope list that is empty, or has a blank entry, admits nobody, and
|
|
120
|
+
`validate_reader_configuration` refuses a blank or padded entry in either list.
|
|
121
|
+
- **No default for "all tenants":** `allowed_client_keys` is `None` only for `admin`. A reader always has a
|
|
122
|
+
non-empty set and a denied caller always has `frozenset()`, so a denial can never be read as unrestricted.
|
|
123
|
+
`AdminAccess` enforces this when it is constructed.
|
|
124
|
+
- **Client-key mapping:** a `name -> key` map given as a JSON object or `One=key-1,Two=key-2`.
|
|
125
|
+
`parse_client_keys_lenient` keeps the permissive behavior (a malformed JSON object falls back to comma
|
|
126
|
+
parsing, an entry without `=` is dropped); `parse_client_keys_strict` refuses both, and refuses blank or
|
|
127
|
+
repeated names. Error messages name the rule, never a name or key.
|
|
128
|
+
- **Eligibility:** `from_client_keys(..., is_eligible=...)` takes a `(name, key) -> bool` strategy for
|
|
129
|
+
callers that exclude some clients; an excluded client is in no view and takes no part in ambiguity.
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
# oidcauthlib
|
|
2
|
+
|
|
3
|
+
## OIDC userinfo scopes (`OidcUserInfoManager`)
|
|
4
|
+
|
|
5
|
+
Some providers (e.g. Okta employee access tokens) only carry `openid profile email groups` in the JWT;
|
|
6
|
+
the scopes that authorize a caller appear only on the OIDC userinfo response.
|
|
7
|
+
`oidcauthlib.auth.userinfo.oidc_userinfo_manager.OidcUserInfoManager` resolves a token's effective
|
|
8
|
+
scopes from the token's own claims plus the userinfo endpoint, and caches the userinfo-derived scopes in
|
|
9
|
+
a key-value store.
|
|
10
|
+
|
|
11
|
+
```python
|
|
12
|
+
manager = OidcUserInfoManager(
|
|
13
|
+
auth_config_reader=auth_config_reader,
|
|
14
|
+
well_known_configuration_manager=well_known_configuration_manager,
|
|
15
|
+
store=store, # py-key-value-aio store; yours, not shared with other services
|
|
16
|
+
cache_collection="oidc-user-info-cache",
|
|
17
|
+
cache_ttl_seconds=86400,
|
|
18
|
+
fetch_timeout_seconds=30,
|
|
19
|
+
scope_claims=["custom:scope"], # optional extra claims holding scopes
|
|
20
|
+
group_claims=["groups"], # optional claims holding group names, used whole as scopes
|
|
21
|
+
scope_remove_prefixes=["fhir/prod/"],
|
|
22
|
+
)
|
|
23
|
+
scopes = await manager.get_scopes_from_user_info_async(access_token=token)
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
- **Scope derivation** follows fhir-server-ui's `jwtParser`: the `scope` claim (plus `scp`), then
|
|
27
|
+
`scope_claims`, then `group_claims` (each value taken whole). Commas separate like spaces, results are
|
|
28
|
+
de-duplicated, and `scope_remove_prefixes` are stripped (first match wins). Nothing beyond `scope`/`scp`
|
|
29
|
+
is read unless configured.
|
|
30
|
+
- **Provider** is matched to the token's `iss`: an exact `issuer`, else a `well_known_uri` on the same scheme,
|
|
31
|
+
host and port whose path segments start with the issuer's. Only a token with no `iss` at all is matched by
|
|
32
|
+
its client id. A token matching no provider raises `ValueError`; it is never sent to another provider.
|
|
33
|
+
- **Subject check:** for a token that has a `sub`, the userinfo response must carry the same `sub`
|
|
34
|
+
(OIDC Core 5.3.2); a missing or different one raises `ValueError` and nothing is cached.
|
|
35
|
+
- **Cache** key is `oidc-userinfo-scopes:<issuer>:<client_id>:<sub>|v1` with each segment percent-encoded
|
|
36
|
+
(so values containing `:` cannot collide, and two providers never share an entry); only the
|
|
37
|
+
userinfo-derived scopes are stored, never the userinfo response. The token's own scopes are re-derived on every call. A token without
|
|
38
|
+
`sub` or without an issuer, or an empty scope list, is not cached. Changes to a user's entitlements are visible after at most
|
|
39
|
+
`cache_ttl_seconds`.
|
|
40
|
+
- **Failures:** the cache never fails a lookup. A write failure is logged and swallowed; a read failure or a
|
|
41
|
+
malformed entry is logged and treated as a miss, and the refetched scopes overwrite the bad entry. A
|
|
42
|
+
userinfo HTTP error, a missing provider or a mismatched subject is raised, so each service decides whether
|
|
43
|
+
to fail closed or degrade.
|
|
44
|
+
|
|
45
|
+
## Administrator and tenant-reader tiers (`oidcauthlib.authorization`)
|
|
46
|
+
|
|
47
|
+
Pure helpers that turn a caller's merged scopes (for example the result of `OidcUserInfoManager`) into a
|
|
48
|
+
tier: `admin` (unrestricted), `reader` (limited to the client keys its `access/<slug>.*` scopes select), or
|
|
49
|
+
denied. The subpackage reads no environment variable, does no I/O and imports nothing else from
|
|
50
|
+
`oidcauthlib`; the caller verifies the token, looks up the user and passes the configuration in. The
|
|
51
|
+
`access/<slug>.*` and `patient/` scope convention is the FHIR server's, described in its
|
|
52
|
+
[security guide](https://github.com/icanbwell/fhir-server/blob/main/readme/security.md) (section 5); the tier
|
|
53
|
+
model is recorded in [ADR 0001](adrs/0001-authorization-tiers-from-scopes.md).
|
|
54
|
+
|
|
55
|
+
```python
|
|
56
|
+
from oidcauthlib.authorization import (
|
|
57
|
+
ClientSlugResolver,
|
|
58
|
+
parse_client_keys_lenient,
|
|
59
|
+
resolve_admin_access,
|
|
60
|
+
validate_reader_configuration,
|
|
61
|
+
)
|
|
62
|
+
|
|
63
|
+
RAW_CLIENTS = "One=key-1,Two=key-2" # the setting that holds the client-key mapping
|
|
64
|
+
|
|
65
|
+
# At startup: refuse an unsafe configuration (a no-op when no reader scopes are set).
|
|
66
|
+
validate_reader_configuration(
|
|
67
|
+
reader_scopes=["example/reader"],
|
|
68
|
+
admin_scopes=["example/admin"],
|
|
69
|
+
client_keys_raw=RAW_CLIENTS,
|
|
70
|
+
)
|
|
71
|
+
|
|
72
|
+
clients = ClientSlugResolver.from_client_keys(clients=parse_client_keys_lenient(raw=RAW_CLIENTS))
|
|
73
|
+
access = resolve_admin_access(
|
|
74
|
+
scopes=["example/reader", "access/one.*"],
|
|
75
|
+
admin_scopes=["example/admin"],
|
|
76
|
+
reader_scopes=["example/reader"],
|
|
77
|
+
clients=clients,
|
|
78
|
+
allow_all_tenants=False,
|
|
79
|
+
)
|
|
80
|
+
# access.tier is AdminTier.READER and access.allowed_client_keys == frozenset({"key-1"})
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
- **Order:** any `patient/` scope (trimmed, case-insensitive) denies first; then holding every admin scope
|
|
84
|
+
gives `admin`; then every reader scope plus at least one `access/<slug>.*` that selects a client gives
|
|
85
|
+
`reader`; anything else is denied with a `DenialReason`. An empty admin or reader requirement admits nobody.
|
|
86
|
+
- **Slugs:** `access/<slug>.*` selects the client whose name, stripped and casefolded, equals the slug. Two
|
|
87
|
+
names that casefold alike make the slug ambiguous and it selects nothing. The suffix must be exactly `.*`.
|
|
88
|
+
`access/*.*` selects every client only when `allow_all_tenants=True`, including a client whose own slug is
|
|
89
|
+
ambiguous. An ambiguous slug is logged by slug only, through the standard `logging` module (the package
|
|
90
|
+
configures no logger of its own).
|
|
91
|
+
- **Blank scopes:** an admin or reader scope list that is empty, or has a blank entry, admits nobody, and
|
|
92
|
+
`validate_reader_configuration` refuses a blank or padded entry in either list.
|
|
93
|
+
- **No default for "all tenants":** `allowed_client_keys` is `None` only for `admin`. A reader always has a
|
|
94
|
+
non-empty set and a denied caller always has `frozenset()`, so a denial can never be read as unrestricted.
|
|
95
|
+
`AdminAccess` enforces this when it is constructed.
|
|
96
|
+
- **Client-key mapping:** a `name -> key` map given as a JSON object or `One=key-1,Two=key-2`.
|
|
97
|
+
`parse_client_keys_lenient` keeps the permissive behavior (a malformed JSON object falls back to comma
|
|
98
|
+
parsing, an entry without `=` is dropped); `parse_client_keys_strict` refuses both, and refuses blank or
|
|
99
|
+
repeated names. Error messages name the rule, never a name or key.
|
|
100
|
+
- **Eligibility:** `from_client_keys(..., is_eligible=...)` takes a `(name, key) -> bool` strategy for
|
|
101
|
+
callers that exclude some clients; an excluded client is in no view and takes no part in ambiguity.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
3.1.1
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"""Pure authorization helpers: administrator and tenant-reader tiers from OAuth scopes.
|
|
2
|
+
|
|
3
|
+
Everything here is a pure function of the values passed in. The package reads no
|
|
4
|
+
environment variable, performs no I/O and imports nothing else from ``oidcauthlib``,
|
|
5
|
+
so callers keep control of token verification, user lookup and configuration.
|
|
6
|
+
"""
|
|
7
|
+
|
|
8
|
+
from oidcauthlib.authorization.admin_access import (
|
|
9
|
+
AdminAccess,
|
|
10
|
+
AdminTier,
|
|
11
|
+
DenialReason,
|
|
12
|
+
resolve_admin_access,
|
|
13
|
+
)
|
|
14
|
+
from oidcauthlib.authorization.client_keys import (
|
|
15
|
+
ClientKeysFormatError,
|
|
16
|
+
parse_client_keys_lenient,
|
|
17
|
+
parse_client_keys_strict,
|
|
18
|
+
)
|
|
19
|
+
from oidcauthlib.authorization.client_slugs import (
|
|
20
|
+
ClientSlugResolver,
|
|
21
|
+
slug_from_access_scope,
|
|
22
|
+
)
|
|
23
|
+
from oidcauthlib.authorization.reader_configuration import (
|
|
24
|
+
ReaderConfigurationError,
|
|
25
|
+
validate_reader_configuration,
|
|
26
|
+
)
|
|
27
|
+
from oidcauthlib.authorization.scopes import has_admin_scopes, has_patient_scope
|
|
28
|
+
|
|
29
|
+
__all__ = [
|
|
30
|
+
"AdminAccess",
|
|
31
|
+
"AdminTier",
|
|
32
|
+
"ClientKeysFormatError",
|
|
33
|
+
"ClientSlugResolver",
|
|
34
|
+
"DenialReason",
|
|
35
|
+
"ReaderConfigurationError",
|
|
36
|
+
"has_admin_scopes",
|
|
37
|
+
"has_patient_scope",
|
|
38
|
+
"parse_client_keys_lenient",
|
|
39
|
+
"parse_client_keys_strict",
|
|
40
|
+
"resolve_admin_access",
|
|
41
|
+
"slug_from_access_scope",
|
|
42
|
+
"validate_reader_configuration",
|
|
43
|
+
]
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
"""Which tier a caller's merged scopes grant: administrator, tenant reader, or denied.
|
|
2
|
+
|
|
3
|
+
Pure: scopes in, ``AdminAccess`` out. No web framework, environment or network.
|
|
4
|
+
|
|
5
|
+
Order of the rules:
|
|
6
|
+
|
|
7
|
+
1. any ``patient/`` scope denies, even with an administrator or reader scope;
|
|
8
|
+
2. every administrator scope held: ``ADMIN``, unrestricted;
|
|
9
|
+
3. every reader scope held plus at least one ``access/<slug>.*`` whose slug
|
|
10
|
+
selects a client: ``READER``, limited to those clients' keys. ``access/*.*``
|
|
11
|
+
is honored only when ``allow_all_tenants`` is set, and then means every
|
|
12
|
+
client in the resolver (a set, so a record outside it stays administrator-only);
|
|
13
|
+
4. anything else is denied, with the reason that names the missing piece.
|
|
14
|
+
|
|
15
|
+
Scope matching is exact on the required scopes, and ``access/*.*`` alone never
|
|
16
|
+
grants the reader tier.
|
|
17
|
+
"""
|
|
18
|
+
|
|
19
|
+
from collections.abc import Iterable, Sequence
|
|
20
|
+
from dataclasses import dataclass, field
|
|
21
|
+
from enum import StrEnum
|
|
22
|
+
|
|
23
|
+
from oidcauthlib.authorization.client_slugs import (
|
|
24
|
+
WILDCARD_SLUG,
|
|
25
|
+
ClientSlugResolver,
|
|
26
|
+
slug_from_access_scope,
|
|
27
|
+
)
|
|
28
|
+
from oidcauthlib.authorization.scopes import has_admin_scopes, has_blank_scope, has_patient_scope
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
class AdminTier(StrEnum):
|
|
32
|
+
"""The tier a granted caller holds; a denied caller has no tier."""
|
|
33
|
+
|
|
34
|
+
ADMIN = "admin"
|
|
35
|
+
READER = "reader"
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
class DenialReason(StrEnum):
|
|
39
|
+
"""Why a caller was denied; also usable as a metric label."""
|
|
40
|
+
|
|
41
|
+
PATIENT_SCOPE = "patient_scope"
|
|
42
|
+
NOT_A_READER = "not_a_reader"
|
|
43
|
+
NO_ACCESS_SCOPE = "no_access_scope"
|
|
44
|
+
UNMAPPED_ACCESS_SCOPE = "unmapped_access_scope"
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
@dataclass(frozen=True)
|
|
48
|
+
class AdminAccess:
|
|
49
|
+
"""The outcome of a tier decision.
|
|
50
|
+
|
|
51
|
+
``tier`` is ``None`` when the caller is denied, with ``denial_reason`` set.
|
|
52
|
+
``allowed_client_keys`` has three meanings, enforced in ``__post_init__``:
|
|
53
|
+
|
|
54
|
+
* ``None``: unrestricted. Only the ``ADMIN`` tier carries it.
|
|
55
|
+
* a non-empty set: the client keys a ``READER`` may read.
|
|
56
|
+
* an empty set: a denied caller. A denied caller never carries ``None``, so
|
|
57
|
+
no code path can read a denial as "all tenants".
|
|
58
|
+
|
|
59
|
+
Prefer the ``admin``, ``reader`` and ``denied`` constructors.
|
|
60
|
+
"""
|
|
61
|
+
|
|
62
|
+
tier: AdminTier | None
|
|
63
|
+
# repr=False: client keys identify tenants and stay out of logs and tracebacks.
|
|
64
|
+
allowed_client_keys: frozenset[str] | None = field(repr=False)
|
|
65
|
+
denial_reason: DenialReason | None
|
|
66
|
+
|
|
67
|
+
def __post_init__(self) -> None:
|
|
68
|
+
if self.allowed_client_keys is not None and not isinstance(self.allowed_client_keys, frozenset):
|
|
69
|
+
# A mutable set would let a caller widen the decision after it was made.
|
|
70
|
+
object.__setattr__(self, "allowed_client_keys", frozenset(self.allowed_client_keys))
|
|
71
|
+
if self.tier is AdminTier.READER and not self.allowed_client_keys:
|
|
72
|
+
raise ValueError("a reader needs a non-empty set of client keys it may read")
|
|
73
|
+
if self.tier is AdminTier.ADMIN and self.allowed_client_keys is not None:
|
|
74
|
+
raise ValueError("the admin tier is unrestricted: allowed_client_keys must be None")
|
|
75
|
+
if self.tier is None:
|
|
76
|
+
if self.denial_reason is None:
|
|
77
|
+
raise ValueError("a denied caller needs a denial reason")
|
|
78
|
+
if self.allowed_client_keys != frozenset():
|
|
79
|
+
raise ValueError("a denied caller carries an empty set of client keys, never None")
|
|
80
|
+
|
|
81
|
+
@classmethod
|
|
82
|
+
def admin(cls) -> "AdminAccess":
|
|
83
|
+
"""An unrestricted administrator."""
|
|
84
|
+
return cls(tier=AdminTier.ADMIN, allowed_client_keys=None, denial_reason=None)
|
|
85
|
+
|
|
86
|
+
@classmethod
|
|
87
|
+
def reader(cls, *, allowed_client_keys: frozenset[str]) -> "AdminAccess":
|
|
88
|
+
"""A tenant reader limited to ``allowed_client_keys`` (which must not be empty)."""
|
|
89
|
+
return cls(
|
|
90
|
+
tier=AdminTier.READER,
|
|
91
|
+
allowed_client_keys=allowed_client_keys,
|
|
92
|
+
denial_reason=None,
|
|
93
|
+
)
|
|
94
|
+
|
|
95
|
+
@classmethod
|
|
96
|
+
def denied(cls, *, reason: DenialReason) -> "AdminAccess":
|
|
97
|
+
"""A denied caller: no tier, an empty key set and the ``reason``."""
|
|
98
|
+
return cls(tier=None, allowed_client_keys=frozenset(), denial_reason=reason)
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
def resolve_admin_access(
|
|
102
|
+
*,
|
|
103
|
+
scopes: Iterable[str],
|
|
104
|
+
admin_scopes: Sequence[str],
|
|
105
|
+
reader_scopes: Sequence[str],
|
|
106
|
+
clients: ClientSlugResolver,
|
|
107
|
+
allow_all_tenants: bool,
|
|
108
|
+
) -> AdminAccess:
|
|
109
|
+
"""The tier ``scopes`` (the merged token and userinfo scopes) grant.
|
|
110
|
+
|
|
111
|
+
``admin_scopes`` and ``reader_scopes`` are all-of requirements; an empty one,
|
|
112
|
+
or one with a blank entry, admits nobody. Entries of ``scopes`` that are not
|
|
113
|
+
strings are ignored. ``allow_all_tenants`` lets ``access/*.*`` select every
|
|
114
|
+
client in ``clients``, including a client whose own slug is ambiguous. Never
|
|
115
|
+
raises.
|
|
116
|
+
|
|
117
|
+
Args:
|
|
118
|
+
scopes: the merged token and userinfo scopes of the caller.
|
|
119
|
+
admin_scopes: every one of these must be held for the administrator tier.
|
|
120
|
+
reader_scopes: every one of these must be held for the reader tier.
|
|
121
|
+
clients: resolves ``access/<slug>.*`` scopes to client keys.
|
|
122
|
+
allow_all_tenants: whether ``access/*.*`` selects every client.
|
|
123
|
+
"""
|
|
124
|
+
held = {scope for scope in scopes if isinstance(scope, str)}
|
|
125
|
+
if has_patient_scope(scopes=held):
|
|
126
|
+
return AdminAccess.denied(reason=DenialReason.PATIENT_SCOPE)
|
|
127
|
+
if has_admin_scopes(scopes=held, required_scopes=admin_scopes):
|
|
128
|
+
return AdminAccess.admin()
|
|
129
|
+
# An empty requirement would admit everyone (``issubset`` of the empty set).
|
|
130
|
+
if not reader_scopes or has_blank_scope(scopes=reader_scopes) or not set(reader_scopes).issubset(held):
|
|
131
|
+
return AdminAccess.denied(reason=DenialReason.NOT_A_READER)
|
|
132
|
+
slugs = {slug for scope in held if (slug := slug_from_access_scope(scope=scope)) is not None}
|
|
133
|
+
if not slugs:
|
|
134
|
+
return AdminAccess.denied(reason=DenialReason.NO_ACCESS_SCOPE)
|
|
135
|
+
if WILDCARD_SLUG in slugs and allow_all_tenants and clients.all_keys:
|
|
136
|
+
return AdminAccess.reader(allowed_client_keys=clients.all_keys)
|
|
137
|
+
keys = frozenset(key for slug in slugs - {WILDCARD_SLUG} for key in clients.keys_for(slug=slug))
|
|
138
|
+
if not keys:
|
|
139
|
+
return AdminAccess.denied(reason=DenialReason.UNMAPPED_ACCESS_SCOPE)
|
|
140
|
+
return AdminAccess.reader(allowed_client_keys=keys)
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
"""Parsers for a client-key mapping: a ``name -> key`` map held in one setting.
|
|
2
|
+
|
|
3
|
+
The raw value is either a JSON object (``{"One": "key-1"}``) or a comma-separated
|
|
4
|
+
list (``One=key-1,Two=key-2``). Two parsers read it:
|
|
5
|
+
|
|
6
|
+
* ``parse_client_keys_lenient`` keeps the historical behavior of services that
|
|
7
|
+
read this setting: a malformed JSON object falls back to comma parsing and an
|
|
8
|
+
entry without ``=`` is dropped silently.
|
|
9
|
+
* ``parse_client_keys_strict`` is for startup validation: it refuses anything the
|
|
10
|
+
lenient parser would silently repair or drop.
|
|
11
|
+
|
|
12
|
+
Error messages name the rule that failed, never a client name or a key.
|
|
13
|
+
"""
|
|
14
|
+
|
|
15
|
+
import json
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
class ClientKeysFormatError(ValueError):
|
|
19
|
+
"""The raw client-key mapping is malformed."""
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
def parse_client_keys_lenient(*, raw: str) -> dict[str, str]:
|
|
23
|
+
"""Parse the mapping, repairing or dropping what it cannot read.
|
|
24
|
+
|
|
25
|
+
An empty value gives ``{}``. A JSON object parses as is; invalid JSON falls
|
|
26
|
+
back to comma parsing. In the comma form, an entry without ``=`` is dropped.
|
|
27
|
+
|
|
28
|
+
Args:
|
|
29
|
+
raw: the setting's value, a JSON object or a comma-separated ``name=key`` list.
|
|
30
|
+
"""
|
|
31
|
+
if not raw:
|
|
32
|
+
return {}
|
|
33
|
+
if raw.strip().startswith("{"):
|
|
34
|
+
try:
|
|
35
|
+
return dict(json.loads(raw))
|
|
36
|
+
except (json.JSONDecodeError, TypeError):
|
|
37
|
+
pass
|
|
38
|
+
clients: dict[str, str] = {}
|
|
39
|
+
for entry in raw.split(","):
|
|
40
|
+
entry = entry.strip()
|
|
41
|
+
if "=" in entry:
|
|
42
|
+
name, value = entry.split("=", 1)
|
|
43
|
+
clients[name.strip()] = value.strip()
|
|
44
|
+
return clients
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
def parse_client_keys_strict(*, raw: str) -> dict[str, str]:
|
|
48
|
+
"""Parse the mapping and refuse anything the lenient parser would repair.
|
|
49
|
+
|
|
50
|
+
Args:
|
|
51
|
+
raw: the setting's value, a JSON object or a comma-separated ``name=key`` list.
|
|
52
|
+
|
|
53
|
+
Raises:
|
|
54
|
+
ClientKeysFormatError: invalid JSON (no fall-back to comma parsing), a
|
|
55
|
+
JSON value that is not an object of strings, duplicate JSON keys, a
|
|
56
|
+
comma entry without ``=``, a blank name or key, or a name repeated
|
|
57
|
+
after stripping and casefolding (exact repeats included).
|
|
58
|
+
"""
|
|
59
|
+
text = raw.strip()
|
|
60
|
+
if not text:
|
|
61
|
+
return {}
|
|
62
|
+
pairs = _json_pairs(text) if text.startswith("{") else _comma_pairs(text)
|
|
63
|
+
clients: dict[str, str] = {}
|
|
64
|
+
seen: set[str] = set()
|
|
65
|
+
for position, (name, key) in enumerate(pairs, start=1):
|
|
66
|
+
clean_name = name.strip()
|
|
67
|
+
clean_key = key.strip()
|
|
68
|
+
if not clean_name or not clean_key:
|
|
69
|
+
raise ClientKeysFormatError(f"entry {position} has a blank name or key")
|
|
70
|
+
folded = clean_name.casefold()
|
|
71
|
+
if folded in seen:
|
|
72
|
+
raise ClientKeysFormatError(f"entry {position} repeats a name after stripping and ignoring case")
|
|
73
|
+
seen.add(folded)
|
|
74
|
+
clients[clean_name] = clean_key
|
|
75
|
+
return clients
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
def _json_pairs(text: str) -> list[tuple[str, str]]:
|
|
79
|
+
# The caller passes text that starts with "{", so a successful parse is always an
|
|
80
|
+
# object, and ``object_pairs_hook`` gives its (name, value) pairs in order.
|
|
81
|
+
try:
|
|
82
|
+
parsed: list[tuple[str, object]] = json.loads(text, object_pairs_hook=lambda pairs: pairs)
|
|
83
|
+
except json.JSONDecodeError as exc:
|
|
84
|
+
raise ClientKeysFormatError("the value is not valid JSON") from exc
|
|
85
|
+
pairs: list[tuple[str, str]] = []
|
|
86
|
+
for position, (name, key) in enumerate(parsed, start=1):
|
|
87
|
+
if not isinstance(key, str):
|
|
88
|
+
raise ClientKeysFormatError(f"entry {position} has a value that is not a string")
|
|
89
|
+
pairs.append((name, key))
|
|
90
|
+
return pairs
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
def _comma_pairs(text: str) -> list[tuple[str, str]]:
|
|
94
|
+
if text.startswith("["):
|
|
95
|
+
raise ClientKeysFormatError("the JSON value is not an object")
|
|
96
|
+
pairs: list[tuple[str, str]] = []
|
|
97
|
+
for position, entry in enumerate(text.split(","), start=1):
|
|
98
|
+
if "=" not in entry:
|
|
99
|
+
raise ClientKeysFormatError(f"entry {position} has no '='")
|
|
100
|
+
name, key = entry.split("=", 1)
|
|
101
|
+
pairs.append((name, key))
|
|
102
|
+
return pairs
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
"""Which client keys an ``access/<slug>.*`` scope selects.
|
|
2
|
+
|
|
3
|
+
A slug is the text between ``access/`` and the trailing ``.*`` of the scope. It
|
|
4
|
+
selects the client whose name, stripped and casefolded, equals the stripped,
|
|
5
|
+
casefolded slug. One slug selects one key. A slug that matches no name is
|
|
6
|
+
unmapped; two names that casefold alike make the slug ambiguous, and an
|
|
7
|
+
ambiguous slug selects nothing (logged by slug only, never by key). The ``*``
|
|
8
|
+
slug is the wildcard and never selects a single key.
|
|
9
|
+
"""
|
|
10
|
+
|
|
11
|
+
import logging
|
|
12
|
+
from collections.abc import Callable, Mapping
|
|
13
|
+
from dataclasses import dataclass, field
|
|
14
|
+
from types import MappingProxyType
|
|
15
|
+
|
|
16
|
+
from oidcauthlib.authorization.scopes import normalize_scope
|
|
17
|
+
|
|
18
|
+
logger = logging.getLogger(__name__)
|
|
19
|
+
|
|
20
|
+
ACCESS_SCOPE_PREFIX = "access/"
|
|
21
|
+
ACCESS_SCOPE_SUFFIX = ".*"
|
|
22
|
+
# ``access/*.*``: every client in the mapping, honored only when a caller opts in.
|
|
23
|
+
WILDCARD_SLUG = "*"
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
def normalize_slug(*, slug: str) -> str:
|
|
27
|
+
"""Strip and casefold a slug or a client name so they compare equal."""
|
|
28
|
+
return normalize_scope(scope=slug)
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
def slug_from_access_scope(*, scope: str) -> str | None:
|
|
32
|
+
"""The slug of an ``access/<slug>.*`` scope, normalized; ``None`` for any other scope.
|
|
33
|
+
|
|
34
|
+
``access/tenant.*`` gives ``tenant`` and ``access/*.*`` gives ``*``. The suffix
|
|
35
|
+
must be exactly ``.*``: ``access/demo.read``, ``access/*.read``, ``access/demo``
|
|
36
|
+
and an empty slug (``access/.*``) all give ``None``.
|
|
37
|
+
|
|
38
|
+
Args:
|
|
39
|
+
scope: any scope string.
|
|
40
|
+
"""
|
|
41
|
+
normalized = normalize_scope(scope=scope)
|
|
42
|
+
if not normalized.startswith(ACCESS_SCOPE_PREFIX):
|
|
43
|
+
return None
|
|
44
|
+
if not normalized.endswith(ACCESS_SCOPE_SUFFIX):
|
|
45
|
+
return None
|
|
46
|
+
body = normalized[len(ACCESS_SCOPE_PREFIX) :]
|
|
47
|
+
slug = body[: -len(ACCESS_SCOPE_SUFFIX)].strip()
|
|
48
|
+
return slug or None
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
@dataclass(frozen=True)
|
|
52
|
+
class ClientSlugResolver:
|
|
53
|
+
"""Slug to its one client key, and every eligible client key.
|
|
54
|
+
|
|
55
|
+
``all_keys`` is what ``access/*.*`` selects when a caller opts in. It holds every
|
|
56
|
+
eligible client's key, including the keys of clients whose slug is ambiguous (which
|
|
57
|
+
``keys_for`` refuses one by one). Client keys identify tenants, so both fields stay
|
|
58
|
+
out of ``repr``.
|
|
59
|
+
"""
|
|
60
|
+
|
|
61
|
+
keys_by_slug: Mapping[str, str] = field(default_factory=lambda: MappingProxyType({}), repr=False)
|
|
62
|
+
all_keys: frozenset[str] = field(default=frozenset(), repr=False)
|
|
63
|
+
|
|
64
|
+
@classmethod
|
|
65
|
+
def from_client_keys(
|
|
66
|
+
cls,
|
|
67
|
+
*,
|
|
68
|
+
clients: Mapping[str, str],
|
|
69
|
+
is_eligible: Callable[[str, str], bool] | None = None,
|
|
70
|
+
) -> "ClientSlugResolver":
|
|
71
|
+
"""Build the resolver from a ``name -> key`` map.
|
|
72
|
+
|
|
73
|
+
Args:
|
|
74
|
+
clients: the client-key mapping. Entries with a blank name or key, or a
|
|
75
|
+
key that is not a string (for example a JSON ``null`` or number), are
|
|
76
|
+
skipped.
|
|
77
|
+
is_eligible: optional strategy ``(name, key) -> bool``. A client it
|
|
78
|
+
rejects is in neither ``keys_by_slug`` nor ``all_keys``, and does
|
|
79
|
+
not take part in ambiguity checks.
|
|
80
|
+
"""
|
|
81
|
+
keys_by_slug_candidates: dict[str, list[str]] = {}
|
|
82
|
+
for name, key in clients.items():
|
|
83
|
+
if not isinstance(key, str):
|
|
84
|
+
continue
|
|
85
|
+
slug = normalize_slug(slug=str(name))
|
|
86
|
+
clean_key = key.strip()
|
|
87
|
+
if not slug or not clean_key:
|
|
88
|
+
continue
|
|
89
|
+
if is_eligible is not None and not is_eligible(str(name), clean_key):
|
|
90
|
+
continue
|
|
91
|
+
keys_by_slug_candidates.setdefault(slug, []).append(clean_key)
|
|
92
|
+
keys_by_slug: dict[str, str] = {}
|
|
93
|
+
for slug, keys in keys_by_slug_candidates.items():
|
|
94
|
+
if slug == WILDCARD_SLUG:
|
|
95
|
+
continue
|
|
96
|
+
if len(keys) > 1:
|
|
97
|
+
logger.warning(
|
|
98
|
+
"Client names that casefold to %s are ambiguous; the access slug selects no client",
|
|
99
|
+
slug,
|
|
100
|
+
)
|
|
101
|
+
continue
|
|
102
|
+
keys_by_slug[slug] = keys[0]
|
|
103
|
+
return cls(
|
|
104
|
+
keys_by_slug=MappingProxyType(keys_by_slug),
|
|
105
|
+
all_keys=frozenset(key for keys in keys_by_slug_candidates.values() for key in keys),
|
|
106
|
+
)
|
|
107
|
+
|
|
108
|
+
def keys_for(self, *, slug: str) -> frozenset[str]:
|
|
109
|
+
"""The one key ``slug`` selects, or an empty set when it is unmapped or ambiguous."""
|
|
110
|
+
key = self.keys_by_slug.get(normalize_slug(slug=slug))
|
|
111
|
+
return frozenset() if key is None else frozenset({key})
|
|
112
|
+
|
|
113
|
+
def slugs_by_key(self, *, keys: frozenset[str]) -> Mapping[str, str]:
|
|
114
|
+
"""Each of ``keys`` that has an unambiguous slug, with that slug.
|
|
115
|
+
|
|
116
|
+
The slug is a bounded label that is safe to use in metrics and audit
|
|
117
|
+
records where the key itself must not appear.
|
|
118
|
+
"""
|
|
119
|
+
return MappingProxyType({key: slug for slug, key in self.keys_by_slug.items() if key in keys})
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
"""Startup validation of the reader-tier configuration.
|
|
2
|
+
|
|
3
|
+
When reader scopes are configured, the configuration must be one the resolver can
|
|
4
|
+
apply safely. Every refusal names the rule that failed, never a client name or key.
|
|
5
|
+
"""
|
|
6
|
+
|
|
7
|
+
from collections.abc import Sequence
|
|
8
|
+
|
|
9
|
+
from oidcauthlib.authorization.client_keys import (
|
|
10
|
+
ClientKeysFormatError,
|
|
11
|
+
parse_client_keys_strict,
|
|
12
|
+
)
|
|
13
|
+
from oidcauthlib.authorization.client_slugs import ACCESS_SCOPE_PREFIX, WILDCARD_SLUG
|
|
14
|
+
from oidcauthlib.authorization.scopes import PATIENT_SCOPE_PREFIX, normalize_scope
|
|
15
|
+
|
|
16
|
+
# Scopes every token carries; as a reader requirement they would admit everyone.
|
|
17
|
+
GENERIC_SCOPES = frozenset({"openid", "profile", "email", "groups"})
|
|
18
|
+
# A reader scope with this suffix would read like the all-tenants access scope.
|
|
19
|
+
WILDCARD_SCOPE_SUFFIX = "*.*"
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
class ReaderConfigurationError(ValueError):
|
|
23
|
+
"""The reader-tier configuration is unsafe to apply."""
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
def validate_reader_configuration(
|
|
27
|
+
*,
|
|
28
|
+
reader_scopes: Sequence[str],
|
|
29
|
+
admin_scopes: Sequence[str],
|
|
30
|
+
client_keys_raw: str,
|
|
31
|
+
) -> None:
|
|
32
|
+
"""Refuse an unsafe reader-tier configuration.
|
|
33
|
+
|
|
34
|
+
A blank or padded entry in either scope list is always refused, because scopes
|
|
35
|
+
match exactly and a blank requirement is satisfiable by a blank held scope. The
|
|
36
|
+
remaining checks are skipped when no reader scopes are set.
|
|
37
|
+
|
|
38
|
+
Args:
|
|
39
|
+
reader_scopes: the scopes that together grant the reader tier.
|
|
40
|
+
admin_scopes: the scopes that together grant the administrator tier.
|
|
41
|
+
client_keys_raw: the raw client-key mapping setting.
|
|
42
|
+
|
|
43
|
+
Raises:
|
|
44
|
+
ReaderConfigurationError: when either scope list has a blank entry or an
|
|
45
|
+
entry with surrounding whitespace; when reader scopes are set and the client-key
|
|
46
|
+
mapping fails the strict parser, is empty, or has a name containing
|
|
47
|
+
``*``; a reader scope overlaps an administrator scope, starts with
|
|
48
|
+
``access/`` or ``patient/``, is generic (``openid``, ``profile``,
|
|
49
|
+
``email``, ``groups``) or ends in ``*.*``; or any administrator scope
|
|
50
|
+
starts with ``access/`` (a reader holding ``access/*.*`` would then be
|
|
51
|
+
an administrator).
|
|
52
|
+
"""
|
|
53
|
+
for scopes in (reader_scopes, admin_scopes):
|
|
54
|
+
if any(scope != scope.strip() or not scope for scope in scopes):
|
|
55
|
+
raise ReaderConfigurationError("a scope is blank or has surrounding whitespace")
|
|
56
|
+
if not reader_scopes:
|
|
57
|
+
return
|
|
58
|
+
try:
|
|
59
|
+
clients = parse_client_keys_strict(raw=client_keys_raw)
|
|
60
|
+
except ClientKeysFormatError as exc:
|
|
61
|
+
raise ReaderConfigurationError(f"the client-key mapping is invalid: {exc}") from exc
|
|
62
|
+
if not clients:
|
|
63
|
+
raise ReaderConfigurationError("the client-key mapping is empty")
|
|
64
|
+
if any(WILDCARD_SLUG in name for name in clients):
|
|
65
|
+
raise ReaderConfigurationError(
|
|
66
|
+
f"a client name contains '{WILDCARD_SLUG}', which collides with the wildcard slug"
|
|
67
|
+
)
|
|
68
|
+
admin_normalized = {normalize_scope(scope=scope) for scope in admin_scopes}
|
|
69
|
+
for scope in reader_scopes:
|
|
70
|
+
normalized = normalize_scope(scope=scope)
|
|
71
|
+
if normalized in admin_normalized:
|
|
72
|
+
raise ReaderConfigurationError("a reader scope overlaps an administrator scope")
|
|
73
|
+
if normalized.startswith(ACCESS_SCOPE_PREFIX) or normalized.startswith(PATIENT_SCOPE_PREFIX):
|
|
74
|
+
raise ReaderConfigurationError(
|
|
75
|
+
f"a reader scope starts with '{ACCESS_SCOPE_PREFIX}' or '{PATIENT_SCOPE_PREFIX}'"
|
|
76
|
+
)
|
|
77
|
+
if normalized in GENERIC_SCOPES:
|
|
78
|
+
raise ReaderConfigurationError("a reader scope is a generic scope every token carries")
|
|
79
|
+
if normalized.endswith(WILDCARD_SCOPE_SUFFIX):
|
|
80
|
+
raise ReaderConfigurationError(f"a reader scope ends in '{WILDCARD_SCOPE_SUFFIX}'")
|
|
81
|
+
if any(normalize_scope(scope=scope).startswith(ACCESS_SCOPE_PREFIX) for scope in admin_scopes):
|
|
82
|
+
raise ReaderConfigurationError(
|
|
83
|
+
f"an administrator scope starts with '{ACCESS_SCOPE_PREFIX}': "
|
|
84
|
+
"a reader holding the wildcard access scope would be an administrator"
|
|
85
|
+
)
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"""Scope predicates: the patient deny and the all-of match on required scopes."""
|
|
2
|
+
|
|
3
|
+
from collections.abc import Collection, Iterable
|
|
4
|
+
|
|
5
|
+
# A token carrying any patient-scoped grant is a patient or patient-app token and
|
|
6
|
+
# is never an administrator, even if it also holds an administrator scope. The
|
|
7
|
+
# check is a prefix match on the trimmed, casefolded scope, so ``Patient/*.read``
|
|
8
|
+
# matches but ``Patient.read`` (no slash) does not.
|
|
9
|
+
PATIENT_SCOPE_PREFIX = "patient/"
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
def normalize_scope(*, scope: str) -> str:
|
|
13
|
+
"""Strip and casefold a scope so scopes that differ only by padding or case compare equal."""
|
|
14
|
+
return scope.strip().casefold()
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
def has_blank_scope(*, scopes: Iterable[str]) -> bool:
|
|
18
|
+
"""True when any scope is empty or whitespace only.
|
|
19
|
+
|
|
20
|
+
A blank required scope, for example the ``[""]`` that ``"".split(",")`` gives for an
|
|
21
|
+
unset setting, is satisfied by any held scope list that contains ``""`` (a token
|
|
22
|
+
scope claim split on single spaces with a double or trailing space does). Callers
|
|
23
|
+
treat a requirement list with a blank entry as unsatisfiable.
|
|
24
|
+
"""
|
|
25
|
+
return any(not scope.strip() for scope in scopes)
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
def has_patient_scope(*, scopes: Iterable[str]) -> bool:
|
|
29
|
+
"""True when any scope starts with ``patient/`` (trimmed, case-insensitive)."""
|
|
30
|
+
return any(normalize_scope(scope=scope).startswith(PATIENT_SCOPE_PREFIX) for scope in scopes)
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
def has_admin_scopes(*, scopes: Iterable[str], required_scopes: Collection[str]) -> bool:
|
|
34
|
+
"""True when ``scopes`` holds every required scope exactly and no ``patient/`` scope.
|
|
35
|
+
|
|
36
|
+
An empty ``required_scopes`` is always False: ``set().issubset(anything)`` is
|
|
37
|
+
True, so an empty requirement (for example an unset setting) would otherwise
|
|
38
|
+
admit every verified token. A requirement list with a blank entry is False for
|
|
39
|
+
the same reason (see ``has_blank_scope``). This is the one check every
|
|
40
|
+
administrator path applies to the merged scope set.
|
|
41
|
+
|
|
42
|
+
Args:
|
|
43
|
+
scopes: the scopes the caller holds.
|
|
44
|
+
required_scopes: every one of these must be held, matched exactly.
|
|
45
|
+
"""
|
|
46
|
+
if not required_scopes or has_blank_scope(scopes=required_scopes):
|
|
47
|
+
return False
|
|
48
|
+
held = set(scopes)
|
|
49
|
+
if has_patient_scope(scopes=held):
|
|
50
|
+
return False
|
|
51
|
+
return set(required_scopes).issubset(held)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: oidcauthlib
|
|
3
|
-
Version: 3.
|
|
3
|
+
Version: 3.1.1
|
|
4
4
|
Summary: oidcauthlib
|
|
5
5
|
Author-email: Imran Qureshi <imran.qureshi@bwell.com>
|
|
6
6
|
License: Apache-2.0
|
|
@@ -69,3 +69,61 @@ scopes = await manager.get_scopes_from_user_info_async(access_token=token)
|
|
|
69
69
|
malformed entry is logged and treated as a miss, and the refetched scopes overwrite the bad entry. A
|
|
70
70
|
userinfo HTTP error, a missing provider or a mismatched subject is raised, so each service decides whether
|
|
71
71
|
to fail closed or degrade.
|
|
72
|
+
|
|
73
|
+
## Administrator and tenant-reader tiers (`oidcauthlib.authorization`)
|
|
74
|
+
|
|
75
|
+
Pure helpers that turn a caller's merged scopes (for example the result of `OidcUserInfoManager`) into a
|
|
76
|
+
tier: `admin` (unrestricted), `reader` (limited to the client keys its `access/<slug>.*` scopes select), or
|
|
77
|
+
denied. The subpackage reads no environment variable, does no I/O and imports nothing else from
|
|
78
|
+
`oidcauthlib`; the caller verifies the token, looks up the user and passes the configuration in. The
|
|
79
|
+
`access/<slug>.*` and `patient/` scope convention is the FHIR server's, described in its
|
|
80
|
+
[security guide](https://github.com/icanbwell/fhir-server/blob/main/readme/security.md) (section 5); the tier
|
|
81
|
+
model is recorded in [ADR 0001](adrs/0001-authorization-tiers-from-scopes.md).
|
|
82
|
+
|
|
83
|
+
```python
|
|
84
|
+
from oidcauthlib.authorization import (
|
|
85
|
+
ClientSlugResolver,
|
|
86
|
+
parse_client_keys_lenient,
|
|
87
|
+
resolve_admin_access,
|
|
88
|
+
validate_reader_configuration,
|
|
89
|
+
)
|
|
90
|
+
|
|
91
|
+
RAW_CLIENTS = "One=key-1,Two=key-2" # the setting that holds the client-key mapping
|
|
92
|
+
|
|
93
|
+
# At startup: refuse an unsafe configuration (a no-op when no reader scopes are set).
|
|
94
|
+
validate_reader_configuration(
|
|
95
|
+
reader_scopes=["example/reader"],
|
|
96
|
+
admin_scopes=["example/admin"],
|
|
97
|
+
client_keys_raw=RAW_CLIENTS,
|
|
98
|
+
)
|
|
99
|
+
|
|
100
|
+
clients = ClientSlugResolver.from_client_keys(clients=parse_client_keys_lenient(raw=RAW_CLIENTS))
|
|
101
|
+
access = resolve_admin_access(
|
|
102
|
+
scopes=["example/reader", "access/one.*"],
|
|
103
|
+
admin_scopes=["example/admin"],
|
|
104
|
+
reader_scopes=["example/reader"],
|
|
105
|
+
clients=clients,
|
|
106
|
+
allow_all_tenants=False,
|
|
107
|
+
)
|
|
108
|
+
# access.tier is AdminTier.READER and access.allowed_client_keys == frozenset({"key-1"})
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
- **Order:** any `patient/` scope (trimmed, case-insensitive) denies first; then holding every admin scope
|
|
112
|
+
gives `admin`; then every reader scope plus at least one `access/<slug>.*` that selects a client gives
|
|
113
|
+
`reader`; anything else is denied with a `DenialReason`. An empty admin or reader requirement admits nobody.
|
|
114
|
+
- **Slugs:** `access/<slug>.*` selects the client whose name, stripped and casefolded, equals the slug. Two
|
|
115
|
+
names that casefold alike make the slug ambiguous and it selects nothing. The suffix must be exactly `.*`.
|
|
116
|
+
`access/*.*` selects every client only when `allow_all_tenants=True`, including a client whose own slug is
|
|
117
|
+
ambiguous. An ambiguous slug is logged by slug only, through the standard `logging` module (the package
|
|
118
|
+
configures no logger of its own).
|
|
119
|
+
- **Blank scopes:** an admin or reader scope list that is empty, or has a blank entry, admits nobody, and
|
|
120
|
+
`validate_reader_configuration` refuses a blank or padded entry in either list.
|
|
121
|
+
- **No default for "all tenants":** `allowed_client_keys` is `None` only for `admin`. A reader always has a
|
|
122
|
+
non-empty set and a denied caller always has `frozenset()`, so a denial can never be read as unrestricted.
|
|
123
|
+
`AdminAccess` enforces this when it is constructed.
|
|
124
|
+
- **Client-key mapping:** a `name -> key` map given as a JSON object or `One=key-1,Two=key-2`.
|
|
125
|
+
`parse_client_keys_lenient` keeps the permissive behavior (a malformed JSON object falls back to comma
|
|
126
|
+
parsing, an entry without `=` is dropped); `parse_client_keys_strict` refuses both, and refuses blank or
|
|
127
|
+
repeated names. Error messages name the rule, never a name or key.
|
|
128
|
+
- **Eligibility:** `from_client_keys(..., is_eligible=...)` takes a `(name, key) -> bool` strategy for
|
|
129
|
+
callers that exclude some clients; an excluded client is in no view and takes no part in ambiguity.
|
|
@@ -57,6 +57,12 @@ oidcauthlib/auth/well_known_configuration/auth_server_metadata_discovery.py
|
|
|
57
57
|
oidcauthlib/auth/well_known_configuration/well_known_configuration_cache.py
|
|
58
58
|
oidcauthlib/auth/well_known_configuration/well_known_configuration_cache_result.py
|
|
59
59
|
oidcauthlib/auth/well_known_configuration/well_known_configuration_manager.py
|
|
60
|
+
oidcauthlib/authorization/__init__.py
|
|
61
|
+
oidcauthlib/authorization/admin_access.py
|
|
62
|
+
oidcauthlib/authorization/client_keys.py
|
|
63
|
+
oidcauthlib/authorization/client_slugs.py
|
|
64
|
+
oidcauthlib/authorization/reader_configuration.py
|
|
65
|
+
oidcauthlib/authorization/scopes.py
|
|
60
66
|
oidcauthlib/cache_gate/__init__.py
|
|
61
67
|
oidcauthlib/cache_gate/advisory_lock.py
|
|
62
68
|
oidcauthlib/cache_gate/version_gate.py
|
oidcauthlib-3.0.30/README.md
DELETED
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
# oidcauthlib
|
|
2
|
-
|
|
3
|
-
## OIDC userinfo scopes (`OidcUserInfoManager`)
|
|
4
|
-
|
|
5
|
-
Some providers (e.g. Okta employee access tokens) only carry `openid profile email groups` in the JWT;
|
|
6
|
-
the scopes that authorize a caller appear only on the OIDC userinfo response.
|
|
7
|
-
`oidcauthlib.auth.userinfo.oidc_userinfo_manager.OidcUserInfoManager` resolves a token's effective
|
|
8
|
-
scopes from the token's own claims plus the userinfo endpoint, and caches the userinfo-derived scopes in
|
|
9
|
-
a key-value store.
|
|
10
|
-
|
|
11
|
-
```python
|
|
12
|
-
manager = OidcUserInfoManager(
|
|
13
|
-
auth_config_reader=auth_config_reader,
|
|
14
|
-
well_known_configuration_manager=well_known_configuration_manager,
|
|
15
|
-
store=store, # py-key-value-aio store; yours, not shared with other services
|
|
16
|
-
cache_collection="oidc-user-info-cache",
|
|
17
|
-
cache_ttl_seconds=86400,
|
|
18
|
-
fetch_timeout_seconds=30,
|
|
19
|
-
scope_claims=["custom:scope"], # optional extra claims holding scopes
|
|
20
|
-
group_claims=["groups"], # optional claims holding group names, used whole as scopes
|
|
21
|
-
scope_remove_prefixes=["fhir/prod/"],
|
|
22
|
-
)
|
|
23
|
-
scopes = await manager.get_scopes_from_user_info_async(access_token=token)
|
|
24
|
-
```
|
|
25
|
-
|
|
26
|
-
- **Scope derivation** follows fhir-server-ui's `jwtParser`: the `scope` claim (plus `scp`), then
|
|
27
|
-
`scope_claims`, then `group_claims` (each value taken whole). Commas separate like spaces, results are
|
|
28
|
-
de-duplicated, and `scope_remove_prefixes` are stripped (first match wins). Nothing beyond `scope`/`scp`
|
|
29
|
-
is read unless configured.
|
|
30
|
-
- **Provider** is matched to the token's `iss`: an exact `issuer`, else a `well_known_uri` on the same scheme,
|
|
31
|
-
host and port whose path segments start with the issuer's. Only a token with no `iss` at all is matched by
|
|
32
|
-
its client id. A token matching no provider raises `ValueError`; it is never sent to another provider.
|
|
33
|
-
- **Subject check:** for a token that has a `sub`, the userinfo response must carry the same `sub`
|
|
34
|
-
(OIDC Core 5.3.2); a missing or different one raises `ValueError` and nothing is cached.
|
|
35
|
-
- **Cache** key is `oidc-userinfo-scopes:<issuer>:<client_id>:<sub>|v1` with each segment percent-encoded
|
|
36
|
-
(so values containing `:` cannot collide, and two providers never share an entry); only the
|
|
37
|
-
userinfo-derived scopes are stored, never the userinfo response. The token's own scopes are re-derived on every call. A token without
|
|
38
|
-
`sub` or without an issuer, or an empty scope list, is not cached. Changes to a user's entitlements are visible after at most
|
|
39
|
-
`cache_ttl_seconds`.
|
|
40
|
-
- **Failures:** the cache never fails a lookup. A write failure is logged and swallowed; a read failure or a
|
|
41
|
-
malformed entry is logged and treated as a miss, and the refetched scopes overwrite the bad entry. A
|
|
42
|
-
userinfo HTTP error, a missing provider or a mismatched subject is raised, so each service decides whether
|
|
43
|
-
to fail closed or degrade.
|
oidcauthlib-3.0.30/VERSION
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
3.0.30
|
|
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
|
{oidcauthlib-3.0.30 → oidcauthlib-3.1.1}/oidcauthlib/auth/middleware/request_scope_middleware.py
RENAMED
|
File without changes
|
{oidcauthlib-3.0.30 → oidcauthlib-3.1.1}/oidcauthlib/auth/middleware/token_reader_middleware.py
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
|
{oidcauthlib-3.0.30 → oidcauthlib-3.1.1}/oidcauthlib/auth/repository/memory/memory_repository.py
RENAMED
|
File without changes
|
|
File without changes
|
{oidcauthlib-3.0.30 → oidcauthlib-3.1.1}/oidcauthlib/auth/repository/mongo/mongo_repository.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{oidcauthlib-3.0.30 → oidcauthlib-3.1.1}/oidcauthlib/auth/well_known_configuration/__init__.py
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
|
{oidcauthlib-3.0.30 → oidcauthlib-3.1.1}/oidcauthlib/container/oidc_authlib_container_factory.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{oidcauthlib-3.0.30 → oidcauthlib-3.1.1}/oidcauthlib/open_telemetry/filtering_span_exporter.py
RENAMED
|
File without changes
|
{oidcauthlib-3.0.30 → oidcauthlib-3.1.1}/oidcauthlib/open_telemetry/filtering_span_processor.py
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
|