xtr-security-http 6.8.1__tar.gz → 7.0.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.
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/PKG-INFO +47 -33
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/README.md +30 -11
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/pyproject.toml +28 -33
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/pyproject.toml.orig +28 -33
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/_form_content_type.py +4 -1
- xtr_security_http-7.0.0/src/xtr_security_http/_text.py +18 -0
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/access_map.py +1 -3
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/access_token/chain_access_token_extractor.py +1 -2
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/access_token/form_encoded_body_extractor.py +1 -3
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/access_token/header_access_token_extractor.py +1 -3
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/access_token/oauth2/oauth2_token_handler.py +3 -2
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/access_token/oidc/oidc_user_info_token_handler.py +5 -4
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/access_token/query_access_token_extractor.py +1 -3
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/authentication/authenticator_manager.py +1 -2
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/authentication/custom_authentication_failure_handler.py +13 -9
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/authentication/custom_authentication_success_handler.py +16 -12
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/authentication/default_authentication_failure_handler.py +1 -2
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/authentication/default_authentication_success_handler.py +8 -3
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/authenticator/abstract_authenticator.py +1 -3
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/authenticator/abstract_login_form_authenticator.py +1 -3
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/authenticator/abstract_pre_authenticated_authenticator.py +1 -2
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/authenticator/access_token_authenticator.py +1 -2
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/authenticator/debug/traceable_authenticator.py +1 -2
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/authenticator/debug/traceable_authenticator_manager_listener.py +23 -7
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/authenticator/form_login_authenticator.py +1 -2
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/authenticator/http_basic_authenticator.py +1 -2
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/authenticator/json_login_authenticator.py +1 -2
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/authenticator/login_link_authenticator.py +1 -2
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/authenticator/oidc/oidc_jwks.py +1 -2
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/authenticator/oidc_login_authenticator.py +1 -2
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/authenticator/passport/badge/authentication_method_badge.py +1 -2
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/authenticator/passport/badge/csrf_token_badge.py +1 -3
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/authenticator/passport/badge/password_upgrade_badge.py +1 -3
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/authenticator/passport/badge/pre_authenticated_user_badge.py +1 -3
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/authenticator/passport/badge/remember_me_badge.py +1 -3
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/authenticator/passport/badge/user_badge.py +2 -3
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/authenticator/passport/credentials/custom_credentials.py +1 -2
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/authenticator/passport/credentials/password_credentials.py +1 -2
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/authenticator/passport/passport.py +3 -5
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/authenticator/remember_me_authenticator.py +1 -2
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/authenticator/remote_user_authenticator.py +1 -2
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/authenticator/token/post_authentication_token.py +1 -2
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/authenticator/x509_authenticator.py +1 -2
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/authorization/insufficient_scope_access_denied_handler.py +1 -2
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/authorization/oauth2_scope_voter.py +1 -2
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/decorator/firewall_listener_order.py +2 -3
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/decorator/is_csrf_token_valid.py +1 -1
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/decorator/is_granted.py +9 -11
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/entry_point/fallback_authentication_entry_point_interface.py +1 -3
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/event_listener/authentication_proofs_listener.py +1 -2
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/event_listener/check_credentials_listener.py +4 -5
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/event_listener/check_remember_me_conditions_listener.py +1 -2
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/event_listener/clear_site_data_listener.py +1 -2
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/event_listener/cookie_clearing_listener.py +1 -2
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/event_listener/csrf_protection_listener.py +1 -2
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/event_listener/csrf_token_clearing_listener.py +1 -2
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/event_listener/default_logout_listener.py +1 -2
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/event_listener/login_throttling_listener.py +25 -67
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/event_listener/oidc_end_session_listener.py +1 -2
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/event_listener/password_migrating_listener.py +4 -5
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/event_listener/remember_me_listener.py +1 -2
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/event_listener/save_session_listener.py +5 -3
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/event_listener/session_logout_listener.py +1 -2
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/event_listener/session_strategy_listener.py +1 -2
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/event_listener/user_checker_listener.py +1 -2
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/event_listener/user_provider_listener.py +1 -2
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/firewall/abstract_listener.py +1 -1
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/firewall/access_listener.py +1 -2
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/firewall/authenticator_manager_listener.py +10 -7
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/firewall/channel_listener.py +1 -2
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/firewall/context_listener.py +1 -2
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/firewall/firewall.py +5 -6
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/firewall/logout_listener.py +1 -2
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/firewall/oidc_token_refresh_listener.py +1 -2
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/firewall/switch_user_listener.py +1 -2
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/firewall_map.py +1 -2
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/login_link/login_link_details.py +1 -3
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/login_link/login_link_handler.py +21 -4
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/oauth2/access_token_type/bearer_token_type.py +1 -2
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/oauth2/client_authentication/abstract_client_assertion.py +1 -2
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/oauth2/client_authentication/abstract_tls_client_auth.py +1 -3
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/oauth2/client_authentication/client_secret_basic.py +1 -2
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/oauth2/client_authentication/client_secret_jwt.py +1 -2
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/oauth2/client_authentication/client_secret_post.py +1 -2
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/oauth2/client_authentication/no_client_authentication.py +1 -2
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/oauth2/client_authentication/private_key_jwt.py +1 -2
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/oauth2/client_authentication/self_signed_tls_client_auth.py +1 -3
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/oauth2/client_authentication/tls_client_auth.py +1 -3
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/oidc/discovery_oidc_key_set_provider.py +1 -2
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/oidc/oidc_client.py +1 -2
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/oidc/oidc_discovery.py +3 -1
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/oidc/oidc_jwks.py +1 -1
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/rate_limiter/default_login_rate_limiter.py +1 -2
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/remember_me/abstract_remember_me_handler.py +9 -6
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/remember_me/persistent_remember_me_handler.py +21 -3
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/remember_me/remember_me_details.py +12 -6
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/remember_me/response_listener.py +1 -2
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/remember_me/signature_remember_me_handler.py +1 -2
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/security_request_attributes.py +0 -4
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/session/_session_kinds.py +4 -6
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/session/authentication_error_serializer.py +1 -1
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/session/password_session_user.py +1 -2
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/session/session_authentication_strategy.py +1 -2
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/session/session_token_serializer.py +6 -7
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/session/session_user.py +1 -2
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/LICENSE +0 -0
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/__init__.py +0 -0
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/_challenge.py +0 -0
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/_request_parameters.py +0 -0
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/_same_origin.py +0 -0
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/_security_state.py +0 -0
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/access_map_interface.py +0 -0
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/access_token/__init__.py +0 -0
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/access_token/access_token_extractor_interface.py +0 -0
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/access_token/access_token_handler_interface.py +0 -0
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/access_token/oauth2/__init__.py +0 -0
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/access_token/oauth2/_introspected_user.py +0 -0
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/access_token/oauth2/_introspection_claims.py +0 -0
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/access_token/oauth2/_signed_response.py +0 -0
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/access_token/oauth2/_signed_response_discovery.py +0 -0
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/access_token/oidc/__init__.py +0 -0
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/access_token/oidc/exception/__init__.py +0 -0
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/access_token/oidc/exception/invalid_signature_error.py +0 -0
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/access_token/oidc/exception/missing_claim_error.py +0 -0
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/access_token/oidc/exception/oidc_key_set_error.py +0 -0
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/access_token/oidc/oidc_token_generator.py +0 -0
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/access_token/oidc/oidc_token_handler.py +0 -0
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/access_token/oidc/oidc_trait.py +0 -0
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/access_token/sender_constraint_interface.py +0 -0
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/authentication/__init__.py +0 -0
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/authentication/_authentication_outcome.py +0 -0
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/authentication/_manager_reporting.py +0 -0
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/authentication/_referer.py +0 -0
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/authentication/_sensitive.py +0 -0
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/authentication/_supports_pass.py +0 -0
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/authentication/authentication_failure_handler_interface.py +0 -0
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/authentication/authentication_success_handler_interface.py +0 -0
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/authentication/authentication_utils.py +0 -0
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/authentication/authenticator_manager_interface.py +0 -0
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/authentication/expose_security_level.py +0 -0
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/authentication/user_authenticator_interface.py +0 -0
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/authenticator/__init__.py +0 -0
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/authenticator/_access_token_challenge.py +0 -0
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/authenticator/_access_token_scopes.py +0 -0
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/authenticator/_form_login_credentials.py +0 -0
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/authenticator/_oidc_login_attempts.py +0 -0
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/authenticator/_oidc_login_authorization.py +0 -0
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/authenticator/_oidc_login_callback.py +0 -0
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/authenticator/_oidc_login_claims.py +0 -0
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/authenticator/_oidc_login_options.py +0 -0
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/authenticator/_oidc_login_public_client.py +0 -0
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/authenticator/_oidc_login_token.py +0 -0
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/authenticator/authenticator_interface.py +0 -0
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/authenticator/debug/__init__.py +0 -0
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/authenticator/debug/unsupported_reasons.py +0 -0
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/authenticator/fallback_user_loader.py +0 -0
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/authenticator/interactive_authenticator_interface.py +0 -0
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/authenticator/oidc/__init__.py +0 -0
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/authenticator/passport/__init__.py +0 -0
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/authenticator/passport/badge/__init__.py +0 -0
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/authenticator/passport/badge/badge_interface.py +0 -0
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/authenticator/passport/credentials/__init__.py +0 -0
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/authenticator/passport/credentials/credentials_interface.py +0 -0
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/authenticator/passport/self_validating_passport.py +0 -0
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/authenticator/token/__init__.py +0 -0
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/authorization/__init__.py +0 -0
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/authorization/access_denied_handler_interface.py +0 -0
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/command/__init__.py +0 -0
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/command/_registry.py +0 -0
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/command/oidc_token_generate_command.py +0 -0
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/decorator/__init__.py +0 -0
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/decorator/_methods.py +0 -0
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/decorator/current_token.py +0 -0
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/decorator/current_user.py +0 -0
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/decorator/is_granted_context.py +0 -0
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/entry_point/__init__.py +0 -0
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/entry_point/authentication_entry_point_interface.py +0 -0
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/entry_point/re_authentication_entry_point_interface.py +0 -0
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/event/__init__.py +0 -0
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/event/authentication_token_created_event.py +0 -0
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/event/check_passport_event.py +0 -0
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/event/check_refreshed_user_event.py +0 -0
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/event/interactive_login_event.py +0 -0
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/event/login_failure_event.py +0 -0
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/event/login_success_event.py +0 -0
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/event/logout_event.py +0 -0
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/event/oidc_authorization_request_event.py +0 -0
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/event/switch_user_event.py +0 -0
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/event/token_deauthenticated_event.py +0 -0
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/event_listener/__init__.py +0 -0
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/event_listener/cleared_cookie.py +0 -0
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/event_listener/oidc_back_channel_logout_listener.py +0 -0
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/exception/__init__.py +0 -0
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/exception/expired_login_link_error.py +0 -0
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/exception/impersonation_error.py +0 -0
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/exception/invalid_access_token_error.py +0 -0
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/exception/invalid_csrf_token_error.py +0 -0
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/exception/invalid_login_link_authentication_error.py +0 -0
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/exception/invalid_login_link_error.py +0 -0
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/exception/invalid_login_link_error_interface.py +0 -0
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/exception/invalid_session_strategy_error.py +0 -0
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/exception/logout_error.py +0 -0
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/exception/missing_session_error.py +0 -0
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/exception/missing_state_bag_error.py +0 -0
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/exception/oidc_invalid_grant_error.py +0 -0
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/exception/oidc_session_ended_error.py +0 -0
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/exception/unknown_firewall_error.py +0 -0
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/firewall/__init__.py +0 -0
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/firewall/_exception_answers.py +0 -0
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/firewall/_re_authentication.py +0 -0
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/firewall/_switch_load.py +0 -0
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/firewall/_switch_request.py +0 -0
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/firewall/_switch_uri.py +0 -0
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/firewall/_user_refresh.py +0 -0
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/firewall/exception_listener.py +0 -0
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/firewall/firewall_listener_interface.py +0 -0
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/firewall/refresh_user_result.py +0 -0
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/firewall/user_changed.py +0 -0
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/firewall_context_interface.py +0 -0
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/firewall_map_interface.py +0 -0
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/http_utils.py +0 -0
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/impersonate/__init__.py +0 -0
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/impersonate/impersonate_url_generator.py +0 -0
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/impersonate/impersonation_form.py +0 -0
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/impersonate/switch_user_config.py +0 -0
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/impersonate/switch_user_config_lookup_interface.py +0 -0
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/login_link/__init__.py +0 -0
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/login_link/_presented_link.py +0 -0
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/login_link/login_link_handler_interface.py +0 -0
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/logout/__init__.py +0 -0
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/logout/logout_form.py +0 -0
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/logout/logout_url_generator.py +0 -0
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/oauth2/__init__.py +0 -0
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/oauth2/access_token_type/__init__.py +0 -0
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/oauth2/access_token_type/access_token_type_interface.py +0 -0
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/oauth2/client_authentication/__init__.py +0 -0
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/oauth2/client_authentication/client_authentication_interface.py +0 -0
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/oauth2/jws_algorithms.py +0 -0
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/oidc/__init__.py +0 -0
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/oidc/oidc_back_channel_logout.py +0 -0
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/oidc/oidc_client_interface.py +0 -0
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/oidc/oidc_ended_sessions.py +0 -0
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/oidc/oidc_id_token.py +0 -0
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/oidc/oidc_logout_token.py +0 -0
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/oidc/oidc_signature_verifier.py +0 -0
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/oidc/oidc_token_refresher.py +0 -0
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/parked_session.py +0 -0
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/py.typed +0 -0
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/rate_limiter/__init__.py +0 -0
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/remember_me/__init__.py +0 -0
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/remember_me/_signature_digest.py +0 -0
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/remember_me/remember_me_cookie.py +0 -0
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/remember_me/remember_me_handler_interface.py +0 -0
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/resolver/__init__.py +0 -0
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/resolver/csrf_token_checker.py +0 -0
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/resolver/is_granted_checker.py +0 -0
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/resolver/security_token_resolver.py +0 -0
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/resolver/user_value_resolver.py +0 -0
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/security_events.py +0 -0
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/session/__init__.py +0 -0
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/session/session_authentication_strategy_interface.py +0 -0
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/util/__init__.py +0 -0
- {xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/util/target_path.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: xtr-security-http
|
|
3
|
-
Version:
|
|
3
|
+
Version: 7.0.0
|
|
4
4
|
Summary: The HTTP edge of xtr security: firewalls, authenticators, bearer access tokens and the request surface.
|
|
5
5
|
Keywords: security,authentication,firewall,fastapi,oauth2
|
|
6
6
|
Author: Xterr
|
|
@@ -9,31 +9,26 @@ License-Expression: MIT
|
|
|
9
9
|
License-File: LICENSE
|
|
10
10
|
Classifier: Development Status :: 3 - Alpha
|
|
11
11
|
Classifier: Intended Audience :: Developers
|
|
12
|
-
Classifier: Programming Language :: Python :: 3.11
|
|
13
|
-
Classifier: Programming Language :: Python :: 3.12
|
|
14
|
-
Classifier: Programming Language :: Python :: 3.13
|
|
15
12
|
Classifier: Programming Language :: Python :: 3.14
|
|
16
13
|
Classifier: Typing :: Typed
|
|
17
|
-
Requires-Dist: xtr-security-core>=
|
|
18
|
-
Requires-Dist: xtr-security-csrf>=
|
|
19
|
-
Requires-Dist: xtr-http-kernel>=
|
|
20
|
-
Requires-Dist: xtr-http-foundation>=
|
|
21
|
-
Requires-Dist: xtr-http-message-contracts>=
|
|
22
|
-
Requires-Dist: xtr-http-client-contracts>=
|
|
23
|
-
Requires-Dist: xtr-cache-contracts>=
|
|
24
|
-
Requires-Dist: xtr-dependency-injection>=
|
|
25
|
-
Requires-Dist: xtr-event-dispatcher>=
|
|
26
|
-
Requires-Dist: xtr-event-dispatcher-contracts>=
|
|
27
|
-
Requires-Dist: xtr-clock>=
|
|
28
|
-
Requires-Dist: xtr-logging-contracts>=
|
|
29
|
-
Requires-Dist: xtr-password-hasher>=
|
|
30
|
-
Requires-Dist: xtr-rate-limiter>=
|
|
14
|
+
Requires-Dist: xtr-security-core>=7.0,<8
|
|
15
|
+
Requires-Dist: xtr-security-csrf>=7.0,<8
|
|
16
|
+
Requires-Dist: xtr-http-kernel>=7.0,<8
|
|
17
|
+
Requires-Dist: xtr-http-foundation>=7.0,<8
|
|
18
|
+
Requires-Dist: xtr-http-message-contracts>=7.0,<8
|
|
19
|
+
Requires-Dist: xtr-http-client-contracts>=7.0,<8
|
|
20
|
+
Requires-Dist: xtr-cache-contracts>=7.0,<8
|
|
21
|
+
Requires-Dist: xtr-dependency-injection>=7.0,<8
|
|
22
|
+
Requires-Dist: xtr-event-dispatcher>=7.0,<8
|
|
23
|
+
Requires-Dist: xtr-event-dispatcher-contracts>=7.0,<8
|
|
24
|
+
Requires-Dist: xtr-clock>=7.0,<8
|
|
25
|
+
Requires-Dist: xtr-logging-contracts>=7.0,<8
|
|
26
|
+
Requires-Dist: xtr-password-hasher>=7.0,<8
|
|
27
|
+
Requires-Dist: xtr-rate-limiter>=7.0,<8
|
|
31
28
|
Requires-Dist: fastapi>=0.143.1
|
|
32
|
-
Requires-Dist: starlette>=1.
|
|
33
|
-
Requires-Dist: anyio>=4.0
|
|
34
|
-
Requires-Dist: typing-extensions>=4.12
|
|
29
|
+
Requires-Dist: starlette>=1.6
|
|
35
30
|
Requires-Dist: joserfc>=1.7 ; extra == 'oidc'
|
|
36
|
-
Requires-Python: >=3.
|
|
31
|
+
Requires-Python: >=3.14.4
|
|
37
32
|
Provides-Extra: oidc
|
|
38
33
|
Description-Content-Type: text/markdown
|
|
39
34
|
|
|
@@ -43,7 +38,7 @@ Description-Content-Type: text/markdown
|
|
|
43
38
|
|
|
44
39
|
**The HTTP edge of security: firewalls, authenticators, bearer access tokens and the request surface.**
|
|
45
40
|
|
|
46
|
-
<img alt="python 3.
|
|
41
|
+
<img alt="python 3.14+" src="https://img.shields.io/badge/python-%E2%89%A5%203.14-3776AB?logo=python&logoColor=white">
|
|
47
42
|
<img alt="typed" src="https://img.shields.io/badge/typed-ty%20%2B%20basedpyright-1f6feb">
|
|
48
43
|
<img alt="license MIT" src="https://img.shields.io/badge/license-MIT-blue">
|
|
49
44
|
|
|
@@ -86,7 +81,7 @@ uv add xtr-security-http # firewalls, authenticators, access tok
|
|
|
86
81
|
uv add "xtr-security-http[oidc]" # + verifying a third-party OIDC issuer's tokens
|
|
87
82
|
```
|
|
88
83
|
|
|
89
|
-
Requires Python 3.
|
|
84
|
+
Requires Python 3.14.4+. The web framework and the security core come with the package; the `oidc`
|
|
90
85
|
extra adds [joserfc](https://jose.authlib.org/) and [httpx](https://www.python-httpx.org/) for
|
|
91
86
|
verifying and discovering an issuer's keys, and for verifying the signed introspection responses
|
|
92
87
|
the OAuth2 handler can ask for.
|
|
@@ -437,7 +432,9 @@ regexps of `HttpUtils`, when configured, still weigh whichever target wins.
|
|
|
437
432
|
**`CustomAuthenticationSuccessHandler(handler, options, firewall_name)`** and
|
|
438
433
|
**`CustomAuthenticationFailureHandler(handler, options)`** are the seams for an application's own
|
|
439
434
|
handlers, handing them the wiring's options — and the firewall's name, for a success handler that
|
|
440
|
-
keys by one — through duck-typed setters.
|
|
435
|
+
keys by one — through duck-typed setters. Each wrapper sets them once, on a shallow copy of the
|
|
436
|
+
handler of its own, so two firewalls sharing one handler never answer with each other's options;
|
|
437
|
+
a handler's setters must rebind what they set rather than change state the copies share.
|
|
441
438
|
|
|
442
439
|
**`AuthenticationUtils(request)`** reads what the last login attempt left, for the page that
|
|
443
440
|
renders the form again: `get_last_authentication_error(clear_session=True)`, `get_last_username()`
|
|
@@ -479,9 +476,13 @@ names and stages every cookie; its options default to the name `REMEMBERME`, a o
|
|
|
479
476
|
presented again raises the core `CookieTheftError`), skips the rotation within a 60-second
|
|
480
477
|
window so concurrent requests do not spend one another, and binds a digest of the user's
|
|
481
478
|
signature properties — the password by default, properties the user does not expose skipped —
|
|
482
|
-
so a changed password retires the series.
|
|
483
|
-
|
|
484
|
-
|
|
479
|
+
so a changed password retires the series. The rotation is conditional — `update_token(series,
|
|
480
|
+
expected_value, token_value, last_used) -> bool` stores the new value only over the one
|
|
481
|
+
presented — so of two requests rotating at once one wins; the other stages no cookie and
|
|
482
|
+
passes when the stored value was rotated within the window, and raises `CookieTheftError`
|
|
483
|
+
otherwise. A verifier accepts a value the store no longer holds exactly, and is told of a
|
|
484
|
+
rotation only once the store took it; the provider itself is used when it implements the
|
|
485
|
+
verifier's contract. Clearing drops the series the request's own cookie names.
|
|
485
486
|
|
|
486
487
|
Around the handlers: **`CheckRememberMeConditionsListener(options, logger)`** enables the passport's
|
|
487
488
|
`RememberMeBadge` on a successful login when the application always wants the cookie or the request
|
|
@@ -581,6 +582,8 @@ distinguished name when the email is not there — `emailAddress` also answers i
|
|
|
581
582
|
spelling `1.2.840.113549.1.9.1`, a custom identifier is matched anywhere in the name, and the
|
|
582
583
|
value read out of a name is trimmed. A request carrying neither key, or a name without the
|
|
583
584
|
identifier, is refused.
|
|
585
|
+
Both read the request's server parameters, which an ASGI server served through the HTTP kernel
|
|
586
|
+
never fills with these keys: there, neither signs anyone in.
|
|
584
587
|
|
|
585
588
|
### Listeners
|
|
586
589
|
|
|
@@ -608,18 +611,21 @@ event, on the application's main dispatcher.
|
|
|
608
611
|
|
|
609
612
|
**Login throttling.** The throttling listener runs first of all on the passport check (priority
|
|
610
613
|
2080, above the provider listener's 2048), and answers through one request limiter —
|
|
611
|
-
`RequestRateLimiterInterface` from [xtr-http-foundation](../xtr-http-foundation)
|
|
612
|
-
|
|
614
|
+
`RequestRateLimiterInterface` from [xtr-http-foundation](../xtr-http-foundation). The limiter
|
|
615
|
+
builds its own keys, and the default one —
|
|
613
616
|
`DefaultLoginRateLimiter` in `rate_limiter/`, over the [xtr-rate-limiter](../xtr-rate-limiter)
|
|
614
617
|
factories — counts a login twice: under the address it came from (a global limit, bounding how
|
|
615
618
|
many accounts one client may sweep) and under the account it named from that address (a local
|
|
616
619
|
limit). Both keys are eight-character HMAC-SHA256 prefixes over a non-empty application secret,
|
|
617
620
|
so a store shared across servers keeps no readable account or address; a successful login forgets
|
|
618
621
|
the local count only — the global one must survive the successful login of any one account. A
|
|
619
|
-
|
|
620
|
-
|
|
622
|
+
login is counted on the passport check, before its password is checked, so a burst of concurrent
|
|
623
|
+
attempts past the limit is refused without a single password verified; a failure counts nothing
|
|
624
|
+
more. An attempt over the
|
|
621
625
|
limit is refused with the core `TooManyLoginAttemptsAuthenticationError`, carrying the minutes to
|
|
622
|
-
wait, and announced as a `RateLimitExceededEvent` on the dispatcher the listener was given.
|
|
626
|
+
wait, and announced as a `RateLimitExceededEvent` on the dispatcher the listener was given. The
|
|
627
|
+
limiter keys the address on the connection's client (`scope["client"]`): behind a reverse proxy,
|
|
628
|
+
have the server trust the proxy's forwarded headers, or every login counts under the proxy's address.
|
|
623
629
|
|
|
624
630
|
**The dummy-hash timing guard.** When a password passport names an *unknown* user,
|
|
625
631
|
`CheckCredentialsListener` still verifies against a dummy hash, so the timing of a bad username
|
|
@@ -687,6 +693,9 @@ The session is built from the request here and nowhere else, reading its ID from
|
|
|
687
693
|
Every later step of the request reaches that same session, so the cookie a login's rotation, a
|
|
688
694
|
logout's invalidation and the save stage is always this one.
|
|
689
695
|
Any step reads it with **`parked_session_of(request)`** — `None` for a request no stateful chain ran.
|
|
696
|
+
An application's route reads it the same way, from the request message carrying the request's
|
|
697
|
+
state (`SecurityRequestAttributes.STATE_BAG` set to the ASGI scope's `"state"`) — see the
|
|
698
|
+
[xtr-security](../xtr-security#reading-the-session-in-a-route) README.
|
|
690
699
|
|
|
691
700
|
The response half, **`on_response(response_event)`** — registered beside the chain on the
|
|
692
701
|
kernel's response event — writes the token back: what the request authenticated is stored under
|
|
@@ -1804,6 +1813,11 @@ authenticators, the access map, the exception listener, the `Firewall` subscribe
|
|
|
1804
1813
|
firewalls written as configuration. See that package's
|
|
1805
1814
|
[Use in an application](../xtr-security#use-in-an-application).
|
|
1806
1815
|
|
|
1816
|
+
## Upgrading
|
|
1817
|
+
|
|
1818
|
+
What changes for an application moving to 7.0, and how to keep the old behaviour where that is
|
|
1819
|
+
still possible: [Upgrading to 7.0](../../UPGRADING.md#xtr-security-http).
|
|
1820
|
+
|
|
1807
1821
|
## Development
|
|
1808
1822
|
|
|
1809
1823
|
Developed in the [python-xtr](https://github.com/xterr/python-xtr) monorepo, under
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
**The HTTP edge of security: firewalls, authenticators, bearer access tokens and the request surface.**
|
|
6
6
|
|
|
7
|
-
<img alt="python 3.
|
|
7
|
+
<img alt="python 3.14+" src="https://img.shields.io/badge/python-%E2%89%A5%203.14-3776AB?logo=python&logoColor=white">
|
|
8
8
|
<img alt="typed" src="https://img.shields.io/badge/typed-ty%20%2B%20basedpyright-1f6feb">
|
|
9
9
|
<img alt="license MIT" src="https://img.shields.io/badge/license-MIT-blue">
|
|
10
10
|
|
|
@@ -47,7 +47,7 @@ uv add xtr-security-http # firewalls, authenticators, access tok
|
|
|
47
47
|
uv add "xtr-security-http[oidc]" # + verifying a third-party OIDC issuer's tokens
|
|
48
48
|
```
|
|
49
49
|
|
|
50
|
-
Requires Python 3.
|
|
50
|
+
Requires Python 3.14.4+. The web framework and the security core come with the package; the `oidc`
|
|
51
51
|
extra adds [joserfc](https://jose.authlib.org/) and [httpx](https://www.python-httpx.org/) for
|
|
52
52
|
verifying and discovering an issuer's keys, and for verifying the signed introspection responses
|
|
53
53
|
the OAuth2 handler can ask for.
|
|
@@ -398,7 +398,9 @@ regexps of `HttpUtils`, when configured, still weigh whichever target wins.
|
|
|
398
398
|
**`CustomAuthenticationSuccessHandler(handler, options, firewall_name)`** and
|
|
399
399
|
**`CustomAuthenticationFailureHandler(handler, options)`** are the seams for an application's own
|
|
400
400
|
handlers, handing them the wiring's options — and the firewall's name, for a success handler that
|
|
401
|
-
keys by one — through duck-typed setters.
|
|
401
|
+
keys by one — through duck-typed setters. Each wrapper sets them once, on a shallow copy of the
|
|
402
|
+
handler of its own, so two firewalls sharing one handler never answer with each other's options;
|
|
403
|
+
a handler's setters must rebind what they set rather than change state the copies share.
|
|
402
404
|
|
|
403
405
|
**`AuthenticationUtils(request)`** reads what the last login attempt left, for the page that
|
|
404
406
|
renders the form again: `get_last_authentication_error(clear_session=True)`, `get_last_username()`
|
|
@@ -440,9 +442,13 @@ names and stages every cookie; its options default to the name `REMEMBERME`, a o
|
|
|
440
442
|
presented again raises the core `CookieTheftError`), skips the rotation within a 60-second
|
|
441
443
|
window so concurrent requests do not spend one another, and binds a digest of the user's
|
|
442
444
|
signature properties — the password by default, properties the user does not expose skipped —
|
|
443
|
-
so a changed password retires the series.
|
|
444
|
-
|
|
445
|
-
|
|
445
|
+
so a changed password retires the series. The rotation is conditional — `update_token(series,
|
|
446
|
+
expected_value, token_value, last_used) -> bool` stores the new value only over the one
|
|
447
|
+
presented — so of two requests rotating at once one wins; the other stages no cookie and
|
|
448
|
+
passes when the stored value was rotated within the window, and raises `CookieTheftError`
|
|
449
|
+
otherwise. A verifier accepts a value the store no longer holds exactly, and is told of a
|
|
450
|
+
rotation only once the store took it; the provider itself is used when it implements the
|
|
451
|
+
verifier's contract. Clearing drops the series the request's own cookie names.
|
|
446
452
|
|
|
447
453
|
Around the handlers: **`CheckRememberMeConditionsListener(options, logger)`** enables the passport's
|
|
448
454
|
`RememberMeBadge` on a successful login when the application always wants the cookie or the request
|
|
@@ -542,6 +548,8 @@ distinguished name when the email is not there — `emailAddress` also answers i
|
|
|
542
548
|
spelling `1.2.840.113549.1.9.1`, a custom identifier is matched anywhere in the name, and the
|
|
543
549
|
value read out of a name is trimmed. A request carrying neither key, or a name without the
|
|
544
550
|
identifier, is refused.
|
|
551
|
+
Both read the request's server parameters, which an ASGI server served through the HTTP kernel
|
|
552
|
+
never fills with these keys: there, neither signs anyone in.
|
|
545
553
|
|
|
546
554
|
### Listeners
|
|
547
555
|
|
|
@@ -569,18 +577,21 @@ event, on the application's main dispatcher.
|
|
|
569
577
|
|
|
570
578
|
**Login throttling.** The throttling listener runs first of all on the passport check (priority
|
|
571
579
|
2080, above the provider listener's 2048), and answers through one request limiter —
|
|
572
|
-
`RequestRateLimiterInterface` from [xtr-http-foundation](../xtr-http-foundation)
|
|
573
|
-
|
|
580
|
+
`RequestRateLimiterInterface` from [xtr-http-foundation](../xtr-http-foundation). The limiter
|
|
581
|
+
builds its own keys, and the default one —
|
|
574
582
|
`DefaultLoginRateLimiter` in `rate_limiter/`, over the [xtr-rate-limiter](../xtr-rate-limiter)
|
|
575
583
|
factories — counts a login twice: under the address it came from (a global limit, bounding how
|
|
576
584
|
many accounts one client may sweep) and under the account it named from that address (a local
|
|
577
585
|
limit). Both keys are eight-character HMAC-SHA256 prefixes over a non-empty application secret,
|
|
578
586
|
so a store shared across servers keeps no readable account or address; a successful login forgets
|
|
579
587
|
the local count only — the global one must survive the successful login of any one account. A
|
|
580
|
-
|
|
581
|
-
|
|
588
|
+
login is counted on the passport check, before its password is checked, so a burst of concurrent
|
|
589
|
+
attempts past the limit is refused without a single password verified; a failure counts nothing
|
|
590
|
+
more. An attempt over the
|
|
582
591
|
limit is refused with the core `TooManyLoginAttemptsAuthenticationError`, carrying the minutes to
|
|
583
|
-
wait, and announced as a `RateLimitExceededEvent` on the dispatcher the listener was given.
|
|
592
|
+
wait, and announced as a `RateLimitExceededEvent` on the dispatcher the listener was given. The
|
|
593
|
+
limiter keys the address on the connection's client (`scope["client"]`): behind a reverse proxy,
|
|
594
|
+
have the server trust the proxy's forwarded headers, or every login counts under the proxy's address.
|
|
584
595
|
|
|
585
596
|
**The dummy-hash timing guard.** When a password passport names an *unknown* user,
|
|
586
597
|
`CheckCredentialsListener` still verifies against a dummy hash, so the timing of a bad username
|
|
@@ -648,6 +659,9 @@ The session is built from the request here and nowhere else, reading its ID from
|
|
|
648
659
|
Every later step of the request reaches that same session, so the cookie a login's rotation, a
|
|
649
660
|
logout's invalidation and the save stage is always this one.
|
|
650
661
|
Any step reads it with **`parked_session_of(request)`** — `None` for a request no stateful chain ran.
|
|
662
|
+
An application's route reads it the same way, from the request message carrying the request's
|
|
663
|
+
state (`SecurityRequestAttributes.STATE_BAG` set to the ASGI scope's `"state"`) — see the
|
|
664
|
+
[xtr-security](../xtr-security#reading-the-session-in-a-route) README.
|
|
651
665
|
|
|
652
666
|
The response half, **`on_response(response_event)`** — registered beside the chain on the
|
|
653
667
|
kernel's response event — writes the token back: what the request authenticated is stored under
|
|
@@ -1765,6 +1779,11 @@ authenticators, the access map, the exception listener, the `Firewall` subscribe
|
|
|
1765
1779
|
firewalls written as configuration. See that package's
|
|
1766
1780
|
[Use in an application](../xtr-security#use-in-an-application).
|
|
1767
1781
|
|
|
1782
|
+
## Upgrading
|
|
1783
|
+
|
|
1784
|
+
What changes for an application moving to 7.0, and how to keep the old behaviour where that is
|
|
1785
|
+
still possible: [Upgrading to 7.0](../../UPGRADING.md#xtr-security-http).
|
|
1786
|
+
|
|
1768
1787
|
## Development
|
|
1769
1788
|
|
|
1770
1789
|
Developed in the [python-xtr](https://github.com/xterr/python-xtr) monorepo, under
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "xtr-security-http"
|
|
3
|
-
version = "
|
|
3
|
+
version = "7.0.0"
|
|
4
4
|
description = "The HTTP edge of xtr security: firewalls, authenticators, bearer access tokens and the request surface."
|
|
5
5
|
readme = "README.md"
|
|
6
|
-
requires-python = ">=3.
|
|
6
|
+
requires-python = ">=3.14.4"
|
|
7
7
|
license = "MIT"
|
|
8
8
|
license-files = ["LICENSE"]
|
|
9
9
|
keywords = [
|
|
@@ -16,31 +16,26 @@ keywords = [
|
|
|
16
16
|
classifiers = [
|
|
17
17
|
"Development Status :: 3 - Alpha",
|
|
18
18
|
"Intended Audience :: Developers",
|
|
19
|
-
"Programming Language :: Python :: 3.11",
|
|
20
|
-
"Programming Language :: Python :: 3.12",
|
|
21
|
-
"Programming Language :: Python :: 3.13",
|
|
22
19
|
"Programming Language :: Python :: 3.14",
|
|
23
20
|
"Typing :: Typed",
|
|
24
21
|
]
|
|
25
22
|
dependencies = [
|
|
26
|
-
"xtr-security-core>=
|
|
27
|
-
"xtr-security-csrf>=
|
|
28
|
-
"xtr-http-kernel>=
|
|
29
|
-
"xtr-http-foundation>=
|
|
30
|
-
"xtr-http-message-contracts>=
|
|
31
|
-
"xtr-http-client-contracts>=
|
|
32
|
-
"xtr-cache-contracts>=
|
|
33
|
-
"xtr-dependency-injection>=
|
|
34
|
-
"xtr-event-dispatcher>=
|
|
35
|
-
"xtr-event-dispatcher-contracts>=
|
|
36
|
-
"xtr-clock>=
|
|
37
|
-
"xtr-logging-contracts>=
|
|
38
|
-
"xtr-password-hasher>=
|
|
39
|
-
"xtr-rate-limiter>=
|
|
23
|
+
"xtr-security-core>=7.0,<8",
|
|
24
|
+
"xtr-security-csrf>=7.0,<8",
|
|
25
|
+
"xtr-http-kernel>=7.0,<8",
|
|
26
|
+
"xtr-http-foundation>=7.0,<8",
|
|
27
|
+
"xtr-http-message-contracts>=7.0,<8",
|
|
28
|
+
"xtr-http-client-contracts>=7.0,<8",
|
|
29
|
+
"xtr-cache-contracts>=7.0,<8",
|
|
30
|
+
"xtr-dependency-injection>=7.0,<8",
|
|
31
|
+
"xtr-event-dispatcher>=7.0,<8",
|
|
32
|
+
"xtr-event-dispatcher-contracts>=7.0,<8",
|
|
33
|
+
"xtr-clock>=7.0,<8",
|
|
34
|
+
"xtr-logging-contracts>=7.0,<8",
|
|
35
|
+
"xtr-password-hasher>=7.0,<8",
|
|
36
|
+
"xtr-rate-limiter>=7.0,<8",
|
|
40
37
|
"fastapi>=0.143.1",
|
|
41
|
-
"starlette>=1.
|
|
42
|
-
"anyio>=4.0",
|
|
43
|
-
"typing-extensions>=4.12",
|
|
38
|
+
"starlette>=1.6",
|
|
44
39
|
]
|
|
45
40
|
|
|
46
41
|
[[project.authors]]
|
|
@@ -52,17 +47,17 @@ oidc = ["joserfc>=1.7"]
|
|
|
52
47
|
|
|
53
48
|
[dependency-groups]
|
|
54
49
|
dev = [
|
|
55
|
-
"basedpyright>=1.
|
|
56
|
-
"ruff>=0.
|
|
57
|
-
"pytest>=8",
|
|
58
|
-
"pytest-cov>=
|
|
59
|
-
"anyio>=4.
|
|
50
|
+
"basedpyright>=1.31.7",
|
|
51
|
+
"ruff>=0.14.7",
|
|
52
|
+
"pytest>=8.4",
|
|
53
|
+
"pytest-cov>=7.1",
|
|
54
|
+
"anyio>=4.10",
|
|
60
55
|
"ty>=0.0.83",
|
|
61
56
|
"joserfc>=1.7",
|
|
62
|
-
"xtr-http-message>=
|
|
63
|
-
"xtr-http-client>=
|
|
64
|
-
"xtr-cache>=
|
|
65
|
-
"xtr-console>=
|
|
57
|
+
"xtr-http-message>=7.0,<8",
|
|
58
|
+
"xtr-http-client>=7.0,<8",
|
|
59
|
+
"xtr-cache>=7.0,<8",
|
|
60
|
+
"xtr-console>=7.0,<8",
|
|
66
61
|
]
|
|
67
62
|
|
|
68
63
|
[build-system]
|
|
@@ -71,7 +66,7 @@ build-backend = "uv_build"
|
|
|
71
66
|
|
|
72
67
|
[tool.basedpyright]
|
|
73
68
|
typeCheckingMode = "all"
|
|
74
|
-
pythonVersion = "3.
|
|
69
|
+
pythonVersion = "3.14"
|
|
75
70
|
pythonPlatform = "All"
|
|
76
71
|
include = [
|
|
77
72
|
"src",
|
|
@@ -101,7 +96,7 @@ extraPaths = ["."]
|
|
|
101
96
|
reportPrivateUsage = "none"
|
|
102
97
|
|
|
103
98
|
[tool.ruff]
|
|
104
|
-
target-version = "
|
|
99
|
+
target-version = "py314"
|
|
105
100
|
line-length = 100
|
|
106
101
|
src = [
|
|
107
102
|
"src",
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "xtr-security-http"
|
|
3
|
-
version = "
|
|
3
|
+
version = "7.0.0"
|
|
4
4
|
description = "The HTTP edge of xtr security: firewalls, authenticators, bearer access tokens and the request surface."
|
|
5
5
|
readme = "README.md"
|
|
6
|
-
requires-python = ">=3.
|
|
6
|
+
requires-python = ">=3.14.4"
|
|
7
7
|
license = "MIT"
|
|
8
8
|
license-files = ["LICENSE"]
|
|
9
9
|
authors = [
|
|
@@ -13,36 +13,31 @@ keywords = ["security", "authentication", "firewall", "fastapi", "oauth2"]
|
|
|
13
13
|
classifiers = [
|
|
14
14
|
"Development Status :: 3 - Alpha",
|
|
15
15
|
"Intended Audience :: Developers",
|
|
16
|
-
"Programming Language :: Python :: 3.11",
|
|
17
|
-
"Programming Language :: Python :: 3.12",
|
|
18
|
-
"Programming Language :: Python :: 3.13",
|
|
19
16
|
"Programming Language :: Python :: 3.14",
|
|
20
17
|
"Typing :: Typed",
|
|
21
18
|
]
|
|
22
19
|
dependencies = [
|
|
23
|
-
"xtr-security-core>=
|
|
24
|
-
"xtr-security-csrf>=
|
|
25
|
-
"xtr-http-kernel>=
|
|
26
|
-
"xtr-http-foundation>=
|
|
27
|
-
"xtr-http-message-contracts>=
|
|
20
|
+
"xtr-security-core>=7.0,<8",
|
|
21
|
+
"xtr-security-csrf>=7.0,<8",
|
|
22
|
+
"xtr-http-kernel>=7.0,<8",
|
|
23
|
+
"xtr-http-foundation>=7.0,<8",
|
|
24
|
+
"xtr-http-message-contracts>=7.0,<8",
|
|
28
25
|
# The client interface the introspection endpoint is reached through; the client
|
|
29
26
|
# itself is installed by the application that introspects.
|
|
30
|
-
"xtr-http-client-contracts>=
|
|
27
|
+
"xtr-http-client-contracts>=7.0,<8",
|
|
31
28
|
# The cache contract the introspection responses are cached under; the pool
|
|
32
29
|
# behind it is the application's choice.
|
|
33
|
-
"xtr-cache-contracts>=
|
|
34
|
-
"xtr-dependency-injection>=
|
|
35
|
-
"xtr-event-dispatcher>=
|
|
36
|
-
"xtr-event-dispatcher-contracts>=
|
|
37
|
-
"xtr-clock>=
|
|
38
|
-
"xtr-logging-contracts>=
|
|
39
|
-
"xtr-password-hasher>=
|
|
40
|
-
"xtr-rate-limiter>=
|
|
30
|
+
"xtr-cache-contracts>=7.0,<8",
|
|
31
|
+
"xtr-dependency-injection>=7.0,<8",
|
|
32
|
+
"xtr-event-dispatcher>=7.0,<8",
|
|
33
|
+
"xtr-event-dispatcher-contracts>=7.0,<8",
|
|
34
|
+
"xtr-clock>=7.0,<8",
|
|
35
|
+
"xtr-logging-contracts>=7.0,<8",
|
|
36
|
+
"xtr-password-hasher>=7.0,<8",
|
|
37
|
+
"xtr-rate-limiter>=7.0,<8",
|
|
41
38
|
# The floors xtr-http-kernel serves on; see its pyproject.toml for why.
|
|
42
39
|
"fastapi>=0.143.1",
|
|
43
|
-
"starlette>=1.
|
|
44
|
-
"anyio>=4.0",
|
|
45
|
-
"typing-extensions>=4.12",
|
|
40
|
+
"starlette>=1.6",
|
|
46
41
|
]
|
|
47
42
|
|
|
48
43
|
[project.optional-dependencies]
|
|
@@ -52,20 +47,20 @@ oidc = [
|
|
|
52
47
|
|
|
53
48
|
[dependency-groups]
|
|
54
49
|
dev = [
|
|
55
|
-
"basedpyright>=1.
|
|
56
|
-
"ruff>=0.
|
|
57
|
-
"pytest>=8",
|
|
58
|
-
"pytest-cov>=
|
|
59
|
-
"anyio>=4.
|
|
50
|
+
"basedpyright>=1.31.7",
|
|
51
|
+
"ruff>=0.14.7",
|
|
52
|
+
"pytest>=8.4",
|
|
53
|
+
"pytest-cov>=7.1",
|
|
54
|
+
"anyio>=4.10",
|
|
60
55
|
"ty>=0.0.83",
|
|
61
56
|
"joserfc>=1.7",
|
|
62
57
|
# The tests match real requests, so they build the request messages.
|
|
63
|
-
"xtr-http-message>=
|
|
58
|
+
"xtr-http-message>=7.0,<8",
|
|
64
59
|
# The tests drive the introspection endpoint through the scripted client and
|
|
65
60
|
# cache the responses in the in-memory pool.
|
|
66
|
-
"xtr-http-client>=
|
|
67
|
-
"xtr-cache>=
|
|
68
|
-
"xtr-console>=
|
|
61
|
+
"xtr-http-client>=7.0,<8",
|
|
62
|
+
"xtr-cache>=7.0,<8",
|
|
63
|
+
"xtr-console>=7.0,<8",
|
|
69
64
|
]
|
|
70
65
|
|
|
71
66
|
[build-system]
|
|
@@ -74,7 +69,7 @@ build-backend = "uv_build"
|
|
|
74
69
|
|
|
75
70
|
[tool.basedpyright]
|
|
76
71
|
typeCheckingMode = "all"
|
|
77
|
-
pythonVersion = "3.
|
|
72
|
+
pythonVersion = "3.14"
|
|
78
73
|
pythonPlatform = "All"
|
|
79
74
|
include = ["src", "tests"]
|
|
80
75
|
exclude = ["**/__pycache__", "**/.venv", "**/build", "**/dist", ".tmp"]
|
|
@@ -104,7 +99,7 @@ extraPaths = ["."]
|
|
|
104
99
|
reportPrivateUsage = "none"
|
|
105
100
|
|
|
106
101
|
[tool.ruff]
|
|
107
|
-
target-version = "
|
|
102
|
+
target-version = "py314"
|
|
108
103
|
line-length = 100
|
|
109
104
|
src = ["src", "tests"]
|
|
110
105
|
|
{xtr_security_http-6.8.1 → xtr_security_http-7.0.0}/src/xtr_security_http/_form_content_type.py
RENAMED
|
@@ -12,11 +12,14 @@ from __future__ import annotations
|
|
|
12
12
|
|
|
13
13
|
from typing import Final
|
|
14
14
|
|
|
15
|
-
__all__ = ["is_form_content_type"]
|
|
15
|
+
__all__ = ["URLENCODED_FORM", "is_form_content_type"]
|
|
16
16
|
|
|
17
17
|
#: The media types a submitted form is encoded in.
|
|
18
18
|
_FORM_MEDIA_TYPES: Final = frozenset({"application/x-www-form-urlencoded", "multipart/form-data"})
|
|
19
19
|
|
|
20
|
+
#: The one encoding whose body is small enough to read before it is asked for.
|
|
21
|
+
URLENCODED_FORM: Final = frozenset({"application/x-www-form-urlencoded"})
|
|
22
|
+
|
|
20
23
|
|
|
21
24
|
def is_form_content_type(
|
|
22
25
|
content_type: str,
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"""Turning an error into text, whatever the error does."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
__all__ = ["safe_str"]
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
def safe_str(error: BaseException) -> str:
|
|
9
|
+
"""Return ``str(error)``, or a stand-in naming its class when ``__str__`` raises.
|
|
10
|
+
|
|
11
|
+
A token handler turns any failure into a refused token; a second exception
|
|
12
|
+
raised while describing the failure would escape as a crash instead.
|
|
13
|
+
"""
|
|
14
|
+
try:
|
|
15
|
+
return str(error)
|
|
16
|
+
except Exception: # noqa: BLE001 — whatever it raises, the failure is still reported
|
|
17
|
+
kind = type(error)
|
|
18
|
+
return f"[unprintable {kind.__module__}.{kind.__qualname__}]"
|
|
@@ -2,9 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
from __future__ import annotations
|
|
4
4
|
|
|
5
|
-
from typing import TYPE_CHECKING, final
|
|
5
|
+
from typing import TYPE_CHECKING, final, override
|
|
6
6
|
|
|
7
|
-
from typing_extensions import override
|
|
8
7
|
from xtr_security_core.exception import InvalidArgumentError
|
|
9
8
|
|
|
10
9
|
from .access_token_extractor_interface import AccessTokenExtractorInterface
|
|
@@ -3,9 +3,7 @@
|
|
|
3
3
|
from __future__ import annotations
|
|
4
4
|
|
|
5
5
|
from collections.abc import Mapping
|
|
6
|
-
from typing import TYPE_CHECKING, Final, cast, final
|
|
7
|
-
|
|
8
|
-
from typing_extensions import override
|
|
6
|
+
from typing import TYPE_CHECKING, Final, cast, final, override
|
|
9
7
|
|
|
10
8
|
from xtr_security_http._form_content_type import is_form_content_type
|
|
11
9
|
|
|
@@ -10,6 +10,7 @@ from xtr_clock import SystemClock
|
|
|
10
10
|
from xtr_logging_contracts import EXCEPTION_KEY, NullLogger
|
|
11
11
|
from xtr_security_core.exception import InvalidArgumentError
|
|
12
12
|
|
|
13
|
+
from xtr_security_http._text import safe_str
|
|
13
14
|
from xtr_security_http.authenticator.passport.badge.user_badge import UserBadge
|
|
14
15
|
from xtr_security_http.exception.invalid_access_token_error import InvalidAccessTokenError
|
|
15
16
|
|
|
@@ -296,7 +297,7 @@ class Oauth2TokenHandler:
|
|
|
296
297
|
except Exception as error:
|
|
297
298
|
self._log_failure(error)
|
|
298
299
|
raise InvalidAccessTokenError(
|
|
299
|
-
f"An error occurred on the authorization server: {error}",
|
|
300
|
+
f"An error occurred on the authorization server: {safe_str(error)}",
|
|
300
301
|
) from error
|
|
301
302
|
|
|
302
303
|
async def _badge_from(self, access_token: str) -> UserBadge:
|
|
@@ -457,7 +458,7 @@ class Oauth2TokenHandler:
|
|
|
457
458
|
"""Write the failure the authorization server's answer explains."""
|
|
458
459
|
self._logger.error(
|
|
459
460
|
"An error occurred on the authorization server.",
|
|
460
|
-
{"error":
|
|
461
|
+
{"error": safe_str(error), EXCEPTION_KEY: error},
|
|
461
462
|
)
|
|
462
463
|
|
|
463
464
|
|
|
@@ -6,6 +6,7 @@ from typing import TYPE_CHECKING, final
|
|
|
6
6
|
|
|
7
7
|
from xtr_logging_contracts import EXCEPTION_KEY, NullLogger
|
|
8
8
|
|
|
9
|
+
from xtr_security_http._text import safe_str
|
|
9
10
|
from xtr_security_http.authenticator.fallback_user_loader import FallbackUserLoader
|
|
10
11
|
from xtr_security_http.authenticator.passport.badge.user_badge import UserBadge
|
|
11
12
|
from xtr_security_http.exception.invalid_access_token_error import InvalidAccessTokenError
|
|
@@ -135,7 +136,7 @@ class OidcUserInfoTokenHandler(OidcTrait):
|
|
|
135
136
|
except Exception as error:
|
|
136
137
|
self._log_configuration_failure(error)
|
|
137
138
|
raise InvalidAccessTokenError(
|
|
138
|
-
f"An error occurred while requesting the OIDC configuration: {error}",
|
|
139
|
+
f"An error occurred while requesting the OIDC configuration: {safe_str(error)}",
|
|
139
140
|
) from error
|
|
140
141
|
try:
|
|
141
142
|
claims = await self._claims(access_token, endpoint)
|
|
@@ -148,7 +149,7 @@ class OidcUserInfoTokenHandler(OidcTrait):
|
|
|
148
149
|
except Exception as error:
|
|
149
150
|
self._log_server_failure(error)
|
|
150
151
|
raise InvalidAccessTokenError(
|
|
151
|
-
f"An error occurred on the OIDC server: {error}",
|
|
152
|
+
f"An error occurred on the OIDC server: {safe_str(error)}",
|
|
152
153
|
) from error
|
|
153
154
|
|
|
154
155
|
async def _claims(self, access_token: str, endpoint: str) -> dict[str, object]:
|
|
@@ -207,12 +208,12 @@ class OidcUserInfoTokenHandler(OidcTrait):
|
|
|
207
208
|
"""Write the failure the discovery read explains."""
|
|
208
209
|
self._logger.error(
|
|
209
210
|
"An error occurred while requesting the OIDC configuration.",
|
|
210
|
-
{"error":
|
|
211
|
+
{"error": safe_str(error), EXCEPTION_KEY: error},
|
|
211
212
|
)
|
|
212
213
|
|
|
213
214
|
def _log_server_failure(self, error: Exception) -> None:
|
|
214
215
|
"""Write the failure the OIDC server's answer explains."""
|
|
215
216
|
self._logger.error(
|
|
216
217
|
"An error occurred on the OIDC server.",
|
|
217
|
-
{"error":
|
|
218
|
+
{"error": safe_str(error), EXCEPTION_KEY: error},
|
|
218
219
|
)
|