Skip to content

Commit

Permalink
fix: wrong order in expiration check
Browse files Browse the repository at this point in the history
  • Loading branch information
Salvatore Laiso committed Nov 20, 2023
1 parent 8596538 commit 8286572
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pyeudiw/satosa/backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -822,7 +822,7 @@ def status_endpoint(self, context):

request_object = session.get("request_object", None)
if request_object:
if request_object["exp"] >= iat_now():
if iat_now() > request_object["exp"]:
return self.handle_error(
context=context,
message="expired",
Expand Down
2 changes: 1 addition & 1 deletion pyeudiw/tests/satosa/test_backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,7 @@ def test_request_endpoint(self, context):
assert payload["response_uri"] == CONFIG["metadata"]["redirect_uris"][0]

datetime_mock = Mock(wraps=datetime.datetime)
datetime_mock.now.return_value = datetime.datetime(1999, 1, 1)
datetime_mock.now.return_value = datetime.datetime(2999, 1, 1)
with patch('datetime.datetime', new=datetime_mock):
self.backend.status_endpoint(context)
state_endpoint_response = self.backend.status_endpoint(context)
Expand Down

0 comments on commit 8286572

Please sign in to comment.