Skip to content

Commit 1c68b0a

Browse files
committed
docs: add jwx migration summary and index internal-docs
Made-with: Cursor
1 parent 4d85e71 commit 1c68b0a

2 files changed

Lines changed: 55 additions & 0 deletions

File tree

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# jwx migration summary (maintainers)
2+
3+
Short form of [JWX_V3_MIGRATION_PLAN.md](./JWX_V3_MIGRATION_PLAN.md) plus agreed direction for later **jwx v4**.
4+
5+
## Role of jwx in httpsign
6+
7+
jwx is used only for **optional “foreign” JWS** signing and verification (`NewJWS*` / `NewJWS*V3`). **Native** algorithms (HMAC-SHA256, RSA, RSASSA-PSS, P-256/P-384, Ed25519) do **not** use jwx.
8+
9+
## What we did: v2 → v3 (backward compatible)
10+
11+
| Item | Choice |
12+
|------|--------|
13+
| **Strategy** | Keep v2 APIs; add parallel **`NewJWSSignerV3` / `NewJWSVerifierV3`** using `jwx/v3`. |
14+
| **Breaking change** | No — existing `NewJWSSigner` / `NewJWSVerifier` (v2) unchanged. |
15+
| **Implementation** | `crypto.go` dispatches v2 `jws.Signer` / `Verifier` vs v3 `Signer2` / `Verifier2` (different `Sign` / `Verify` parameter order). |
16+
| **Trade-off** | Two dependencies and two code paths until a future cleanup release. |
17+
18+
See [JWX_V3_IMPLEMENTATION_SUMMARY.md](./JWX_V3_IMPLEMENTATION_SUMMARY.md) for what landed in the tree.
19+
20+
## Near-term maintenance
21+
22+
- Prefer **bumping within `jwx/v3`** (e.g. patch/minor) for fixes without adopting v4.
23+
- **`jwx/v3` remains tagged** alongside v4 (e.g. v3.1.0 shipped with v4.0.0); there is **no** published EOL date for v3 — treat **v4** as the long-term main line when we are ready.
24+
25+
## Future: v4 (not scheduled — prerequisites first)
26+
27+
**When:** No fixed date. Reasonable approach: wait until **v4 has had some `v4.0.x` releases** and upstream issue volume is acceptable; **do not** treat **`v4.1.0`** as a special “stability gate” (semver minor is not “safer” than patch for this).
28+
29+
**What “all-in v4” would mean for httpsign**
30+
31+
- Drop **`jwx/v2` and `jwx/v3`**; depend only on **`github.com/lestrrat-go/jwx/v4`** for JWS helpers.
32+
- **Major version** of httpsign and a **migration note** for callers (types and imports change).
33+
- Follow upstream **[MIGRATION.md](https://github.com/lestrrat-go/jwx/blob/v4.0.0/MIGRATION.md)** and optional **[jwxmigrate](https://github.com/jwx-go/jwxmigrate)** for mechanical rewrites.
34+
35+
**Toolchain (required for jwx v4 — cannot be avoided in app code)**
36+
37+
- **Go 1.26+** (as declared by the v4 module).
38+
- **`GOEXPERIMENT=jsonv2`** — jwx v4 uses **`encoding/json/v2`**; the flag applies to the **whole build** that compiles jwx, not something callers can “opt out of” locally.
39+
- There is **no** announced calendar or Go version for **ending** the `jsonv2` experiment; watch [golang/go#71497](https://github.com/golang/go/issues/71497) and Go release notes.
40+
41+
**Interop / testing**
42+
43+
- Re-run cross-peer tests after upgrade; v4 tightens some JWS behavior (e.g. `crit`, base64 strictness, `kid` consistency on sign) per upstream **Changes-v4.md**.
44+
45+
## Doc map
46+
47+
| Document | Use |
48+
|----------|-----|
49+
| [JWX_V3_MIGRATION_PLAN.md](./JWX_V3_MIGRATION_PLAN.md) | Full v2→v3 plan, phases, tests, timelines. |
50+
| [JWX_V3_IMPLEMENTATION_SUMMARY.md](./JWX_V3_IMPLEMENTATION_SUMMARY.md) | What was implemented. |
51+
| [JWX_V3_RESEARCH_FINDINGS.md](./JWX_V3_RESEARCH_FINDINGS.md) | Research notes. |
52+
| **This file** | One-page summary + v4 direction. |

internal-docs/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,10 @@ This directory contains internal documentation for maintainers of the httpsign l
44

55
## Contents
66

7+
- **JWX_MIGRATION_SUMMARY.md** - Short summary of jwx usage, the v2→v3 approach, and forward-looking notes on jwx v4.
78
- **JWX_V3_MIGRATION_PLAN.md** - Comprehensive plan for migrating from jwx v2 to v3, including implementation strategy, testing requirements, and timeline.
9+
- **JWX_V3_IMPLEMENTATION_SUMMARY.md** - What was implemented for jwx v3 support.
10+
- **JWX_V3_RESEARCH_FINDINGS.md** - Research notes from the v3 migration work.
811

912
## Purpose
1013

0 commit comments

Comments
 (0)