Skip to content

POST /fmsgid: claim an address for a quota pool - #9

Merged
markmnl merged 1 commit into
mainfrom
pool-claim
Oct 29, 2026
Merged

markmnl merged 1 commit into
mainfrom
pool-claim

Conversation

@markmnl

@markmnl markmnl commented Oct 29, 2026

Copy link
Copy Markdown
Owner

Adds an optional claim to POST /fmsgid. With claim: true (which needs quota_pool), the address is registered for that pool only:

  • new: created in the pool (201);
  • already in that pool: used as now, including reinstating (200);
  • anywhere else (in no pool, or another pool): 409, nothing changed.

Why: fmsg-webapi derives sub-addresses from the owner's name (@alice_bot from @alice) and registers them with quota_pool. If @alice_bot is already someone else's address, today's upsert moves it into Alice's pool and reinstates it, and webapi then issues Alice a key for it. A security review found this as an account takeover. fmsg-webapi will send claim (separate PR).

Without claim nothing changes, so admins can still move addresses between pools.

  • TestPostCreateAddress_Claim covers new, in-pool reinstate, someone else's address in no pool, another pool, own pool, and the 400.
  • go test ./... against Postgres 17 passes.
  • README documents claim and the 409.

🤖 Generated with Claude Code

With claim, an address is registered for its quota pool only: created in
the pool, or used when it is already there. An existing address anywhere
else gets 409 and is left unchanged. A service deriving sub-addresses
from an owner's name (@alice_bot from @alice) can then no longer move
someone else's address into its pool or reinstate it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@markmnl
markmnl merged commit 4399f5d into main Oct 29, 2026
1 check passed
@markmnl
markmnl deleted the pool-claim branch October 29, 2026 11:04
markmnl added a commit to markmnl/fmsg-webapi that referenced this pull request Oct 29, 2026
A derived address (@alice_bot from @alice) may already be someone else's:
an identity provider can let anyone sign up as alice_bot. Registration
now claims the address in fmsgid, so one outside the owner's quota pool
gets 409 instead of being moved into the pool, reinstated, and handed to
the owner with an API key. The owner's own deleted sub-accounts are
still reinstated. Needs fmsgid with claim (markmnl/fmsgid#9).

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant