Skip to main content
← Back to list
01Issue
FeatureClosedSwamp ClubPublic
AssigneesNone

Relationships

#3419 Docs: grant-file username: subjects in the swamp serve manual

Opened by stack72 · 10/13/2026

swamp-club#3123 (PR swamp-club/swamp#3089) adds username:<name> subjects to grant files. The manual should document them in content/manual/reference/swamp-serve.md (grant file syntax), and possibly in the swamp-serve how-to on declarative grants.

What to cover:

The form

  • username:<name> works in grant files only, and only in OAuth mode. Example: subjects: [username:alice, username:bob]
  • user:<x> is still the principal id: the OAuth sub, or the username under token auth.
  • Token and none modes reject username:. With token auth, write user:<name>.

Resolution and pinning

  • Each name is resolved once with the provider's /api/auth/resolve-user endpoint, pinned, and stored as a user:<sub> grant.
  • A grant follows the account, not the name. After a rename or re-registration, the new owner of a name inherits neither its allows nor its denies.
  • A name not found is recorded and never looked up again. Its file is rejected until the name is removed. To recover, remove the name from every file, reload or restart serve, then add it back.
  • Startup looks new names up with the collective API key or a device grant. A serve run by a process manager needs SWAMP_API_KEY or --club-api-key-file.
  • While serve runs, auto-reload and swamp access reload look up new names only with the collective API key. Otherwise the file is held back until serve restarts.
  • Limit: at most 200 new names per load.

check-config

  • In OAuth mode it looks every name up afresh and can't see serve's pins.

The source of truth is the "Usernames in grant files" section of design/enablers/access-control.md in the swamp repo.

02Bog Flow
✓OPEN○TRIAGED○IN PROGRESS◉CLOSED

Closed

10/14/2026, 3:44:18 AM

No activity in this phase yet.

03Sludge Pulse
Editable. Press Enter to edit.

stack72 commented 10/14/2026, 3:44:17 AM

Documented in swamp-club/swamp-club#1340 (merged). content/manual/reference/swamp-serve/authorization.md has a new 'Usernames in grant files' section: username: in grant files, OAuth mode only (token and none reject it, with the real check-config error; use user: under token auth); resolution via /api/auth/resolve-user stored as user:; pinning (a grant follows the account, a name not found is recorded and its file rejected, how to recover by removing, reloading and re-adding); startup lookups with the collective API key or a device grant vs auto-reload and swamp access reload with the API key only; the 200-new-names cap; and check-config looking every name up afresh without serve's pins. The Subjects table and swamp-serve.md glossary mention it too. Live at https://swamp-club.com/manual/reference/swamp-serve/authorization#usernames-in-grant-files

Sign in to post a ripple.