Skip to content

Commit

Permalink
fix: code linting and CI
Browse files Browse the repository at this point in the history
  • Loading branch information
peppelinux committed Sep 20, 2023
1 parent 4bb8df3 commit fdbd9a3
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 13 deletions.
2 changes: 1 addition & 1 deletion pyeudiw/satosa/backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion pyeudiw/tests/federation/base.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down
10 changes: 5 additions & 5 deletions pyeudiw/tests/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -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": [
Expand Down
12 changes: 6 additions & 6 deletions pyeudiw/trust/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
)
Expand All @@ -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:
Expand Down

0 comments on commit fdbd9a3

Please sign in to comment.