fix(mcp): every web sign-in is asked in the window, with a matching code (P15 B1 review, D-90)

An approval is never reused for a new sign-in: the product's redirect host
is public, so a stranger registering a client with claude.ai's callback got
a code with no Allow. /authorize now always parks the request. Every Allow
is a new approval with exactly the permissions ticked, a revoke ends the
approval's tokens at once under the lock, and raising or lowering posting
swaps the token in one step (a revoke during it wins). The window shows a
short code the browser's page also shows, says what is known in neutral
words (where it is sent back to first), counts the requests beyond the
newest few, and no request is presented as a known product on the strength
of its host. Refresh checks and marks the token used in one hold of the
lock, so two refreshes at once cannot both succeed.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
swaitsandClaude Fable 5.2 committed 2026-11-21 12:05:09 -07:00
1 parent 0a91656f14
commit c4fd1580d8
11 files changed
+1461 -615

No files matched your search

+8 -4
View File
@@ -213,11 +213,15 @@ pub struct WebRequest {
pub id: String,
/// The company it asks to reach.
pub book: String,
/// The product recognised by where it is sent back to ("Claude on
/// the web"), else what it calls itself.
/// What it calls itself: its own word, cleaned and short, possibly
/// empty. Never a product's name made from where it is sent back to.
pub client_name: String,
/// Whether the product is one Wanderbooks recognises.
pub recognised: bool,
/// Whether the address it is sent back to is one of the vendors' known
/// hosts. Only the warning depends on it; nothing is shown as known or
/// trusted for it.
pub known_host: bool,
/// The short code to match with the one its browser page shows.
pub code: String,
/// The address it is sent back to, in full.
pub redirect: String,
/// That address's host.