Skip to main content
← Back to list
01Issue
FeatureClosedSwamp CLI
Assigneesstack72

Relationships

#1154 Parse IdP groups from userinfo and wire into grant enforcement

Opened by stack72 · 7/14/2026

Summary

Once swamp-club returns groups: string[] on its userinfo endpoint (see #1153), swamp serve needs to parse those groups, store them on server tokens, and run a background refresh loop to keep them current. The grant enforcement layer already supports idp-group: subjects — this wires up the data.

Work items

1. Parse groups from userinfo response

Extend OAuthUserInfo in src/serve/oauth_client.ts to include groups: string[] and parse it from the userinfo response.

2. Merge groups into server token collectives

In src/serve/device_auth_handler.ts, combine collectives and groups arrays from userinfo into the server token's collectives field. This means idp-group: grant subjects start matching with zero changes to the enforcement layer in src/serve/handlers/shared.ts.

3. Background refresh loop

New module in src/serve/ that:

  • Runs every 4 hours (configurable via --group-refresh-interval)
  • Re-calls swamp-club's userinfo endpoint for each active server token
  • Updates stored collectives/groups if changed
  • Auto-revokes the server token if the user is deprovisioned (refresh token rejected)
  • Handles swamp-club being unreachable gracefully (keep existing snapshot, retry next cycle)

Add --group-refresh-interval flag to src/cli/commands/serve.ts (default 4h, 0 to disable).

Testing

Can be tested without Okta — manually set idpGroups on a swamp-club test user and verify the full swamp-side chain: userinfo returns groups → server token includes them → idp-group: grants match → group removal stops matching after refresh.

Design doc

Full design at resources/sso-idp-group-federation-design.md.

02Bog Flow
OPENTRIAGEDIN PROGRESSCLOSED+ 1 MOREASSIGNED+ 5 MOREREVIEW+ 1 MOREIMPLEMENTATION

Closed

7/16/2026, 1:29:48 AM

No activity in this phase yet.

03Sludge Pulse
stack72 assigned stack727/14/2026, 10:57:56 PM
Editable. Press Enter to edit.

stack72 commented 7/16/2026, 1:30:21 AM

Sign in to post a ripple.