|
| 1 | +# Release notes draft: httpsign v0.6.0 |
| 2 | + |
| 3 | +Copy the **Summary** section below into the GitHub release when tagging `v0.6.0`. |
| 4 | + |
| 5 | +--- |
| 6 | + |
| 7 | +## Summary |
| 8 | + |
| 9 | +**Breaking release:** requires **Go 1.27+** and replaces dual `jwx/v2` + `jwx/v3` foreign-JWS support with a single **`github.com/lestrrat-go/jwx/v4`** dependency (≥ v4.4.0). |
| 10 | + |
| 11 | +### Highlights |
| 12 | + |
| 13 | +- **One foreign-JWS API:** `NewJWSSigner` / `NewJWSVerifier` only (`NewJWSSignerV3`, `NewJWSVerifierV3`, and the old v2-typed overloads are removed). |
| 14 | +- **Post-quantum (ML-DSA):** sign and verify HTTP messages with `crypto/mldsa` keys and `jwa.MLDSA44()` / `MLDSA65()` / `MLDSA87()` through the same constructors (Go 1.27 stdlib; no extra modules). |
| 15 | +- **Constructor hardening:** foreign JWS keys are validated at `NewJWS*` time (algorithm family, ECDSA curve bind per RFC 7518, HMAC minimum length, private key for signers / public key for verifiers). `jwa.NoSignature()` is rejected. |
| 16 | +- **Native algorithms unchanged** in API shape (HMAC-SHA256, RSA, RSA-PSS, P-256/P-384, Ed25519); only the Go toolchain floor moves to 1.27. |
| 17 | + |
| 18 | +### Upgrade from v0.5.x |
| 19 | + |
| 20 | +| You use | Action | |
| 21 | +|---------|--------| |
| 22 | +| **Native signers/verifiers only** | Bump Go to **1.27+** and upgrade httpsign. No API changes. | |
| 23 | +| **`NewJWSSignerV3` / `NewJWSVerifierV3`** | Rename to `NewJWSSigner` / `NewJWSVerifier`; change `github.com/lestrrat-go/jwx/v3/jwa` → `.../jwx/v4/jwa`. | |
| 24 | +| **`NewJWSSigner` / `NewJWSVerifier` (v2)** | Same as above: v4 import path and algorithm values (e.g. `jwa.ES256()`). | |
| 25 | +| **Foreign JWS signing** | Keep `SignConfig.SignAlg(false)` — RFC 9421 has no `alg` parameter for arbitrary JWS algorithms. | |
| 26 | +| **Foreign JWS verifying** | `VerifyConfig.SetAllowedAlgs` filters the HTTP **Signature** `alg` parameter if present; it does **not** select the JWS algorithm (that comes from `NewJWSVerifier`). | |
| 27 | + |
| 28 | +**jwx v4 algorithm values** are functions, not string constants: |
| 29 | + |
| 30 | +```go |
| 31 | +import "github.com/lestrrat-go/jwx/v4/jwa" |
| 32 | + |
| 33 | +signer, err := httpsign.NewJWSSigner(jwa.ES256(), privKey, config.SignAlg(false), fields) |
| 34 | +verifier, err := httpsign.NewJWSVerifier(jwa.ES256(), &privKey.PublicKey, verifyConfig, fields) |
| 35 | +``` |
| 36 | + |
| 37 | +**ML-DSA example** (RFC 9421 does not register HTTP-sig algorithm names for ML-DSA; use foreign JWS with `SignAlg(false)`): |
| 38 | + |
| 39 | +```go |
| 40 | +priv, _ := mldsa.GenerateKey(mldsa.MLDSA65()) |
| 41 | +pub := priv.Public().(*mldsa.PublicKey) |
| 42 | +config := httpsign.NewSignConfig().SignAlg(false) |
| 43 | + |
| 44 | +signer, _ := httpsign.NewJWSSigner(jwa.MLDSA65(), priv, config, fields) |
| 45 | +verifier, _ := httpsign.NewJWSVerifier(jwa.MLDSA65(), pub, httpsign.NewVerifyConfig(), fields) |
| 46 | +``` |
| 47 | + |
| 48 | +HMAC keys for foreign JWS must be `[]byte` (not `string`), at least 32/48/64 bytes for HS256/384/512 per RFC 7518. |
| 49 | + |
| 50 | +### Toolchain |
| 51 | + |
| 52 | +- **Go:** 1.27.0+ (`encoding/json/v2` in stdlib; no `GOEXPERIMENT=jsonv2`). |
| 53 | +- **jwx:** v4.4.0+ only; v2 and v3 are no longer pulled transitively. |
| 54 | + |
| 55 | +### Upstream references |
| 56 | + |
| 57 | +- [jwx v4 MIGRATION.md](https://github.com/lestrrat-go/jwx/blob/v4.4.0/MIGRATION.md) |
| 58 | +- [jwx v4 Changes-v4.md](https://github.com/lestrrat-go/jwx/blob/v4.4.0/Changes-v4.md) |
| 59 | + |
| 60 | +### Also in v0.6.0 (non-breaking behavior fixes) |
| 61 | + |
| 62 | +- `SetVerifyDateWithin` now correctly reads the HTTP `Date` header (lowercase key in parsed messages). |
| 63 | +- Defensive checks for malformed ECDSA keys, empty header value lists, and nil client/signer/verifier config. |
0 commit comments