honcho/scripts
ChethanUK 2d6206f068
fix(security): encode JWT exp as NumericDate so PyJWT validates expiry (#1016)
JWTParams.exp was typed str and filled with an ISO-8601 string, copied
verbatim into the reserved RFC 7519 exp claim. PyJWT requires exp to be a
NumericDate and raised DecodeError (subclass of PyJWTError), which the
blanket handler turned into 'Invalid JWT' — so every token minted with
--expires or expires_at failed auth. The module's own ISO comparison was
dead code because decode always failed first.

- JWTParams.exp: datetime | None; create_jwt unchanged (PyJWT converts)
- verify_jwt: drop the dead ISO comparison; catch jwt.ExpiredSignatureError
  before PyJWTError so expired tokens report 'JWT expired'
- keys.py: pass expires_at through directly; drop unused format import
- generate_jwt.py: keep ISO string for display, datetime for the claim
- Tests: TestJWTExpiry (future/past/ISO-string/tampered) + rewritten
  test_create_key_with_expires_at verifying minted keys both ways

Signed-off-by: ChethanUK <chethanuk@outlook.com>
2026-08-16 18:44:21 +02:00
..
__init__.py v1.0.0 Release Candidate (#95) 2025-04-10 13:59:40 -04:00
configure_embeddings.py Make embeddings configurable (#678) 2026-05-14 15:03:35 -04:00
dialectic_cost_calculator.py fix: increase throughput of unit tests by changing behavior db teardown (#949) 2026-07-29 11:19:41 -04:00
ensure_alembic_tests.py feat: introduce alembic migration verification (#238) 2025-10-23 16:24:35 -04:00
generate_jwt.py fix(security): encode JWT exp as NumericDate so PyJWT validates expiry (#1016) 2026-08-16 18:44:21 +02:00
generate_jwt_secret.py feat: introduce alembic migration verification (#238) 2025-10-23 16:24:35 -04:00
generate_message_embeddings.py fix: use model-aware tokenizer and skip empty messages - DEV-1238 (#647) 2026-05-11 17:22:50 -04:00
jsonl_to_json.py feat: agentic dreamer and agentic dialectic (#309) 2026-01-12 15:12:17 -05:00
migrate_db.py Alembic genesis (#106) 2025-05-13 12:26:58 -04:00
provision_db.py fix: use engine args on both engines in db.py (#147) 2025-06-27 15:26:29 -04:00
run_alembic_tests.py Oolong Benchmark (#323) 2026-02-23 16:55:59 -05:00
test_reasoning_levels.py fix: increase throughput of unit tests by changing behavior db teardown (#949) 2026-07-29 11:19:41 -04:00
update_version.py v3.0.11 Release Candidate (#841) 2026-06-24 12:44:13 -04:00