refactor(sdk): namespace hygiene — conventional namespaces, de-stutter, and AAuth.Server split#31
Merged
Merged
Conversation
Phase 1 of the SDK namespace-hygiene plan. AAuth DI registration and app-builder extensions now live in Microsoft.Extensions.DependencyInjection and Microsoft.AspNetCore.Builder, and their options records move to the AAuth root. Callers can register AAuth with no extra 'using AAuth.DependencyInjection'. Also adds the namespace-hygiene research + implementation plan.
Phase 2 of the namespace-hygiene plan. Renames AAuthMission->Mission, AAuthAgentId->AgentId, AAuthServerId->ServerId, AAuthInteraction->Interaction, AAuthClaimsRequirement->ClaimsRequirement, AAuthClaimsResponse->ClaimsResponse via language-server rename, and renames the matching source files. AAuthVerificationResult is kept to avoid colliding with the existing public VerificationResult in AAuth.Server (deviation recorded in the plan).
Phase 3 of the namespace-hygiene plan. Moves AccessServerClient, AccessServerRequest, IAccessPolicy (+AccessDecision/AccessPolicyRequest), IAccessPendingStore (+AccessPendingEntry/InMemoryAccessPendingStore), and AAuthAccessServerEndpoints (+AAuthAccessServerOptions) from AAuth.Tokens and AAuth.Server into a single AAuth.Access namespace under src/AAuth/Access/. Updates sample servers and federation tests with the new using.
Phase 4 of the namespace-hygiene plan. Moves AAuthClientBuilder, SelfIssuingBuilder, EnrolledBuilder and BootstrapBuilder out of AAuth.HttpSig into the root AAuth namespace (Option A) so apps reach them with a single 'using AAuth'. Signing internals stay in AAuth.HttpSig. Updates sample and tour consumers plus the SampleApp _Imports.razor.
Phase 5 of the namespace-hygiene plan. Regroups the AAuth.Server types into AAuth.Server.Verification, .Challenge, .Authorization, .Metadata and .CallChaining sub-namespaces with matching folders; JTI/opaque-token stores and the revocation endpoint stay at the AAuth.Server root. Updates the DI/builder extensions and all in-repo callers (samples, conformance and unit tests) with the new sub-namespace imports.
Phase 6 of the namespace-hygiene plan. Sweeps the teaching surface (docs, READMEs and embedded example snippets) so every 'using' directive and type name matches the relocated namespaces: builders under root AAuth, four-party types under AAuth.Access, and the AAuth.Server.* concern sub-namespaces. No compiled code changes — prose and example snippets only.
There was a problem hiding this comment.
Pull request overview
Refactors the AAuth SDK’s public namespaces and type names to better match .NET conventions (DI/builder extension namespaces, reduced AAuth* stutter, consolidated access-server surface, and AAuth.Server split), with corresponding updates across tests, samples, and documentation.
Changes:
- Moves DI/app-builder extensions into
Microsoft.Extensions.DependencyInjectionandMicrosoft.AspNetCore.Builder, and relocates related options records to the rootAAuthnamespace. - Renames several public surface types to remove redundant
AAuthprefixes (e.g.,AAuthInteraction→Interaction,AAuthAgentId→AgentId,AAuthServerId→ServerId,AAuthClaims*→Claims*). - Introduces/uses concern-based namespaces (
AAuth.Access,AAuth.Server.{Verification,Challenge,Authorization,Metadata,CallChaining}) and updates call sites.
Show a summary per file
| File | Description |
|---|---|
| tests/AAuth.Tests/Server/AAuthScopeHandlerTests.cs | Update server namespace imports |
| tests/AAuth.Tests/Server/AAuthHttpContextExtensionsTests.cs | Update server namespace imports |
| tests/AAuth.Tests/Integration/WhoAmIFlowTests.cs | Update Interaction type + server imports |
| tests/AAuth.Tests/Integration/MockPersonServerTests.cs | Update Interaction type references |
| tests/AAuth.Tests/Integration/MockPersonServerFederationTests.cs | Update Interaction type + Access namespace import |
| tests/AAuth.Tests/HttpSig/InteractionHandlerTests.cs | Update Interaction type references |
| tests/AAuth.Tests/HttpSig/AAuthClientBuilderTests.cs | Update server namespace imports |
| tests/AAuth.Tests/Headers/AAuthInteractionTests.cs | Update renamed Interaction APIs |
| tests/AAuth.Tests/DependencyInjection/AAuthResourceDITests.cs | Update DI namespace expectations/usings |
| tests/AAuth.Tests/DependencyInjection/AAuthDiscoveryDITests.cs | Update DI namespace expectations/usings |
| tests/AAuth.Tests/DependencyInjection/AAuthAgentDITests.cs | Update DI namespace expectations/usings |
| tests/AAuth.Tests/Configuration/OptionsThreadingTests.cs | Update DI options namespace/usings |
| tests/AAuth.Tests/Agent/InteractionChainingTests.cs | Update Interaction type references |
| tests/AAuth.Tests/Agent/ChallengeHandlerTests.cs | Update Interaction callback type |
| tests/AAuth.Tests/AccessServerClientTests.cs | Update Claims/Access surface types |
| tests/AAuth.Conformance/ResourceTokens/OpaqueTokenStoreTests.cs | Update server namespace imports |
| tests/AAuth.Conformance/Observability/PreferWaitHeaderTests.cs | Update server namespace imports |
| tests/AAuth.Conformance/Observability/ActivityDiagnosticsTests.cs | Update DI options namespace/usings |
| tests/AAuth.Conformance/Identifiers/ServerIdTests.cs | Update ServerId renamed type |
| tests/AAuth.Conformance/Identifiers/AgentIdTests.cs | Update AgentId renamed type |
| tests/AAuth.Conformance/HttpSignatures/VerificationMiddlewareTests.cs | Update DI options + server imports |
| tests/AAuth.Conformance/HttpSignatures/NamingJwtValidationTests.cs | Update DI options + server imports |
| tests/AAuth.Conformance/HttpSignatures/JktJwtAndEcdsaTests.cs | Update DI options + server imports |
| tests/AAuth.Conformance/HttpSignatures/ChallengeMiddlewareTests.cs | Update DI options + server imports |
| tests/AAuth.Conformance/HttpSignatures/AuthorizationIntegrationTests.cs | Update DI options + server imports |
| tests/AAuth.Conformance/Errors/SignatureErrorTests.cs | Update DI options + server imports |
| tests/AAuth.Conformance/Discovery/WellKnownMetadataTests.cs | Update server namespace imports |
| tests/AAuth.Conformance/Discovery/JtiStoreAndRevocationTests.cs | Update server namespace imports |
| tests/AAuth.Conformance/Discovery/AllRolesWellKnownMetadataTests.cs | Update server namespace imports |
| tests/AAuth.Conformance/CallChaining/UseAAuthIntermediaryTests.cs | Update DI options + server imports |
| tests/AAuth.Conformance/CallChaining/CallChainingRouterTests.cs | Update server namespace imports |
| tests/AAuth.Conformance/CallChaining/CallChainingHandlerTests.cs | Update server namespace imports |
| tests/AAuth.Conformance/AuthTokens/CallChainingTests.cs | Update server namespace imports |
| src/AAuth/Server/Verification/AAuthVerificationResult.cs | Move to AAuth.Server.Verification |
| src/AAuth/Server/Verification/AAuthVerificationOptions.cs | Move to AAuth.Server.Verification |
| src/AAuth/Server/Verification/AAuthVerificationMiddleware.cs | Move to AAuth.Server.Verification + fix imports |
| src/AAuth/Server/Verification/AAuthLevel.cs | Move to AAuth.Server.Verification |
| src/AAuth/Server/Verification/AAuthHttpContextExtensions.cs | Move to AAuth.Server.Verification |
| src/AAuth/Server/Verification/AAuthAuthenticationHandler.cs | Move to AAuth.Server.Verification |
| src/AAuth/Server/Verification/AAuthAccessMode.cs | Move to AAuth.Server.Verification |
| src/AAuth/Server/Metadata/WellKnownEndpoints.cs | Move to AAuth.Server.Metadata |
| src/AAuth/Server/Metadata/AAuthPersonServerMetadataOptions.cs | Move to AAuth.Server.Metadata |
| src/AAuth/Server/Metadata/AAuthAgentMetadataOptions.cs | Move to AAuth.Server.Metadata |
| src/AAuth/Server/Metadata/AAuthAccessServerMetadataOptions.cs | Move to AAuth.Server.Metadata |
| src/AAuth/Server/Challenge/ChallengeOptions.cs | Move to AAuth.Server.Challenge |
| src/AAuth/Server/Challenge/AAuthChallengeMiddleware.cs | Move to AAuth.Server.Challenge |
| src/AAuth/Server/CallChaining/UpstreamAuthTokenFeature.cs | Move to AAuth.Server.CallChaining |
| src/AAuth/Server/CallChaining/CallChainingRouter.cs | Move to AAuth.Server.CallChaining |
| src/AAuth/Server/CallChaining/CallChainingOptions.cs | Move to AAuth.Server.CallChaining |
| src/AAuth/Server/CallChaining/CallChainingHandler.cs | Move to AAuth.Server.CallChaining + Interaction callback type |
| src/AAuth/Server/Authorization/AAuthScopeRequirement.cs | Move to AAuth.Server.Authorization |
| src/AAuth/Server/Authorization/AAuthScopeHandler.cs | Move to AAuth.Server.Authorization + verification import |
| src/AAuth/SelfIssuingBuilder.cs | Move builder to root AAuth |
| src/AAuth/README.md | Update examples to using AAuth; |
| src/AAuth/Identifiers/ServerId.cs | Rename AAuthServerId → ServerId |
| src/AAuth/Identifiers/AgentId.cs | Rename AAuthAgentId → AgentId |
| src/AAuth/HttpSig/ChallengeHandlingOptions.cs | Update Interaction callback type |
| src/AAuth/Headers/Interaction.cs | Rename AAuthInteraction → Interaction |
| src/AAuth/Headers/ClaimsResponse.cs | Rename AAuthClaimsResponse → ClaimsResponse |
| src/AAuth/Headers/ClaimsRequirement.cs | Rename AAuthClaimsRequirement → ClaimsRequirement |
| src/AAuth/EnrolledBuilder.cs | Move builder to root AAuth |
| src/AAuth/DependencyInjection/AAuthResourceServiceCollectionExtensions.cs | Move extensions to Microsoft.Extensions.DependencyInjection |
| src/AAuth/DependencyInjection/AAuthResourcePipelineOptions.cs | Move options to root AAuth |
| src/AAuth/DependencyInjection/AAuthResourceOptions.cs | Move options to root AAuth |
| src/AAuth/DependencyInjection/AAuthDiscoveryServiceCollectionExtensions.cs | Move extensions to Microsoft.Extensions.DependencyInjection |
| src/AAuth/DependencyInjection/AAuthDiscoveryOptions.cs | Move options to root AAuth |
| src/AAuth/DependencyInjection/AAuthApplicationBuilderExtensions.cs | Move extensions to Microsoft.AspNetCore.Builder |
| src/AAuth/DependencyInjection/AAuthAgentServiceCollectionExtensions.cs | Move extensions to Microsoft.Extensions.DependencyInjection |
| src/AAuth/DependencyInjection/AAuthAgentOptions.cs | Move options to root AAuth + Interaction callback type |
| src/AAuth/BootstrapBuilder.cs | Move builder to root AAuth |
| src/AAuth/Agent/TokenExchangeRequest.cs | Update Interaction callback type + docs |
| src/AAuth/Agent/TokenExchangeClient.cs | Update Interaction extraction helpers |
| src/AAuth/Agent/Mission.cs | Rename AAuthMission → Mission |
| src/AAuth/Agent/InteractionHandler.cs | Update Interaction type usage |
| src/AAuth/Agent/IInteractionPresenter.cs | Update Interaction type usage |
| src/AAuth/Agent/ChallengeHandler.cs | Update Interaction callback type + server import |
| src/AAuth/Agent/AAuthInteractionExceptions.cs | Update chained-exception Interaction property type |
| src/AAuth/Access/IAccessPolicy.cs | Move access policy seam to AAuth.Access |
| src/AAuth/Access/IAccessPendingStore.cs | Move pending store seam to AAuth.Access |
| src/AAuth/Access/AccessServerRequest.cs | Move request DTO to AAuth.Access + renamed callback types |
| src/AAuth/Access/AccessServerClient.cs | Move client to AAuth.Access + renamed requirement/interaction parsing |
| src/AAuth/Access/AAuthAccessServerEndpoints.cs | Move access endpoints to AAuth.Access + renamed headers/types |
| src/AAuth/AAuthClientBuilder.cs | Move builder to root AAuth + adjust imports |
| samples/WhoAmI/Program.cs | Update DI/options and server namespace imports |
| samples/SampleApp/Program.cs | Update DI/options and server namespace imports |
| samples/SampleApp/Components/_Imports.razor | Add @using AAuth |
| samples/Orchestrator/Program.cs | Update Interaction formatting + server namespace imports |
| samples/MockPersonServer/Program.cs | Update Claims/Interaction types + Access namespace import |
| samples/MockAccessServer/Program.cs | Update Access namespace import + server namespace imports |
| samples/MockAccessServer/Policy/StubAccessPolicy.cs | Update Access namespace import + server namespace imports |
| samples/MockAccessServer/Policy/KeycloakAccessPolicy.cs | Update Access namespace import + server namespace imports |
| samples/LiveWhoAmITest/Program.cs | Update server namespace imports + add using AAuth |
| samples/GuidedTour/TourSession.cs | Update Interaction type usage in parsing/snippets |
| samples/GuidedTour/Program.cs | Update DI/options and server namespace imports |
| samples/AgentConsole/Program.cs | Add using AAuth for builder surface |
| README.md | Update top-level snippets to new namespaces |
| docs/workflows/ps-asserted-access.md | Update builder namespace in snippets |
| docs/workflows/identity-based-access.md | Update builder namespace in snippets |
| docs/workflows/federated-access.md | Update Access surface + ClaimsResponse naming in docs |
| docs/workflows/deferred-consent.md | Update presenter signature to Interaction |
| docs/workflows/call-chaining.md | Update builder namespace in snippets |
| docs/workflows/bootstrap-enrollment.md | Update builder namespace in snippets |
| docs/signing-modes/pseudonymous-hwk.md | Update builder namespace in snippets |
| docs/signing-modes/overview.md | Update builder namespace in snippets |
| docs/signing-modes/key-rotation-jkt-jwt.md | Update builder namespace in snippets |
| docs/signing-modes/agent-token-jwt.md | Update builder namespace in snippets |
| docs/signing-modes/agent-identity-jwks-uri.md | Update builder namespace in snippets |
| docs/server/verification-middleware.md | Update DI/options and verification namespace in snippets |
| docs/server/resource-metadata.md | Update metadata namespace in snippets |
| docs/server/replay-detection.md | Update verification namespace in snippets |
| docs/server/multi-scheme-verification.md | Update verification namespace in snippets |
| docs/server/challenge-middleware.md | Update challenge/verification namespace in snippets |
| docs/server/authorization-policies.md | Update DI/options namespace in snippets |
| docs/reference/configuration.md | Update callback type names in reference tables |
| docs/README.md | Update type/name references (but still needs namespace index refresh) |
| docs/getting-started.md | Update builder namespace in snippets |
| docs/concepts.md | Update Mission naming in prose |
| docs/advanced/missions.md | Update Mission naming and sample code |
| docs/advanced/interaction-chaining.md | Update Interaction formatting in snippet |
| .agent/plans/2026-06-03-sdk-namespace-hygiene/research.md | Add research document for namespace hygiene initiative |
| .agent/plans/2026-06-03-sdk-namespace-hygiene/implementation-plan.md | Add phased implementation plan with DoD checklists |
Copilot's findings
- Files reviewed: 121/121 changed files
- Comments generated: 2
Marks the Phase 7 DoD complete and appends the independent no-regression and spec-alignment verification summary (zero behavior changes, renames complete, namespaces consistent, suites green) to the implementation plan.
Addresses PR #31 review feedback: aligns the test class and file name with the renamed Interaction type, and refreshes the docs namespace index to reflect the Microsoft DI/builder namespaces and the AAuth.Server split.
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.
Summary
Namespace-hygiene refactor for the
AAuthSDK. This is a names-and-namespaces-only change — no behavioral changes. It aligns the SDK's public surface with .NET conventions, removes redundantAAuthtype-name stutter, consolidates the four-party access types, and splits the oversizedAAuth.Servernamespace into concern-based sub-namespaces. Per the alpha clean-break policy, there are no compatibility shims.Implements the plan in
.agent/plans/2026-06-03-sdk-namespace-hygiene/.Phases
Add*/Use*extension methods now live inMicrosoft.Extensions.DependencyInjection/Microsoft.AspNetCore.Builder; options records moved to the rootAAuthnamespace.AAuthprefix —AAuthMission→Mission,AAuthAgentId→AgentId,AAuthServerId→ServerId,AAuthInteraction→Interaction,AAuthClaimsRequirement→ClaimsRequirement,AAuthClaimsResponse→ClaimsResponse.AAuthVerificationResultkept (disambiguates from the middleware'sVerificationResult).AAuth.Access(AccessServerClient,AccessServerRequest,IAccessPolicy,IAccessPendingStore, access-server endpoints).AAuth—AAuthClientBuilder,SelfIssuingBuilder,EnrolledBuilder,BootstrapBuildermoved out ofAAuth.HttpSig; signing internals stay inAAuth.HttpSig.AAuth.ServerintoAAuth.Server.{Verification, Challenge, Authorization, Metadata, CallChaining}; JTI/opaque-token stores and revocation stay at theAAuth.Serverroot.usingdirective and type name matches the new layout.Validation
dotnet build AAuth.slnx -v q— clean (0 warnings, 0 errors).dotnet test tests/AAuth.Tests— 371 passed.dotnet test tests/AAuth.Conformance— 346 passed.make demo-federated+ federatedtests/e2ePlaywright suite — green.Notes for reviewers
usingdirectives (no shims). The SDK is in alpha.make demo/make demo-keycloakstart and the GuidedTour/SampleApp render the updated snippets.