Skip to content

Commit

Permalink
fix: send all dates as iso 8601
Browse files Browse the repository at this point in the history
  • Loading branch information
BjrInt authored and hoh committed Nov 14, 2023
1 parent b89239f commit c332971
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/aleph/vm/orchestrator/views/operator.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,8 @@ def is_token_still_valid(timestamp):
"""
Checks if a token has exprired based on its timestamp
"""
timestamp = int(timestamp)
current_datetime = datetime.now(tz=timezone.utc)
target_datetime = datetime.fromtimestamp(timestamp, tz=timezone.utc)
target_datetime = datetime.fromisoformat(timestamp, tz=timezone.utc)

return target_datetime > current_datetime

Expand Down Expand Up @@ -78,7 +77,7 @@ class SignedPubKeyPayload(BaseModel):
# alg: Literal["ECDSA"]
domain: str
address: str
expires: float # timestamp # TODO: move to ISO 8601
expires: str

@property
def json_web_key(self) -> Jwk:
Expand Down

0 comments on commit c332971

Please sign in to comment.