Skip to content

Commit

Permalink
fix: added Json response on failed trust evaluation on WIA
Browse files Browse the repository at this point in the history
  • Loading branch information
peppelinux committed Aug 21, 2023
1 parent d9f3f71 commit 463a929
Showing 1 changed file with 18 additions and 6 deletions.
24 changes: 18 additions & 6 deletions pyeudiw/satosa/backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -381,13 +381,25 @@ def _validate_trust(self, context: Context, jws: str) -> TrustEvaluationHelper:
f"{trust_eval.entity_id}"
)
)

is_trusted = trust_eval.evaluation_method()
if not is_trusted:
raise NotTrustedFederationError(
f"{trust_eval.entity_id} is not trusted"

is_trusted = None
try:
is_trusted = trust_eval.evaluation_method()
except Exception as e:
_err_msg = (
"Trust evaluation failed"
)

# raise NotTrustedFederationError(
# f"{trust_eval.entity_id} is not trusted"
# )
return JsonResponse(
{
"error": "invalid_param",
"error_description": "Wallet Provider is not Trusted"
},
status="403"
)

return trust_eval

def redirect_endpoint(self, context, *args):
Expand Down

0 comments on commit 463a929

Please sign in to comment.