fucking versioning. cleaned up debugs

This commit is contained in:
dingo
2026-01-30 23:23:45 -05:00
parent 6297329fda
commit c34d4efeed
3 changed files with 1 additions and 62 deletions
-60
View File
@@ -150,34 +150,6 @@ fwdOpts.KnownProxies.Clear();
app.UseForwardedHeaders(fwdOpts);
app.UseRouting();
app.Use(async (ctx, next) =>
{
var raw = ctx.Request.Headers.Cookie.ToString();
var session = ctx.Request.Cookies[".Divers.Admin.Session"];
if (!string.IsNullOrEmpty(raw))
app.Logger.LogInformation("RAW Cookie Header: {Raw}", raw);
app.Logger.LogInformation("Decoded Session Cookie: {Session}", session ?? "<null>");
await next();
});
app.Use(async (ctx, next) =>
{
// DP round-trip sanity check to verify protect/unprotect uses same key ring.
try
{
var dp = ctx.RequestServices.GetRequiredService<IDataProtectionProvider>();
var protector = dp.CreateProtector("SystemRevivalServer.DPTest");
var protectedValue = protector.Protect("ping");
var unprotectedValue = protector.Unprotect(protectedValue);
app.Logger.LogInformation("DP round-trip OK: {Value}", unprotectedValue);
}
catch (Exception ex)
{
app.Logger.LogError(ex, "DP round-trip FAILED");
}
await next();
});
// ---- Session middleware (must be before routing) ----
app.UseSession();
@@ -268,38 +240,6 @@ app.MapGet("/health/ready", async (IRedisManager rm, HealthCheckService hc) =>
catch { return Results.StatusCode(503); }
});
app.Use(async (ctx, next) =>
{
app.Logger.LogInformation("REQ {Method} {Scheme}://{Host}{Path} CookieHdrLen={Len}",
ctx.Request.Method,
ctx.Request.Scheme,
ctx.Request.Host.Value,
ctx.Request.Path.Value,
ctx.Request.Headers.Cookie.ToString().Length);
await next();
});
app.Use(async (ctx, next) =>
{
var af = ctx.Request.Cookies[".Divers.Admin.AntiForgery"];
app.Logger.LogInformation("AF cookie present={Present} len={Len} prefix={Prefix}",
af != null,
af?.Length ?? 0,
af == null ? "" : af.Substring(0, Math.Min(25, af.Length)));
await next();
if (ctx.Response.Headers.TryGetValue("Set-Cookie", out var setCookies))
{
foreach (var sc in setCookies)
if (sc.Contains(".Divers.Admin.AntiForgery", StringComparison.OrdinalIgnoreCase))
app.Logger.LogInformation("SET-COOKIE AF: {SetCookie}", sc);
else if (sc.Contains(".Divers.Admin.Session", StringComparison.OrdinalIgnoreCase))
app.Logger.LogInformation("SET-COOKIE SESSION: {SetCookie}", sc);
}
});
app.Map("/ws", async (HttpContext httpContext, NetworkManager networkManager) =>
+1 -1
View File
@@ -6,7 +6,7 @@ using GameServices.Auth;
namespace GameServices.Admin.Pages;
[IgnoreAntiforgeryToken]
public class LoginModel : PageModel
{
private readonly GameDbContext _db;
-1
View File
@@ -3,7 +3,6 @@
"LogLevel": {
"Default": "Information",
"Microsoft.AspNetCore": "Warning",
"Microsoft.AspNetCore.DataProtection": "Debug",
"Microsoft.EntityFrameworkCore.Database.Command": "Warning"
}
},