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

+2 -1
View File
@@ -162,7 +162,8 @@ impl ledger_gui::owner::Owner for ViewerOwner {
id: p.id,
book: p.book,
client_name: p.client_name,
recognised: p.product.is_some(),
known_host: p.known_host,
code: p.code,
redirect: p.redirect,
redirect_host: p.redirect_host,
from: p.from,