Step-up resume UX and editable session-security settings (D-0053) #130
Loading…
Reference in a new issue
No description provided.
Delete branch "feature/stepup-resume-ux"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What does this PR do?
Implements step-up resume UX (D-0053): a step-up-gated POST that arrives without a fresh verification is now captured and replayed after the operator completes step-up, instead of being discarded and forcing the operator to re-enter the form.
AdminStepUpGate: on a gate miss it snapshots the already-buffered form (path plus every field, including the antiforgery token) into an in-memory single-useIPendingStepUpActionStorekeyed by session id, with an expiry from the configurable resume-stash TTL.GET /auth/step-up/continuewhen a pending action exists; that endpoint consumes the stash, finds theRouteEndpointmatching the stored path and POST, rewrites the request into that POST (method, path, urlencoded content type,Request.Form), and invokes itsRequestDelegateso the target re-runs its own antiforgery and step-up gate.session_security_settingstable following the D-0050/D-0051/D-0052 config-store pattern:StepUpValiditySeconds(now read live by the gate and every page's freshness display, replacing the appsettings-onlyAdminAuthOptions.StepUpValidity) andResumeStashTtlSeconds. Seeded on admin-API startup fromSessionSecurityOptions, edited on/configuration#session-security(step-up gated, audited), hot-refreshed on theviegard_config_session_security_settingsNOTIFY channel, and exposed read-only atGET /api/v1/session-security/settings.Bans.razorstep-up freshness with the live session-security value (it previously read the appsettings-only value). The prior 15-minute effective step-up validity is preserved by seeding the newSessionSecuritysection withStepUpValiditySeconds900.Rejected alternatives (see D-0053): middleware re-route (WebApplication adds UseRouting first, so the endpoint is already selected before
app.Usemiddleware); threading the captured form through every gate-fail call site (captured once in the gate instead). The pending stash is process-local and carries the existing in-memory guardrail-state caveat: move to Postgres before running the admin API multi-instance.Fixes #
How was this tested?
dotnet build Viegard.slnx- 0 errors, 0 warningsdotnet test- AdminApi 222 passed, Application 564 passed (Postgres integration suite unchanged from its prior 88-pass run; no persistence-layer change this session)Checklist