feat(07.2-02): add jti UUID claim to create_access_token

- Added "jti": str(uuid.uuid4()) to the access token payload in services/auth.py
- Promoted Wave 0 xfail stub test_create_access_token_includes_jti_claim to PASS
- Added test_create_access_token_jti_is_unique_per_call uniqueness guard
- uuid module was already imported at module top — no new imports needed
This commit is contained in:
curo1305
2026-06-05 19:15:01 +02:00
parent a80b632ac8
commit c00c1fbaa7
2 changed files with 14 additions and 4 deletions
+1
View File
@@ -95,6 +95,7 @@ def create_access_token(user_id: str, role: str) -> str:
"typ": "access",
"iat": now,
"exp": now + timedelta(minutes=settings.access_token_expire_minutes),
"jti": str(uuid.uuid4()),
}
return jwt.encode(payload, settings.secret_key, algorithm="HS256")