Refactor Diagnostics Index to use MediatR query pattern#1388
Merged
StuartFerguson merged 2 commits intomasterfrom Apr 12, 2026
Merged
Refactor Diagnostics Index to use MediatR query pattern#1388StuartFerguson merged 2 commits intomasterfrom
StuartFerguson merged 2 commits intomasterfrom
Conversation
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 3 |
| Duplication | 0 |
TIP This summary will be updated as you push new changes. Give us feedback
Agent-Logs-Url: https://github.com/TransactionProcessing/SecurityService/sessions/1da5f7a9-f5a4-4970-9f4a-b47a4bc5cea5 Co-authored-by: StuartFerguson <[email protected]>
Copilot
AI
changed the title
[WIP] Refactor diagnostics index to use commands and queries
Refactor Diagnostics Index to use MediatR query pattern
Apr 12, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The
Diagnostics/Indexpage model contained inline business logic (IP loopback check, authentication, claims extraction) rather than delegating through MediatR as every other page in the service does.Changes
OidcCommands— addedDiagnosticsQuery(HttpContext)OidcResults— addedDiagnosticsQueryResultdiscriminated union (DiagnosticsPageResult,DiagnosticsNotFoundResult,DiagnosticsChallengeResult) and movedDiagnosticItemhere from the page modelDiagnosticsRequestHandler(new) — handlesDiagnosticsQuery; owns all logic previously inlined in the page: loopback guard,AuthenticateAsync, claims/properties projectionPages/Diagnostics/Index.cshtml.cs— now injects onlyIMediator, sends the query, and pattern-matches the result to anIActionResultWarning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
f.feedz.io/usr/bin/dotnet dotnet build SecurityService.slnx --configuration Release -main/dist/indexcredential.helper(dns block)/opt/hostedtoolcache/CodeQL/2.25.1/x64/codeql/csharp/tools/linux64/Semmle.Autobuild.CSharp /opt/hostedtoolcache/CodeQL/2.25.1/x64/codeql/csharp/tools/linux64/Semmle.Autobuild.CSharp(dns block)/usr/bin/dotnet dotnet restore --no-dependencies /home/REDACTED/work/SecurityService/SecurityService/SecurityService.slnx --packages /tmp/codeql-scratch-89cd281515db216c/dbs/csharp/working/packages /p:DisableImplicitNuGetFallbackFolder=true --verbosity normal /p:TargetFrameworkRootPath=/tmp/codeql-scratch-89cd281515db216c/dbs/csharp/working/emptyFakeDotnetRoot /p:NetCoreTargetingPackRoot=/tmp/codeql-scratch-89cd281515db216c/dbs/csharp/working/emptyFakeDotnetRoot /p:AllowMissingPrunePackageData=true(dns block)If you need me to access, download, or install something from one of these locations, you can either: