Skip to content

v1.4.0

Choose a tag to compare

@babs babs released this 08 Aug 21:00
· 57 commits to master since this release
23294a1

Readable errors for humans

/authorize, /consent and /callback end up in a user's browser, not in the
MCP client. A caller that asks for text/html now gets the failure as a plain
page — a title it can act on, one line of advice matched to the failure, and a
support code to quote — instead of a raw RFC 6749 JSON blob on a blank page.

Every programmatic caller keeps the JSON body unchanged. /token, /register
and discovery stay application/json whatever they ask for, as RFC 6749 §5.2
and RFC 7591 §3.2.2 require.

Why this is a minor, despite a BREAKING CHANGE: footer in the history

The feat(errors) commit carries a BREAKING CHANGE: footer. It was accurate
when written: that change capped request headers at 16 KB, which is tight
enough to reject a bearer token this proxy mints itself — a directory with
~175 typical AD DNs produces a token over that budget, and net/http answers
the resulting 431 before any middleware runs, so the failure appears in no
access log and no metric.

That cliff was removed before this release (#41): the header budget is 64 KB and
the groups budget 32 KB, both measured against the token the proxy actually
produces. Nothing in v1.4.0 breaks a deployment that worked on v1.3.0 unless it
was already sending headers larger than 64 KB.

What changes for callers

  • POST /consent with an Authorization header answers 400, not 401. A
    challenge-less 401 violates RFC 7235 §3.1, and a challenge pops a browser
    credential dialog on an endpoint that rejects credentials by design. Only a
    test harness asserting 401 is affected — a browser never sends the header there.
  • Accept: text/html returns HTML on the three browser-facing routes. Send
    application/json, */*, or no Accept to keep JSON.
  • Request headers are capped at 64 KB on both listeners, down from
    net/http's 1 MB default. Over that: 431, answered before any middleware.
  • The groups claim is capped at 32 KB at mint time (GROUPS_CLAIM_MAX_BYTES,
    range [1 KB, 40 KB]). That holds ~520 typical AD DNs, ~885 Entra GUIDs or
    ~2110 short names.

Operators

Truncation of the groups claim is authorization-visible: the claim is
forwarded upstream as X-User-Groups, while ALLOWED_GROUPS is evaluated
against the full list. A truncated user therefore passes this proxy and may
still be refused by the MCP server. Watch
mcp_auth_groups_claim_truncated_total — it should read zero; a non-zero value
names the affected subject in a groups_claim_truncated WARN.

New: mcp_auth_page_render_failed_total{page} counts proxy-rendered page
template failures. Zero in a healthy deploy.

The error-code vocabulary a user can quote to support is catalogued in
specs.md.