Relationships
#4475 Slackwater: spike on delegated credentials through serve
Opened by skunk-ape · 11/6/2026· Shipped 11/6/2026
Part of #4459. Needs #4460, which has shipped.
Problem
The biggest unknown in #4459 is how delegated credentials work end to end. A test Slack app has shown that serve's handlers already enforce grants and record both identities, but it used a stand-in for sign-in. Integration registration, the swamp-club link page and delegation all depend on the answers below, so we should find out before designing them.
This is a spike. The output is a written result and a proposed contract, and no production code merges from it.
Questions
1. Link request through swamp-club
- Can a link use swamp-club's existing device grant, or does it need its own flow? Today serve starts a grant, the person goes to
/devicethrough login and SSO, and serve polls. The grant lasts 30 minutes. - How does the request carry the integration, ceiling and external identity so that the consent page can show them, without swamp-club having to trust the app?
- What does serve receive when the person approves, and how does it tell that the result belongs to this request?
- How do serve's report and swamp-club's acknowledgement work, so that no tokens are issued until the link is recorded and its email can go out?
- How does a "this wasn't me" action from the email reach serve, given that serve only makes outbound calls?
- SSO must reach the consent page. Test this rather than reading it from the code.
2. Connection layer
- How is a delegated token stored and told apart from a login token? What has to change on the token record, given the client #4460 added?
- Where does a ceiling get checked so that every request path, over HTTP and WebSocket, applies it? Is there a single place, or would each handler need to change?
- When a delegation or integration is revoked, how quickly do open connections and in-flight requests stop?
3. Follower forwarding
- Does a delegated token work through a follower, with the ceiling applied and the same principal and client recorded?
- Where do integrations and delegations live, and how do they reach other serves in a team? What happens to a revocation during a partition?
4. oauth refresh
- How does the life of a delegation relate to the person's swamp-club session? Is weekly re-linking really the limit for a pilot?
- Serve's refresh appears to revoke a token only on a 401, so existing links should keep working while swamp-club is down. This comes from reading
collective_refresh_service.tsand hasn't been tested, so test it. - A person removed at the IdP or from swamp-club: how long until their delegated tokens stop?
5. Consent risks, for the security review
- A forwarded one-time URL could link the sender's Slack account to the person who approves it. What does the flow let us check? For example, could the Slack account's email be matched against the signed-in person as an extra check?
How
Build throwaway code against a local serve in oauth mode and a local swamp-club, with TLS or a proxy in front if that's cheap. Mark each answer as tested or read from the code.
Out of scope
Production code, the Slack app itself, and the HTTP route, which has its own item under #4459.
Done when
- Each question above has a written answer, marked as tested or read from the code.
- There is a proposed link request contract between serve and swamp-club, detailed enough to write the swamp-club link page and delegation items from.
- The result says where a ceiling gets enforced, and whether any plan in #4459 needs to change.
- The result is posted on this issue, and #4459's list is updated if the work changes.
Shipped
Click a lifecycle step above to view its details.
skunk-ape commented 11/6/2026, 5:40:57 PM
The spike on delegated credentials is finished. No production code came from it.
- Linking: a link needs its own flow beside the device grant, on the same login and SSO pages. A prototype ran end to end, and OIDC SSO reached the consent page in a browser.
- Link contract: serve authenticates each call with its registered client credential, and swamp-club never calls serve. No token is issued until swamp-club has recorded the link and queued its email. Reports can be retried safely, and redeeming a link is once only.
- "This wasn't me": serve learns of it by polling a per-serve change feed, so no inbound call is needed.
- Ceiling: it can be enforced in one place, inside the access decision service, with no handler changes. With an empty ceiling, 119 of 131 WebSocket request types were refused. The other 12 are accounted for, though 3 of them weren't exercised.
- Followers: the ceiling applied, and the same principal and client were recorded through a follower. This ran in-process, so it still needs a run with real binaries.
- Lifetimes: weekly re-linking isn't the limit, because refresh keeps the session alive.
- Mixed versions: later items need a capability check before a link starts, and ceilings should be their own record type.
Not tested: SAML, TLS, real team replication, real email delivery and real IdP behaviour.
Sign in to post a ripple.