Repository navigation
v0.20.0 (mcpauth v0.3.0, forfait v0.1.3)
Tags: root module v0.20.0; mcpauth v0.3.0 (its go.mod requires porte v0.20.0
for Identity.BrowserSession, so both tags go on the same commit); forfait v0.1.3;
directory unchanged. No migration, no route, CSRF or pg.Schema change. A browser login's
session token now starts with b- (see NewBrowserToken); existing sessions keep working.
Upgrade note. An app that adopts RequireOwnSession needs each person to sign in once in the
browser after deploying v0.20.0 before they can confirm a pending action: a cookie minted before
the upgrade has no b- mark and is refused (403) by the helper only. It still authenticates for
everything else, so nobody is signed out.
Added
mcpauth.RequireOwnSession(r): only the person's own browser session confirms a pending MCP
action. The confirm pages decided this five different ways: Courrier, Agenda and Opus refused
only delegated tokens, so an agent holding the person's CLI or API token could confirm its own
courrier_send; Nuage, Sablier and Plume also required a session row, which an opaque bearer
or a named API token has; Capsule refused anyAuthorizationheader; Mycelium accepted only a
browser session. The helper takes the strictest rule: the session cookie carrying a token a
browser login minted, and nothing else. It refuses every bearer (opaque session, named API
token, JWT, delegated or not, machine token), a named API token sent as a cookie, a CLI,
device or mobile session token sent as a cookie, a request carrying anAuthorizationheader
next to the cookie, and aporte/keysAPI key. What it guarantees: the token in the cookie
came out ofIssueCookieFor(OIDC web callback, local login, register, password change,
magic link). What it does not: local login and magic link also return that token in their
JSON body, so a CLI that signs in with the person's password or mailbox holds a browser token. A request with no porte
identity is the 401 the apps answered; every other refusal is one 403,ErrNotOwnSession,
with the text of tronc'smcp.ErrDelegated.porte.Identity.BrowserSession, set bysession.Manager.Authenticatewhen the credential came
from the session cookie, the row is not a named API token, and the token starts with
porte.BrowserTokenPrefix(b-). The bearer JWT path clears it. Nothing else sets it.porte.NewBrowserToken():b-+NewToken().session.Manager.IssueCookieFor(and so
IssueCookie) mints it;IssueandIssueFor(CLI code exchange, device exchange, mobile)
keep plain tokens. Why a mark on the token and not anorigincolumn: about fourteen apps keep
their own copy of porte's DDL in goose migrations, so a column means a migration in each and a
broken login until it lands (the v0.10.0porte_login_codesprecedent). The stored hash
covers the prefix, so addingb-to a CLI token makes it fail its lookup (401). A session
minted before v0.20.0 has no mark and fails closed forRequireOwnSessiononly.mcpauth.AccountExists(ctx, info, lookup): the "account still exists" check six apps copy into
their tooluserOf. It resolves the Verifier token's user and reads it with the app's own
lookup; a token from elsewhere or a failed lookup isErrNoAccount, wrapping the lookup's error.- forfait:
(*LimitError).PlanLimit() (key, upgradeURL string), the method tronc v0.23.0's
mcp.Failurelooks for, so a plan refusal reaches an MCP client as the plan-limit failure with
no app code. - Conformance vectors a port reads:
exchange_errors.json(the token endpoint's answer to an
RFC 8693 exchange, mapped to token, reconnect, refused or unavailable),mcpauth_tokens.json
(audience, issuer, expiry, scope and provisioning outcomes),provision_bearer.json(the email,
roles, store and erased-subject refusals ofProvisionBearer) anddirectory_erased.json
(Deletions.Erasedand theHoldsre-erasure). Every vector'ssourcenames the release tag.
Fixed
- oidc: back-channel logout answers 503
unavailable("could not fetch the provider keys") when
the provider's JWKS cannot be fetched, as porte-rs does, instead of 401. The failure is the
app's, not the token's, so 503 is the correct status, and it lets a provider retry. Registre
delivers a logout once today and treats every status alike, so a deactivation during a JWKS
outage still leaves the person's sessions alive until they expire; a bounded retry on 5xx in
Registre would close that. Every other verification failure stays 401. go-oidc formats the fetch error
with%v, so the kit matches thefailed to verify signature: fetching keysprefix; the
vector cases "the provider keys are unreachable" and "the provider keys answer an error" fail
if a go-oidc upgrade changes it. - build(mcpauth): its
go.modrequiresdirectoryv0.5.0, as the root module now does; the
replace ../made CI's nested-module step ask forgo mod tidyon the v0.19.0 commit. No
mcpauth code change in that fix alone; it ships inmcpauth/v0.3.0.