feat(server): exempt Steam-authenticated clients from the Turnstile siteverify - #4702
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
WalkthroughDesktop clients now skip Turnstile token acquisition. Token claims include an optional provider, allowing Steam-authenticated first joins to bypass Turnstile token requirements while preserving readmit handling. ChangesJoin verification flow
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant Client
participant Worker
participant JoinVerify
Client->>Worker: submit join
Worker->>JoinVerify: plan with steamAuthed
JoinVerify-->>Worker: verify with null token
Worker-->>Client: continue join flow
Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
…-imports)
The `import type { TokenPayload }` belongs directly after the vitest import
per prettier-plugin-organize-imports; CI `prettier --check .` flagged it.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BWxUzYb2uqjcBFQuNSJhMy
What
Exempt Steam-authenticated clients from the Turnstile bot-check at the join gate, keying off a signed
provider: "steam"claim in the already-verified session JWT.TokenPayloadSchemagains an optionalproviderfield (additive).JoinVerify.ts:isSteamAuthenticated(claims)(claims?.provider === "steam"), andplanJoinVerifygains a requiredsteamAuthedinput. A Steam-authenticated first join is planned as{action: "verify", token: null}— it rides the existing null-token path that skips the Turnstile siteverify but still runs the/join_verifyname check. First joins are neverskipped.Worker.ts: passessteamAuthed: isSteamAuthenticated(claims)and logs each exemption (persistentID/gameID).Main.ts): the desktop instance skips Turnstile token acquisition (cosmetic — removes the "Failed to load Turnstile script" console error; grants nothing, the exemption is server-side).Why
The Steam desktop build can't produce valid prod Turnstile tokens, so Steam players could connect but not join online games. Steam ownership becomes the anti-abuse signal. The exemption keys only off the signed, server-verified claim — never the forgeable client
instanceId— and Steam users are still name-censored.Testing
tests/server/JoinVerify.test.tsextended (20/20): Steam first-join → verify-with-null-token (neverreject, neverskip); non-Steam behavior unchanged;isSteamAuthenticatedexact-match/null-safe.tsc --noEmitclean; full server suite green (235).Note
The
provider: "steam"claim is minted by the closed auth API (deployed first). Until then this code is inert — no token carries the claim, so nothing is exempted.🤖 Generated with Claude Code
https://claude.ai/code/session_01BWxUzYb2uqjcBFQuNSJhMy