From 1546f36368f6b997f5fd8c6457f77fe26eb2cb80 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Robles?= Date: Mon, 15 Jul 2024 09:20:29 -0500 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20Separation=20of=20voting=20session?= =?UTF-8?q?=20time=20and=20bearer=20token=20lifetime=20(#57)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Parent issue: https://github.com/sequentech/meta/issues/762 --- khmac_gen.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/khmac_gen.py b/khmac_gen.py index 97dc181..a7f6a29 100644 --- a/khmac_gen.py +++ b/khmac_gen.py @@ -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):