Skip to content

Commit

Permalink
feat: filter out finalized sessions in status and get_redirect endpoints
Browse files Browse the repository at this point in the history
  • Loading branch information
peppelinux committed Sep 29, 2023
1 parent 64009e5 commit 7f1c352
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion pyeudiw/satosa/backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,17 @@ def redirect_endpoint(self, context, *args):
err=f"{e.__class__.__name__}: {e}",
err_code="400"
)


if stored_session["finalized"]:
_msg = f"Session already finalized"
return self.handle_error(
context=context,
message="invalid_request",
troubleshoot=_msg,
err=f"{e.__class__.__name__}: {e}",
err_code="400"
)

# TODO: handle vp token ops exceptions
try:
vpt.load_nonce(stored_session['nonce'])
Expand Down Expand Up @@ -800,6 +810,16 @@ def status_endpoint(self, context):
err_code="401"
)

if session["finalized"]:
_msg = f"Session already finalized"
return self.handle_error(
context=context,
message="invalid_request",
troubleshoot=_msg,
err=f"{e.__class__.__name__}: {e}",
err_code="400"
)

# TODO: if the request is expired -> return 403
if session["finalized"]:
# return Redirect(
Expand Down

0 comments on commit 7f1c352

Please sign in to comment.