From 26bb0ac268b67c956f2086bf1e0b236f22add540 Mon Sep 17 00:00:00 2001 From: gamer147 Date: Wed, 27 May 2026 14:31:06 -0400 Subject: [PATCH] auth: link Steam to UDID-keyed viewer on first authenticated request After /tool/signup, the client has a viewer_id but no Steam social row. The first authenticated request (typically /check/game_start) carries the Steam ticket; if the SteamId lookup misses but the UDID resolves to a viewer, attach the Steam social now. Subsequent requests hit the fast SteamId path. Closes the CheckController.GameStart TODO that was blocking fresh-client boot. Co-Authored-By: Claude Opus 4.7 --- .../Controllers/CheckController.cs | 4 --- .../SteamSessionAuthenticationHandler.cs | 34 +++++++++++++++---- 2 files changed, 27 insertions(+), 11 deletions(-) diff --git a/SVSim.EmulatedEntrypoint/Controllers/CheckController.cs b/SVSim.EmulatedEntrypoint/Controllers/CheckController.cs index ba02b24..c957023 100644 --- a/SVSim.EmulatedEntrypoint/Controllers/CheckController.cs +++ b/SVSim.EmulatedEntrypoint/Controllers/CheckController.cs @@ -30,10 +30,6 @@ public class CheckController : SVSimController }); } - // TODO: spec lists this as anonymous (identity from SHORT_UDID), but the base controller's - // [Authorize] still applies. For now requires a Steam-linked viewer; new-user bootstrap (where - // the server creates a viewer + returns rewrite_viewer_id) is deferred until the boot flow is - // exercised end-to-end with a real client. [HttpPost("game_start")] public async Task GameStart(GameStartRequest request) { diff --git a/SVSim.EmulatedEntrypoint/Security/SteamSessionAuthentication/SteamSessionAuthenticationHandler.cs b/SVSim.EmulatedEntrypoint/Security/SteamSessionAuthentication/SteamSessionAuthenticationHandler.cs index 823bba1..e3b877e 100644 --- a/SVSim.EmulatedEntrypoint/Security/SteamSessionAuthentication/SteamSessionAuthenticationHandler.cs +++ b/SVSim.EmulatedEntrypoint/Security/SteamSessionAuthentication/SteamSessionAuthenticationHandler.cs @@ -97,13 +97,33 @@ public class SteamSessionAuthenticationHandler : AuthenticationHandler