Skip to content

refactor(sdk): namespace hygiene — conventional namespaces, de-stutter, and AAuth.Server split#31

Merged
dasiths merged 8 commits into
mainfrom
feat/sdk-namespace-hygiene
Jun 3, 2026
Merged

refactor(sdk): namespace hygiene — conventional namespaces, de-stutter, and AAuth.Server split#31
dasiths merged 8 commits into
mainfrom
feat/sdk-namespace-hygiene

Conversation

@dasiths
Copy link
Copy Markdown
Collaborator

@dasiths dasiths commented Jun 3, 2026

Summary

Namespace-hygiene refactor for the AAuth SDK. This is a names-and-namespaces-only change — no behavioral changes. It aligns the SDK's public surface with .NET conventions, removes redundant AAuth type-name stutter, consolidates the four-party access types, and splits the oversized AAuth.Server namespace 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

  1. DI/builder extensions → conventional namespacesAdd*/Use* extension methods now live in Microsoft.Extensions.DependencyInjection / Microsoft.AspNetCore.Builder; options records moved to the root AAuth namespace.
  2. Drop redundant AAuth prefixAAuthMission→Mission, AAuthAgentId→AgentId, AAuthServerId→ServerId, AAuthInteraction→Interaction, AAuthClaimsRequirement→ClaimsRequirement, AAuthClaimsResponse→ClaimsResponse. AAuthVerificationResult kept (disambiguates from the middleware's VerificationResult).
  3. Consolidate four-party access types into AAuth.Access (AccessServerClient, AccessServerRequest, IAccessPolicy, IAccessPendingStore, access-server endpoints).
  4. Surface client builders in root AAuthAAuthClientBuilder, SelfIssuingBuilder, EnrolledBuilder, BootstrapBuilder moved out of AAuth.HttpSig; signing internals stay in AAuth.HttpSig.
  5. Split AAuth.Server into AAuth.Server.{Verification, Challenge, Authorization, Metadata, CallChaining}; JTI/opaque-token stores and revocation stay at the AAuth.Server root.
  6. Sweep docs, READMEs and embedded snippets so every using directive 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 + federated tests/e2e Playwright suite — green.

Notes for reviewers

  • Clean break: callers must update using directives (no shims). The SDK is in alpha.
  • make demo / make demo-keycloak start and the GuidedTour/SampleApp render the updated snippets.

dasiths added 6 commits June 3, 2026 12:13
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.
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.DependencyInjection and Microsoft.AspNetCore.Builder, and relocates related options records to the root AAuth namespace.
  • Renames several public surface types to remove redundant AAuth prefixes (e.g., AAuthInteractionInteraction, AAuthAgentIdAgentId, AAuthServerIdServerId, 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 AAuthServerIdServerId
src/AAuth/Identifiers/AgentId.cs Rename AAuthAgentIdAgentId
src/AAuth/HttpSig/ChallengeHandlingOptions.cs Update Interaction callback type
src/AAuth/Headers/Interaction.cs Rename AAuthInteractionInteraction
src/AAuth/Headers/ClaimsResponse.cs Rename AAuthClaimsResponseClaimsResponse
src/AAuth/Headers/ClaimsRequirement.cs Rename AAuthClaimsRequirementClaimsRequirement
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 AAuthMissionMission
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

Comment thread tests/AAuth.Tests/Headers/InteractionTests.cs
Comment thread docs/README.md
dasiths added 2 commits June 3, 2026 14:38
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.
@dasiths dasiths merged commit 0cb3c8e into main Jun 3, 2026
2 checks passed
@dasiths dasiths deleted the feat/sdk-namespace-hygiene branch June 3, 2026 15:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants