Skip to content

Commit

Permalink
✨ Separation of voting session time and bearer token lifetime (#57)
Browse files Browse the repository at this point in the history
Parent issue: sequentech/meta#762
  • Loading branch information
Findeton authored Jul 15, 2024
1 parent 0e980bc commit 1546f36
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion khmac_gen.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,16 @@
import hmac

def get_auth_khmac(secret, userid, obj_type, obj_id, perm):
now = int(time.time())
expiry = now + 300
message = ":".join([
userid,
obj_type,
obj_id,
perm,
str(int(time.time()))])
str(expiry),
"timeout-token",
str(now)])
return get_khmac(secret, message)

def get_khmac(secret, message):
Expand Down

0 comments on commit 1546f36

Please sign in to comment.