Tsing still..

This commit is contained in:
dingo
2026-01-30 22:53:02 -05:00
parent 14bf839699
commit 6979d53f11
2 changed files with 19 additions and 0 deletions
+18
View File
@@ -160,6 +160,24 @@ app.Use(async (ctx, next) =>
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();
+1
View File
@@ -3,6 +3,7 @@
"LogLevel": {
"Default": "Information",
"Microsoft.AspNetCore": "Warning",
"Microsoft.AspNetCore.DataProtection": "Debug",
"Microsoft.EntityFrameworkCore.Database.Command": "Warning"
}
},