From b2b3774dea14074bd7764a7f914985e7569ef7fc Mon Sep 17 00:00:00 2001 From: Matt Mabrey Date: Tue, 6 Oct 2026 13:28:22 -0700 Subject: [PATCH] T16.4: security_check skips the D18 refresh check where D18 is absent Wave 16 rebuilt on main (feat/wave-16-on-main, 2026-10-06) so it can ship without wave 11 and T13.1. main has no sliding refresh, so the one D18 check now runs only when auth.maybe_refresh_token exists; on main it instead proves a valid token near its expiry is still accepted. security_check 36/36 on this branch; smoke 27/27. --- tests/security_check.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/tests/security_check.py b/tests/security_check.py index 310651f..9ee4e62 100644 --- a/tests/security_check.py +++ b/tests/security_check.py @@ -108,9 +108,16 @@ def d21(): "login_at": (now - timedelta(minutes=25)).timestamp(), "exp": now + timedelta(minutes=5)}, auth.SECRET_KEY, algorithm="HS256") r = client(token=near).get("/api/projects") - check("D21", "the D18 sliding refresh still reissues the session", - r.status_code == 200 and auth.COOKIE_NAME in (r.headers.get("set-cookie") or ""), - f"status {r.status_code}") + if hasattr(auth, "maybe_refresh_token"): + check("D21", "the D18 sliding refresh still reissues the session", + r.status_code == 200 and auth.COOKIE_NAME in (r.headers.get("set-cookie") or ""), + f"status {r.status_code}") + else: + # D18 (T13.1) is not on this branch (wave 16 built on main, 2026-10-06): + # there is no refresh to keep working, so prove the stricter decode still + # accepts a valid token about to expire. + check("D21", "a valid token close to its expiry is still accepted (no D18 on this branch)", + r.status_code == 200, f"status {r.status_code}") import re pin = re.search(r"(?im)^pyjwt==([0-9.]+)", open(os.path.join(ROOT, "server", "requirements.txt")).read()) pinned = tuple(int(x) for x in pin.group(1).split(".")) if pin else (0,)