honcho/tests
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
..
alembic feat: make session_name nullable for documents and update related SDKs (#347) 2026-01-26 13:33:11 -05:00
bench rename to REPRESENTATION_BATCH_TARGET_INPUT_TOKENS 2026-07-09 10:42:52 -04:00
crud Scopes Phase 2b: `scope` option on chat, representation, context, and search (#897) 2026-08-12 18:34:55 -04:00
deriver feat: scope backfill-by-copy and removal reconciliation jobs (#904) 2026-08-14 15:08:43 -04:00
dialectic Scopes Phase 2b: `scope` option on chat, representation, context, and search (#897) 2026-08-12 18:34:55 -04:00
dreamer Scopes Phase 2a: scope-kind peers, guardrails, and scopes CRUD routes (#884) 2026-08-12 16:21:40 -04:00
integration feat: defer embedding messages (#704) 2026-06-11 10:31:04 -04:00
live_llm fix(embedding): request float encoding_format on openai embedding calls (#938) 2026-08-12 13:24:38 -04:00
llm perf: lazy-load provider SDKs to cut idle memory per process (#1011) 2026-08-12 21:39:12 -04:00
reconciler fix: Various Codex Audits (#386) 2026-02-13 12:00:15 -05:00
routes fix(security): encode JWT exp as NumericDate so PyJWT validates expiry (#1016) 2026-08-16 18:44:21 +02:00
scripts feat: add new cloudevents for api routes (#637) 2026-05-20 18:25:30 -04:00
sdk feat(dialectic): optional structured outputs with limited schema for Dialectic calls (#896) 2026-07-20 18:46:49 -04:00
sdk_typescript add read db (#773) 2026-06-10 13:28:36 -04:00
startup add read db (#773) 2026-06-10 13:28:36 -04:00
telemetry Vineeth/sentry filter consolidation (#934) 2026-07-24 15:42:41 -04:00
unified Scopes Phase 2b: `scope` option on chat, representation, context, and search (#897) 2026-08-12 18:34:55 -04:00
utils fix(filter): make the filter DSL reject bad input instead of 500ing, and fix negation over unset fields (#947) 2026-08-13 10:39:19 -04:00
vector_store fix: apply session scoping to all working-representation query paths (#881) 2026-07-24 11:41:34 -04:00
webhooks Tighten Transaction Scopes (#525) 2026-04-08 11:14:50 -04:00
__init__.py Refactor clients.py to add modern features and more flexible configuration (#459) 2026-04-20 02:46:37 -04:00
conftest.py feat: scope backfill-by-copy and removal reconciliation jobs (#904) 2026-08-14 15:08:43 -04:00
test_advanced_filters.py fix: apply session scoping to all working-representation query paths (#881) 2026-07-24 11:41:34 -04:00
test_cache_redaction.py Scopes Phase 2a: scope-kind peers, guardrails, and scopes CRUD routes (#884) 2026-08-12 16:21:40 -04:00
test_config.py fix(llm): support per-request provider timeouts (#832) 2026-08-04 12:43:00 -04:00
test_datetime_parsing.py Make embeddings configurable (#678) 2026-05-14 15:03:35 -04:00
test_db_resilience.py fix(deriver): increase deriver polling backoff (#1015) 2026-08-14 16:38:20 -04:00
test_dependencies.py add read db (#773) 2026-06-10 13:28:36 -04:00
test_generate_jwt_script.py feat: add generate_jwt.py script for creating scoped JWTs (#757) 2026-06-09 13:49:55 -04:00
test_models_vector_dim.py feat: add new cloudevents for api routes (#637) 2026-05-20 18:25:30 -04:00
test_schema_validations.py Align API contract with DB contract for IDs (#684) 2026-05-14 16:37:39 -04:00
test_search.py Tighten Transaction Scopes (#525) 2026-04-08 11:14:50 -04:00
test_security.py fix(security): encode JWT exp as NumericDate so PyJWT validates expiry (#1016) 2026-08-16 18:44:21 +02:00
test_session_allowlist.py fix(filter): make the filter DSL reject bad input instead of 500ing, and fix negation over unset fields (#947) 2026-08-13 10:39:19 -04:00