Skip to content

refactor: consolidate jwt into TokenService - #36

Merged
Arminek merged 2 commits into
mainfrom
roc-157-token-service-consolidation
Jul 26, 2026
Merged

refactor: consolidate jwt into TokenService#36
Arminek merged 2 commits into
mainfrom
roc-157-token-service-consolidation

Conversation

@Arminek

@Arminek Arminek commented Jul 26, 2026

Copy link
Copy Markdown
Member

Summary

Phase 0 of the modularization plan. Prerequisite for the asymmetric key migration (ROC-158).

  • All four token kinds (access, refresh, verification, password reset) mint and validate through one TokenService in the application layer, with per-kind TTLs from existing config.
  • Typed tokens: SignedToken<K> / TypedClaims<K> — using a token of the wrong kind is now a compile error; the kind claim is checked once at decode.
  • SecretAware replaced with TokenServiceAware: call sites no longer know a secret string exists, only a service that signs and validates. This is the seam ROC-158 swaps for a keystore.
  • Dead session_id claim removed (always None since session removal).
  • Tests use a shared helper (tests/utils/jwt.rs) instead of hand-forged jsonwebtoken calls with the literal "secret".

Behavior and token wire format unchanged — token_type claim stays in the JSON payload; HTTP responses byte-identical.

Test plan

  • Full suite (unit + integration + acceptance + CLI) run in Docker against mysql:9.4 + rabbitmq:4 — 162 passed, 0 failed.
  • jsonwebtoken imports verified confined to the token module (grep clean).

Arminek added 2 commits July 26, 2026 21:04
All four token kinds mint and validate through one application
service with typed SignedToken<K>/TypedClaims<K> wrappers, so a
wrong-kind token is a compile error. Replaces the SecretAware
seam with TokenServiceAware ahead of the asymmetric key
migration (ROC-158). Drops the dead session_id claim. Tests use
a shared helper instead of hand-forged jsonwebtoken calls.
Acceptance matrix now gates PRs; dist-cache is skipped for
pull_request events so unreviewed code cannot overwrite the shared
test-latest image, and perf/zap/publish skip transitively via needs.
@Arminek
Arminek merged commit f2a74a9 into main Jul 26, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant