Tsing still..
This commit is contained in:
+18
@@ -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();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user