test: expired JWT shows empty role in logs
This commit is contained in:
committed by
Steve Chavez
parent
e39740cca3
commit
8105375b64
@@ -1,5 +1,6 @@
|
||||
import threading
|
||||
import jwt
|
||||
from datetime import datetime, timedelta, timezone
|
||||
|
||||
|
||||
class Thread(threading.Thread):
|
||||
@@ -31,6 +32,10 @@ def jwtauthheader(claim, secret):
|
||||
return authheader(jwt.encode(claim, secret))
|
||||
|
||||
|
||||
def relativeSeconds(sec):
|
||||
return int((datetime.now(timezone.utc) + timedelta(seconds=sec)).timestamp())
|
||||
|
||||
|
||||
def parse_server_timings_header(header):
|
||||
"""Parse the Server-Timing header into a dict of metric names to values.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user