oidcauthlib 3.0.23__tar.gz → 3.0.24__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.23/oidcauthlib.egg-info → oidcauthlib-3.0.24}/PKG-INFO +3 -3
- {oidcauthlib-3.0.23 → oidcauthlib-3.0.24}/README.md +2 -2
- oidcauthlib-3.0.24/VERSION +1 -0
- {oidcauthlib-3.0.23 → oidcauthlib-3.0.24}/oidcauthlib/auth/userinfo/oidc_userinfo_manager.py +11 -10
- {oidcauthlib-3.0.23 → oidcauthlib-3.0.24/oidcauthlib.egg-info}/PKG-INFO +3 -3
- oidcauthlib-3.0.23/VERSION +0 -1
- {oidcauthlib-3.0.23 → oidcauthlib-3.0.24}/LICENSE +0 -0
- {oidcauthlib-3.0.23 → oidcauthlib-3.0.24}/MANIFEST.in +0 -0
- {oidcauthlib-3.0.23 → oidcauthlib-3.0.24}/oidcauthlib/__init__.py +0 -0
- {oidcauthlib-3.0.23 → oidcauthlib-3.0.24}/oidcauthlib/auth/__init__.py +0 -0
- {oidcauthlib-3.0.23 → oidcauthlib-3.0.24}/oidcauthlib/auth/auth_helper.py +0 -0
- {oidcauthlib-3.0.23 → oidcauthlib-3.0.24}/oidcauthlib/auth/auth_manager.py +0 -0
- {oidcauthlib-3.0.23 → oidcauthlib-3.0.24}/oidcauthlib/auth/cache/__init__.py +0 -0
- {oidcauthlib-3.0.23 → oidcauthlib-3.0.24}/oidcauthlib/auth/cache/oauth_cache.py +0 -0
- {oidcauthlib-3.0.23 → oidcauthlib-3.0.24}/oidcauthlib/auth/cache/oauth_memory_cache.py +0 -0
- {oidcauthlib-3.0.23 → oidcauthlib-3.0.24}/oidcauthlib/auth/cache/oauth_mongo_cache.py +0 -0
- {oidcauthlib-3.0.23 → oidcauthlib-3.0.24}/oidcauthlib/auth/config/__init__.py +0 -0
- {oidcauthlib-3.0.23 → oidcauthlib-3.0.24}/oidcauthlib/auth/config/auth_config.py +0 -0
- {oidcauthlib-3.0.23 → oidcauthlib-3.0.24}/oidcauthlib/auth/config/auth_config_reader.py +0 -0
- {oidcauthlib-3.0.23 → oidcauthlib-3.0.24}/oidcauthlib/auth/dcr/__init__.py +0 -0
- {oidcauthlib-3.0.23 → oidcauthlib-3.0.24}/oidcauthlib/auth/dcr/dcr_client.py +0 -0
- {oidcauthlib-3.0.23 → oidcauthlib-3.0.24}/oidcauthlib/auth/dcr/dcr_manager.py +0 -0
- {oidcauthlib-3.0.23 → oidcauthlib-3.0.24}/oidcauthlib/auth/dcr/dcr_registration.py +0 -0
- {oidcauthlib-3.0.23 → oidcauthlib-3.0.24}/oidcauthlib/auth/exceptions/__init__.py +0 -0
- {oidcauthlib-3.0.23 → oidcauthlib-3.0.24}/oidcauthlib/auth/exceptions/authorization_bearer_token_expired_exception.py +0 -0
- {oidcauthlib-3.0.23 → oidcauthlib-3.0.24}/oidcauthlib/auth/exceptions/authorization_bearer_token_invalid_exception.py +0 -0
- {oidcauthlib-3.0.23 → oidcauthlib-3.0.24}/oidcauthlib/auth/exceptions/authorization_bearer_token_missing_exception.py +0 -0
- {oidcauthlib-3.0.23 → oidcauthlib-3.0.24}/oidcauthlib/auth/exceptions/authorization_needed_exception.py +0 -0
- {oidcauthlib-3.0.23 → oidcauthlib-3.0.24}/oidcauthlib/auth/fastapi_auth_manager.py +0 -0
- {oidcauthlib-3.0.23 → oidcauthlib-3.0.24}/oidcauthlib/auth/middleware/__init__.py +0 -0
- {oidcauthlib-3.0.23 → oidcauthlib-3.0.24}/oidcauthlib/auth/middleware/request_scope_middleware.py +0 -0
- {oidcauthlib-3.0.23 → oidcauthlib-3.0.24}/oidcauthlib/auth/middleware/token_reader_middleware.py +0 -0
- {oidcauthlib-3.0.23 → oidcauthlib-3.0.24}/oidcauthlib/auth/models/__init__.py +0 -0
- {oidcauthlib-3.0.23 → oidcauthlib-3.0.24}/oidcauthlib/auth/models/auth.py +0 -0
- {oidcauthlib-3.0.23 → oidcauthlib-3.0.24}/oidcauthlib/auth/models/base_db_model.py +0 -0
- {oidcauthlib-3.0.23 → oidcauthlib-3.0.24}/oidcauthlib/auth/models/cache_item.py +0 -0
- {oidcauthlib-3.0.23 → oidcauthlib-3.0.24}/oidcauthlib/auth/models/client_key_set.py +0 -0
- {oidcauthlib-3.0.23 → oidcauthlib-3.0.24}/oidcauthlib/auth/models/token.py +0 -0
- {oidcauthlib-3.0.23 → oidcauthlib-3.0.24}/oidcauthlib/auth/repository/__init__.py +0 -0
- {oidcauthlib-3.0.23 → oidcauthlib-3.0.24}/oidcauthlib/auth/repository/base_repository.py +0 -0
- {oidcauthlib-3.0.23 → oidcauthlib-3.0.24}/oidcauthlib/auth/repository/memory/__init__.py +0 -0
- {oidcauthlib-3.0.23 → oidcauthlib-3.0.24}/oidcauthlib/auth/repository/memory/memory_repository.py +0 -0
- {oidcauthlib-3.0.23 → oidcauthlib-3.0.24}/oidcauthlib/auth/repository/mongo/__init__.py +0 -0
- {oidcauthlib-3.0.23 → oidcauthlib-3.0.24}/oidcauthlib/auth/repository/mongo/mongo_repository.py +0 -0
- {oidcauthlib-3.0.23 → oidcauthlib-3.0.24}/oidcauthlib/auth/repository/repository_factory.py +0 -0
- {oidcauthlib-3.0.23 → oidcauthlib-3.0.24}/oidcauthlib/auth/routers/__init__.py +0 -0
- {oidcauthlib-3.0.23 → oidcauthlib-3.0.24}/oidcauthlib/auth/routers/auth_router.py +0 -0
- {oidcauthlib-3.0.23 → oidcauthlib-3.0.24}/oidcauthlib/auth/token_reader.py +0 -0
- {oidcauthlib-3.0.23 → oidcauthlib-3.0.24}/oidcauthlib/auth/userinfo/__init__.py +0 -0
- {oidcauthlib-3.0.23 → oidcauthlib-3.0.24}/oidcauthlib/auth/well_known_configuration/__init__.py +0 -0
- {oidcauthlib-3.0.23 → oidcauthlib-3.0.24}/oidcauthlib/auth/well_known_configuration/auth_server_metadata.py +0 -0
- {oidcauthlib-3.0.23 → oidcauthlib-3.0.24}/oidcauthlib/auth/well_known_configuration/auth_server_metadata_discovery.py +0 -0
- {oidcauthlib-3.0.23 → oidcauthlib-3.0.24}/oidcauthlib/auth/well_known_configuration/well_known_configuration_cache.py +0 -0
- {oidcauthlib-3.0.23 → oidcauthlib-3.0.24}/oidcauthlib/auth/well_known_configuration/well_known_configuration_cache_result.py +0 -0
- {oidcauthlib-3.0.23 → oidcauthlib-3.0.24}/oidcauthlib/auth/well_known_configuration/well_known_configuration_manager.py +0 -0
- {oidcauthlib-3.0.23 → oidcauthlib-3.0.24}/oidcauthlib/cache_gate/__init__.py +0 -0
- {oidcauthlib-3.0.23 → oidcauthlib-3.0.24}/oidcauthlib/cache_gate/advisory_lock.py +0 -0
- {oidcauthlib-3.0.23 → oidcauthlib-3.0.24}/oidcauthlib/cache_gate/version_gate.py +0 -0
- {oidcauthlib-3.0.23 → oidcauthlib-3.0.24}/oidcauthlib/container/__init__.py +0 -0
- {oidcauthlib-3.0.23 → oidcauthlib-3.0.24}/oidcauthlib/container/oidc_authlib_container_factory.py +0 -0
- {oidcauthlib-3.0.23 → oidcauthlib-3.0.24}/oidcauthlib/open_telemetry/__init__.py +0 -0
- {oidcauthlib-3.0.23 → oidcauthlib-3.0.24}/oidcauthlib/open_telemetry/attribute_names.py +0 -0
- {oidcauthlib-3.0.23 → oidcauthlib-3.0.24}/oidcauthlib/open_telemetry/configurator.py +0 -0
- {oidcauthlib-3.0.23 → oidcauthlib-3.0.24}/oidcauthlib/open_telemetry/filtering_sampler.py +0 -0
- {oidcauthlib-3.0.23 → oidcauthlib-3.0.24}/oidcauthlib/open_telemetry/filtering_span_exporter.py +0 -0
- {oidcauthlib-3.0.23 → oidcauthlib-3.0.24}/oidcauthlib/open_telemetry/filtering_span_processor.py +0 -0
- {oidcauthlib-3.0.23 → oidcauthlib-3.0.24}/oidcauthlib/open_telemetry/otel_setup.py +0 -0
- {oidcauthlib-3.0.23 → oidcauthlib-3.0.24}/oidcauthlib/open_telemetry/span_names.py +0 -0
- {oidcauthlib-3.0.23 → oidcauthlib-3.0.24}/oidcauthlib/py.typed +0 -0
- {oidcauthlib-3.0.23 → oidcauthlib-3.0.24}/oidcauthlib/storage/__init__.py +0 -0
- {oidcauthlib-3.0.23 → oidcauthlib-3.0.24}/oidcauthlib/storage/cache_to_collection_mapper.py +0 -0
- {oidcauthlib-3.0.23 → oidcauthlib-3.0.24}/oidcauthlib/storage/memory_storage_factory.py +0 -0
- {oidcauthlib-3.0.23 → oidcauthlib-3.0.24}/oidcauthlib/storage/mongo_gridfs_db.py +0 -0
- {oidcauthlib-3.0.23 → oidcauthlib-3.0.24}/oidcauthlib/storage/mongo_gridfs_exception.py +0 -0
- {oidcauthlib-3.0.23 → oidcauthlib-3.0.24}/oidcauthlib/storage/mongo_storage_factory.py +0 -0
- {oidcauthlib-3.0.23 → oidcauthlib-3.0.24}/oidcauthlib/storage/storage_factory.py +0 -0
- {oidcauthlib-3.0.23 → oidcauthlib-3.0.24}/oidcauthlib/storage/storage_factory_creator.py +0 -0
- {oidcauthlib-3.0.23 → oidcauthlib-3.0.24}/oidcauthlib/utilities/__init__.py +0 -0
- {oidcauthlib-3.0.23 → oidcauthlib-3.0.24}/oidcauthlib/utilities/cached.py +0 -0
- {oidcauthlib-3.0.23 → oidcauthlib-3.0.24}/oidcauthlib/utilities/environment/__init__.py +0 -0
- {oidcauthlib-3.0.23 → oidcauthlib-3.0.24}/oidcauthlib/utilities/environment/abstract_environment_variables.py +0 -0
- {oidcauthlib-3.0.23 → oidcauthlib-3.0.24}/oidcauthlib/utilities/environment/oidc_environment_variables.py +0 -0
- {oidcauthlib-3.0.23 → oidcauthlib-3.0.24}/oidcauthlib/utilities/logger/__init__.py +0 -0
- {oidcauthlib-3.0.23 → oidcauthlib-3.0.24}/oidcauthlib/utilities/logger/log_levels.py +0 -0
- {oidcauthlib-3.0.23 → oidcauthlib-3.0.24}/oidcauthlib/utilities/logger/logging_response.py +0 -0
- {oidcauthlib-3.0.23 → oidcauthlib-3.0.24}/oidcauthlib/utilities/logger/logging_transport.py +0 -0
- {oidcauthlib-3.0.23 → oidcauthlib-3.0.24}/oidcauthlib/utilities/mongo_url_utils.py +0 -0
- {oidcauthlib-3.0.23 → oidcauthlib-3.0.24}/oidcauthlib/utilities/url_validator.py +0 -0
- {oidcauthlib-3.0.23 → oidcauthlib-3.0.24}/oidcauthlib.egg-info/SOURCES.txt +0 -0
- {oidcauthlib-3.0.23 → oidcauthlib-3.0.24}/oidcauthlib.egg-info/dependency_links.txt +0 -0
- {oidcauthlib-3.0.23 → oidcauthlib-3.0.24}/oidcauthlib.egg-info/requires.txt +0 -0
- {oidcauthlib-3.0.23 → oidcauthlib-3.0.24}/oidcauthlib.egg-info/top_level.txt +0 -0
- {oidcauthlib-3.0.23 → oidcauthlib-3.0.24}/pyproject.toml +0 -0
- {oidcauthlib-3.0.23 → oidcauthlib-3.0.24}/setup.cfg +0 -0
- {oidcauthlib-3.0.23 → oidcauthlib-3.0.24}/tests/test_mongo_url_utils.py +0 -0
- {oidcauthlib-3.0.23 → oidcauthlib-3.0.24}/tests/test_simple.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: oidcauthlib
|
|
3
|
-
Version: 3.0.
|
|
3
|
+
Version: 3.0.24
|
|
4
4
|
Summary: oidcauthlib
|
|
5
5
|
Author-email: Imran Qureshi <imran.qureshi@bwell.com>
|
|
6
6
|
License: Apache-2.0
|
|
@@ -58,8 +58,8 @@ scopes = await manager.get_scopes_from_user_info_async(access_token=token)
|
|
|
58
58
|
- **Provider** is matched to the token's `iss`: an exact `issuer`, else a `well_known_uri` on the same scheme,
|
|
59
59
|
host and port whose path segments start with the issuer's. Only a token with no `iss` at all is matched by
|
|
60
60
|
its client id. A token matching no provider raises `ValueError`; it is never sent to another provider.
|
|
61
|
-
- **Subject check:** the userinfo response
|
|
62
|
-
|
|
61
|
+
- **Subject check:** for a token that has a `sub`, the userinfo response must carry the same `sub`
|
|
62
|
+
(OIDC Core 5.3.2); a missing or different one raises `ValueError` and nothing is cached.
|
|
63
63
|
- **Cache** key is `oidc-userinfo-scopes:<issuer>:<client_id>:<sub>|v1` with each segment percent-encoded
|
|
64
64
|
(so values containing `:` cannot collide, and two providers never share an entry); only the
|
|
65
65
|
userinfo-derived scopes are stored, never the userinfo response. The token's own scopes are re-derived on every call. A token without
|
|
@@ -30,8 +30,8 @@ scopes = await manager.get_scopes_from_user_info_async(access_token=token)
|
|
|
30
30
|
- **Provider** is matched to the token's `iss`: an exact `issuer`, else a `well_known_uri` on the same scheme,
|
|
31
31
|
host and port whose path segments start with the issuer's. Only a token with no `iss` at all is matched by
|
|
32
32
|
its client id. A token matching no provider raises `ValueError`; it is never sent to another provider.
|
|
33
|
-
- **Subject check:** the userinfo response
|
|
34
|
-
|
|
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
35
|
- **Cache** key is `oidc-userinfo-scopes:<issuer>:<client_id>:<sub>|v1` with each segment percent-encoded
|
|
36
36
|
(so values containing `:` cannot collide, and two providers never share an entry); only the
|
|
37
37
|
userinfo-derived scopes are stored, never the userinfo response. The token's own scopes are re-derived on every call. A token without
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
3.0.24
|
{oidcauthlib-3.0.23 → oidcauthlib-3.0.24}/oidcauthlib/auth/userinfo/oidc_userinfo_manager.py
RENAMED
|
@@ -43,8 +43,8 @@ class OidcUserInfoManager:
|
|
|
43
43
|
same scheme, host and port whose path segments start with the issuer's). Only a token with no ``iss`` at
|
|
44
44
|
all is matched by its client id. A token matching no provider is an error: the bearer token is never
|
|
45
45
|
sent to an unrelated provider.
|
|
46
|
-
-
|
|
47
|
-
and nothing is cached.
|
|
46
|
+
- For a token that has a ``sub``, the userinfo response must carry the same ``sub`` (OIDC Core 5.3.2); a
|
|
47
|
+
missing or different one fails the lookup and nothing is cached.
|
|
48
48
|
- The userinfo endpoint is discovered through ``WellKnownConfigurationManager``.
|
|
49
49
|
- Scopes are derived the way fhir-server-ui's ``jwtParser`` does: the ``scope`` claim (plus ``scp``,
|
|
50
50
|
which Okta uses), the claims named in ``scope_claims``, and each claim named in ``group_claims``
|
|
@@ -184,12 +184,13 @@ class OidcUserInfoManager:
|
|
|
184
184
|
|
|
185
185
|
``access_token`` must already have been verified by the caller; its claims are trusted.
|
|
186
186
|
|
|
187
|
-
Per OIDC Core 5.3.2 the response
|
|
188
|
-
different
|
|
187
|
+
Per OIDC Core 5.3.2 the response must carry a ``sub`` equal to the token's ``sub``; a response without
|
|
188
|
+
one, or with a different one, cannot be shown to describe the token's user and is rejected. A token
|
|
189
|
+
that has no ``sub`` has nothing to compare, so its response is accepted (and never cached).
|
|
189
190
|
|
|
190
191
|
Raises:
|
|
191
|
-
ValueError: the token, auth config, discovery document or response is unusable, or the response
|
|
192
|
-
is
|
|
192
|
+
ValueError: the token, auth config, discovery document or response is unusable, or the response's
|
|
193
|
+
subject is missing or differs from the token's.
|
|
193
194
|
httpx.HTTPError: the userinfo request failed.
|
|
194
195
|
"""
|
|
195
196
|
if not access_token.token:
|
|
@@ -221,10 +222,10 @@ class OidcUserInfoManager:
|
|
|
221
222
|
user_info = response.json()
|
|
222
223
|
if not isinstance(user_info, dict):
|
|
223
224
|
raise ValueError("User info response is not a valid JSON object")
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
#
|
|
227
|
-
raise ValueError("User info response is
|
|
225
|
+
if access_token.subject and user_info.get("sub") != access_token.subject:
|
|
226
|
+
# Missing or different: ``sub`` is required in the response, and one that cannot be shown
|
|
227
|
+
# to be the token's subject must not be turned into scopes. Neither subject is logged.
|
|
228
|
+
raise ValueError("User info response subject is missing or differs from the token's subject")
|
|
228
229
|
return user_info
|
|
229
230
|
|
|
230
231
|
async def get_scopes_from_user_info_async(self, *, access_token: Token) -> list[str]:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: oidcauthlib
|
|
3
|
-
Version: 3.0.
|
|
3
|
+
Version: 3.0.24
|
|
4
4
|
Summary: oidcauthlib
|
|
5
5
|
Author-email: Imran Qureshi <imran.qureshi@bwell.com>
|
|
6
6
|
License: Apache-2.0
|
|
@@ -58,8 +58,8 @@ scopes = await manager.get_scopes_from_user_info_async(access_token=token)
|
|
|
58
58
|
- **Provider** is matched to the token's `iss`: an exact `issuer`, else a `well_known_uri` on the same scheme,
|
|
59
59
|
host and port whose path segments start with the issuer's. Only a token with no `iss` at all is matched by
|
|
60
60
|
its client id. A token matching no provider raises `ValueError`; it is never sent to another provider.
|
|
61
|
-
- **Subject check:** the userinfo response
|
|
62
|
-
|
|
61
|
+
- **Subject check:** for a token that has a `sub`, the userinfo response must carry the same `sub`
|
|
62
|
+
(OIDC Core 5.3.2); a missing or different one raises `ValueError` and nothing is cached.
|
|
63
63
|
- **Cache** key is `oidc-userinfo-scopes:<issuer>:<client_id>:<sub>|v1` with each segment percent-encoded
|
|
64
64
|
(so values containing `:` cannot collide, and two providers never share an entry); only the
|
|
65
65
|
userinfo-derived scopes are stored, never the userinfo response. The token's own scopes are re-derived on every call. A token without
|
oidcauthlib-3.0.23/VERSION
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
3.0.23
|
|
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.23 → oidcauthlib-3.0.24}/oidcauthlib/auth/middleware/request_scope_middleware.py
RENAMED
|
File without changes
|
{oidcauthlib-3.0.23 → oidcauthlib-3.0.24}/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.23 → oidcauthlib-3.0.24}/oidcauthlib/auth/repository/memory/memory_repository.py
RENAMED
|
File without changes
|
|
File without changes
|
{oidcauthlib-3.0.23 → oidcauthlib-3.0.24}/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
|
{oidcauthlib-3.0.23 → oidcauthlib-3.0.24}/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.23 → oidcauthlib-3.0.24}/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.23 → oidcauthlib-3.0.24}/oidcauthlib/open_telemetry/filtering_span_exporter.py
RENAMED
|
File without changes
|
{oidcauthlib-3.0.23 → oidcauthlib-3.0.24}/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
|
|
File without changes
|