test: expired JWT shows empty role in logs

This commit is contained in:
steve-chavez
2026-05-05 19:29:59 -05:00
committed by Steve Chavez
parent e39740cca3
commit 8105375b64
3 changed files with 26 additions and 5 deletions
+1 -4
View File
@@ -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)