Skip to content

Commit

Permalink
Set response_expires_at field to Payload (#129)
Browse files Browse the repository at this point in the history
Co-authored-by: Mebin Abraham <[email protected]>
  • Loading branch information
Yuyuutsu and MebinAbraham authored Apr 14, 2023
1 parent 4c9108a commit 041bc4a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions runner_benchmark/token_generator.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import os
import time
from uuid import uuid4

from datetime import datetime, timedelta, timezone
from sdc.crypto.encrypter import encrypt
from sdc.crypto.key_store import KeyStore

Expand Down Expand Up @@ -76,7 +76,9 @@ def _get_payload_with_params(schema_name, schema_url=None, **extra_payload):
payload_vars['iat'] = time.time()
payload_vars['exp'] = payload_vars['iat'] + float(3600) # one hour from now
payload_vars['jti'] = str(uuid4())

payload_vars['response_expires_at'] = (
datetime.now(tz=timezone.utc) + timedelta(days=7)
).isoformat() # 7 days from now in ISO 8601 format
for key, value in extra_payload.items():
payload_vars[key] = value

Expand Down

0 comments on commit 041bc4a

Please sign in to comment.