Skip to main content
← Back to list
01Issue
FeatureShippedSwamp ClubPublic
Assigneesstack72

Relationships

#1675 docs: document SWAMP_API_KEY headless OAuth bootstrap for swamp serve

Opened by stack72 · 8/16/2026· Shipped 8/16/2026

Context

PR swamp-club/swamp#2160 added headless OAuth client bootstrap via SWAMP_API_KEY. When a collective API token with oauth:manage scope is set as SWAMP_API_KEY, swamp serve --auth-mode oauth can register an OAuth client, resolve admin usernames, and start the server without any browser interaction.

Documentation needed

The user-facing manual needs updates:

  1. Reference docs for swamp serve — document the SWAMP_API_KEY env var behavior with --auth-mode oauth:

    • Token must have oauth:manage scope (in addition to serve:* for instance registration/heartbeats)
    • When set and no stored OAuth client credentials exist, headless registration is used instead of device grant
    • API key is read fresh from env on each boot — key rotation is transparent
    • Also used for admin/allowed-user username resolution
  2. How-to guide for headless/unattended deployment — a task-oriented guide covering:

    • Creating a collective API token with oauth:manage + serve:* scopes
    • Setting SWAMP_API_KEY in the deployment environment (Kubernetes secret, env var, etc.)
    • Running swamp serve --auth-mode oauth --oauth-provider <url> --allowed-collectives <slug> --admins <username>
    • Verifying the headless bootstrap succeeded (log output to look for)

Boot flow for reference

SWAMP_API_KEY set?
├─ No  → existing device-grant flow (unchanged)
└─ Yes → stored OAuth client credentials?
         ├─ Yes → use stored credentials (unchanged)
         └─ No  → validate key via /api/whoami
                   → check oauth:manage scope
                   → POST /api/auth/oauth2/register
                   → store client_id + client_secret in vault
                   → resolve admin usernames via SWAMP_API_KEY
                   → register instance
                   → start heartbeats
                   → server ready, zero browser interaction
02Bog Flow
OPENTRIAGEDIN PROGRESSSHIPPED+ 2 MORETRIAGE+ 2 MOREREVIEW+ 4 MOREPR_MERGED+ 2 MORESESSION_SUMMARIZED

Shipped

8/16/2026, 11:54:37 PM

Click a lifecycle step above to view its details.

03Sludge Pulse
stack72 assigned stack728/16/2026, 11:09:56 PM

Sign in to post a ripple.