Skip to content

Commit 1cf300f

Browse files
yaronfcursoragent
andcommitted
docs: slim README and fix DeepWiki badge under GitHub camo.
Drop release-note churn from the README; point foreign-JWS details at pkg.go.dev. Serve the DeepWiki badge via shields.io so camo no longer 502s. Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent 92de25a commit 1cf300f

1 file changed

Lines changed: 3 additions & 36 deletions

File tree

‎README.md‎

Lines changed: 3 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -27,43 +27,9 @@ in the [API reference](https://pkg.go.dev/github.com/yaronf/httpsign).
2727
_ = res.Body.Close()
2828
```
2929

30-
### Upgrading
31-
32-
**v0.6.0** (shipped) raised the Go floor to **1.27+** and cut foreign JWS over to **jwx v4** + ML-DSA. See [internal-docs/RELEASE-v0.6.0.md](internal-docs/RELEASE-v0.6.0.md).
33-
34-
**v0.6.1** breaks foreign-JWS **verify** again: prefer `NewJWSVerifier(allowed, key, …)` (infer alg); use `NewJWSVerifierWithAlg` when needed; pass a `JWSAlgAllowlist` (`nil` skips policy). `NewJWSSigner` defaults to / requires `SignAlg(false)`; use `NewJWSSignerFromJWK` when the private key is a JWK.
35-
36-
**v0.6.2** restores opaque `crypto.Signer` (HSM/KMS) for foreign JWS RSA/ECDSA/Ed25519 and ML-DSA on sign and verify. See [internal-docs/RELEASE-v0.6.2.md](internal-docs/RELEASE-v0.6.2.md).
37-
38-
| Caller | Change in v0.6.1 |
39-
|--------|------------------|
40-
| Native algorithms only | None. |
41-
| `NewJWSVerifier(alg, key, …)` (v0.6.0) | Prefer `NewJWSVerifier(allowed, key, …)`; else `NewJWSVerifierWithAlg(allowed, alg, key, …)`. |
42-
| `NewJWSSigner` | Nil config ⇒ `SignAlg(false)`; `SignAlg(true)` errors. Prefer `NewJWSSignerFromJWK` for private JWKs. |
43-
44-
Pass a non-nil allowlist when `keyid` can select among keys. `SetAllowedAlgs` still only filters Signature-Input `alg`, not JWS `jwa`.
45-
46-
Full notes: [internal-docs/RELEASE-v0.6.1.md](internal-docs/RELEASE-v0.6.1.md).
47-
4830
### Foreign JWS and ML-DSA
4931

50-
Optional algorithms beyond the native set use [`lestrrat-go/jwx/v4`](https://github.com/lestrrat-go/jwx) (≥ v4.5.0) via `NewJWSSigner` / `NewJWSSignerFromJWK` / `NewJWSVerifier`.
51-
52-
For **RSA / ECDSA / Ed25519 / ML-DSA**, `NewJWSSigner` and `NewJWSVerifierWithAlg` accept either raw stdlib keys or an opaque [`crypto.Signer`](https://pkg.go.dev/crypto#Signer) (HSM/KMS) whose `Public()` matches the algorithm. Verify via `crypto.Signer` uses `Public()` locally; you can also pass the exported public key. Opaque Signers must use `NewJWSVerifierWithAlg` — the preferred infer path (`NewJWSVerifier`) does not recognize them.
53-
54-
Default jwx ML-DSA signing still requires `*mldsa.PrivateKey`. For an opaque ML-DSA Signer (e.g. KMS), register a custom `jws.Signer` with [`jws.RegisterSigner`](https://pkg.go.dev/github.com/lestrrat-go/jwx/v4/jws#RegisterSigner) that calls `crypto.Signer.Sign` (prefer also handling raw `*mldsa.PrivateKey` if other code in the process needs it). ML-DSA remains foreign-JWS only — not a native RFC 9421 algorithm.
55-
56-
**ML-DSA (FIPS 204)** with raw keys — prefer inferring the alg from the public key:
57-
58-
```go
59-
priv, _ := mldsa.GenerateKey(mldsa.MLDSA65())
60-
pub := priv.Public().(*mldsa.PublicKey)
61-
signer, _ := httpsign.NewJWSSigner(jwa.MLDSA65(), priv, nil, fields) // SignAlg(false) by default
62-
allowed, _ := httpsign.NewJWSAlgAllowlist(jwa.MLDSA65())
63-
verifier, _ := httpsign.NewJWSVerifier(allowed, pub, httpsign.NewVerifyConfig(), fields)
64-
```
65-
66-
HMAC keys must be `[]byte` (minimum length per RFC 7518). Raw RSA verify needs `NewJWSVerifierWithAlg` (or a JWK that carries `alg`).
32+
Optional algorithms beyond the native set use [`lestrrat-go/jwx/v4`](https://github.com/lestrrat-go/jwx) via `NewJWSSigner` / `NewJWSSignerFromJWK` / `NewJWSVerifier` / `NewJWSVerifierWithAlg` (including ML-DSA with `crypto/mldsa`). See the [API reference](https://pkg.go.dev/github.com/yaronf/httpsign) for constructors, allowlists, `crypto.Signer` (HSM/KMS) keys, and examples.
6733

6834
### Notes and Missing Features
6935
* Requires **Go 1.27+**.
@@ -72,11 +38,12 @@ HMAC keys must be `[]byte` (minimum length per RFC 7518). Raw RSA verify needs `
7238
* **Behind a TLS-terminating reverse proxy:** The `@scheme` derived component defaults to `req.TLS != nil`. Behind nginx, Envoy, AWS ALB, etc., `req.TLS` is nil, so `@scheme` becomes `"http"` even for HTTPS traffic. Use `SetSchemeFromRequest` on `SignConfig` and `VerifyConfig` to derive the scheme from `X-Forwarded-Proto` or similar headers.
7339
* **Nonce-based replay prevention:** The signer can include a nonce via `SetNonce`; the verifier does not track seen nonces by default. Use `SetNonceValidator` on `VerifyConfig` to implement replay prevention—the callback must check uniqueness (e.g. via a cache or database) and return an error for duplicates.
7440
* **Replay window:** Without nonce validation, `SetNotOlderThan` (default 10s) is the only replay defense. For sensitive operations, reduce this value or use `SetNonceValidator`. See the method docstrings for details.
41+
* Changelogs: [GitHub releases](https://github.com/yaronf/httpsign/releases).
7542

7643
### Contributing
7744
Contributions to this project are welcome, both as issues and pull requests.
7845

7946
[![Go Reference](https://pkg.go.dev/badge/github.com/yaronf/httpsign.svg)](https://pkg.go.dev/github.com/yaronf/httpsign)
8047
[![Test](https://github.com/yaronf/httpsign/actions/workflows/test.yml/badge.svg)](https://github.com/yaronf/httpsign/actions/workflows/test.yml)
8148
[![Lint](https://github.com/yaronf/httpsign/actions/workflows/lint.yml/badge.svg)](https://github.com/yaronf/httpsign/actions/workflows/lint.yml)
82-
[![Ask DeepWiki](https://deepwiki.com/badge.svg)](https://deepwiki.com/yaronf/httpsign)
49+
[![Ask DeepWiki](https://img.shields.io/badge/Ask_DeepWiki-1f6feb)](https://deepwiki.com/yaronf/httpsign)

0 commit comments

Comments
 (0)