feat(auth): select ISteamServer impl by Auth:BypassSteamTicket config

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
gamer147
2026-06-03 09:07:51 -04:00
parent c27bf444a5
commit feaa149f04

View File

@@ -149,7 +149,18 @@ public class Program
builder.Services.AddTransient<ShadowverseTranslationMiddleware>();
builder.Services.AddTransient<SessionidMappingMiddleware>();
builder.Services.AddSingleton<ShadowverseSessionService>();
builder.Services.AddSingleton<ISteamServer, FacepunchSteamServer>();
// Steam ticket validation seam. Production uses Facepunch against real Steam. Local dev
// can opt into a no-op validator via Auth:BypassSteamTicket so clients without a real
// Steam session (e.g. a second same-machine instance for the two-client PvP smoke) can
// authenticate. Gate is config-only and ships false everywhere except Development.
if (builder.Configuration.GetValue<bool>("Auth:BypassSteamTicket"))
{
builder.Services.AddSingleton<ISteamServer, DevAlwaysValidSteamServer>();
}
else
{
builder.Services.AddSingleton<ISteamServer, FacepunchSteamServer>();
}
builder.Services.AddSingleton<SteamSessionService>();
builder.Services.AddAuthentication()
.AddScheme<SteamAuthenticationHandlerOptions, SteamSessionAuthenticationHandler>(