test: expired JWT shows empty role in logs
This commit is contained in:
committed by
Steve Chavez
parent
e39740cca3
commit
8105375b64
@@ -7,7 +7,7 @@ import time
|
||||
import pytest
|
||||
|
||||
from config import BASEDIR, CONFIGSDIR, FIXTURES, SECRET
|
||||
from util import authheader, jwtauthheader, parse_server_timings_header
|
||||
from util import authheader, jwtauthheader, parse_server_timings_header, relativeSeconds
|
||||
from postgrest import (
|
||||
run,
|
||||
sleep_until_postgrest_config_reload,
|
||||
@@ -72,9 +72,6 @@ def test_jwt_errors(defaultenv):
|
||||
|
||||
env = {**defaultenv, "PGRST_JWT_SECRET": SECRET, "PGRST_JWT_AUD": "io tests"}
|
||||
|
||||
def relativeSeconds(sec):
|
||||
return int((datetime.now(timezone.utc) + timedelta(seconds=sec)).timestamp())
|
||||
|
||||
with run(env=env) as postgrest:
|
||||
headers = jwtauthheader({}, "other secret")
|
||||
response = postgrest.session.get("/", headers=headers)
|
||||
|
||||
Reference in New Issue
Block a user