|
1 | 1 | # ADR-T-007: Refactor the JWT System |
2 | 2 |
|
3 | | -**Status:** Phase 2 implemented |
| 3 | +**Status:** Phase 3 implemented |
4 | 4 | **Date:** 2026-04-14 |
5 | 5 |
|
6 | 6 | ## Context |
@@ -388,21 +388,25 @@ phased rollout that subsumes Options A and B. |
388 | 388 | - **Breaking change:** existing HS256 tokens are invalidated; |
389 | 389 | users must re-login. |
390 | 390 |
|
391 | | -#### Phase 3 — RS256 Asymmetric Signing (Option C scope) |
| 391 | +#### Phase 3 — RS256 Asymmetric Signing (Option C scope) ✅ Implemented |
392 | 392 |
|
393 | | -- Replace `HS256` with `RS256` (`Algorithm::RS256`). |
394 | | -- Config provides: |
| 393 | +- ✅ Replace `HS256` with `RS256` (`Algorithm::RS256`). |
| 394 | +- ✅ Config provides: |
395 | 395 | - `auth.private_key_path` (PEM / PKCS#8) for signing. |
396 | 396 | - `auth.public_key_path` for verification. |
397 | | - - Alternatively, inline PEM via environment variable. |
398 | | -- Generate a default development key pair on first run (with a |
399 | | - loud warning) so the zero-config experience is preserved for |
400 | | - local development. |
401 | | -- Use `EncodingKey::from_rsa_pem` / `DecodingKey::from_rsa_pem`. |
402 | | -- Only the signing service loads the private key; the |
| 397 | + - Alternatively, inline PEM via environment variable |
| 398 | + (`auth.private_key_pem`, `auth.public_key_pem`). |
| 399 | +- ✅ Development key pair shipped at `share/default/jwt/` with loud |
| 400 | + startup warning when the default dev keys are used. |
| 401 | +- ✅ Use `EncodingKey::from_rsa_pem` / `DecodingKey::from_rsa_pem`. |
| 402 | +- ✅ Only the signing service loads the private key; the |
403 | 403 | verification path uses the public key. |
404 | | -- Add a `kid` (Key ID) field to the JWT header to support future |
405 | | - key rotation. |
| 404 | +- ✅ A `kid` (Key ID) is included in every JWT header (SHA-256 |
| 405 | + fingerprint of the public key) to support future key rotation. |
| 406 | +- **Breaking change:** existing HS256 tokens and config |
| 407 | + (`session_signing_key`, `email_verification_signing_key`) are |
| 408 | + no longer supported. Deployers must generate an RSA key pair |
| 409 | + and update their configuration. |
406 | 410 |
|
407 | 411 | #### Future — Optional Revocation (Option E scope) |
408 | 412 |
|
|
0 commit comments