diff --git a/pyeudiw/satosa/backend.py b/pyeudiw/satosa/backend.py index 2f01661e..b85bbf68 100644 --- a/pyeudiw/satosa/backend.py +++ b/pyeudiw/satosa/backend.py @@ -699,7 +699,7 @@ def get_response_endpoint(self, context): state = context.qs_params.get("id", None) session_id = context.state["SESSION_ID"] finalized_session = None - + try: finalized_session = self.db_engine.get_by_state_and_session_id( state=state, session_id=session_id diff --git a/pyeudiw/tests/federation/base.py b/pyeudiw/tests/federation/base.py index f3c068fa..bb770e91 100644 --- a/pyeudiw/tests/federation/base.py +++ b/pyeudiw/tests/federation/base.py @@ -1,6 +1,5 @@ from cryptojwt.jws.jws import JWS from cryptojwt.jwk.rsa import new_rsa_key -import json import pyeudiw.federation.trust_chain_validator as tcv_test from pyeudiw.tools.utils import iat_now, exp_from_now diff --git a/pyeudiw/tests/settings.py b/pyeudiw/tests/settings.py index c7efbe02..c39936a5 100644 --- a/pyeudiw/tests/settings.py +++ b/pyeudiw/tests/settings.py @@ -80,11 +80,11 @@ "..." ], "federation_entity_metadata": { - "organization_name": "Example RP", - "homepage_uri": "https://developers.italia.it", - "policy_uri": "https://developers.italia.it/privacy-policy", - "tos_uri": "https://developers.italia.it/privacy-policy", - "logo_uri": "https://developers.italia.it/assets/img/io-it-logo-white.svg" + "organization_name": "Example RP", + "homepage_uri": "https://developers.italia.it", + "policy_uri": "https://developers.italia.it/privacy-policy", + "tos_uri": "https://developers.italia.it/privacy-policy", + "logo_uri": "https://developers.italia.it/assets/img/io-it-logo-white.svg" } }, "metadata_jwks": [ diff --git a/pyeudiw/trust/__init__.py b/pyeudiw/trust/__init__.py index 8cd7a091..170a2cc2 100644 --- a/pyeudiw/trust/__init__.py +++ b/pyeudiw/trust/__init__.py @@ -49,17 +49,17 @@ def _handle_chain(self): f"Unknown Trust Anchor: '{trust_anchor_eid}' is not " "a recognizable Trust Anchor." ) - + decoded_ec = unpad_jwt_payload( trust_anchor['federation']['entity_configuration'] ) jwks = decoded_ec.get('jwks', {}).get('keys', []) - + if not jwks: raise MissingProtocolSpecificJwks( f"Cannot find any jwks in {decoded_ec}" ) - + tc = StaticTrustChainValidator( self.trust_chain, jwks, self.httpc_params ) @@ -68,9 +68,9 @@ def _handle_chain(self): _is_valid = False try: _is_valid = tc.validate() - except Exception as e: - # raise / log here that's expired - pass + except Exception: + # raise / log here that's expired + pass # nosec - B110 db_chain = None if not _is_valid: try: