Repository navigation
AOT 1: Expose authentication configuration handlers from Abstractions - #4816
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
The compatibility fixture is not run by CI, and its nested commands ignore DotnetPath, leaving key behavior unvalidated and host-dependent.
3 open findings
What changed in this PR
Exposes current and legacy authentication configuration handlers from Abstractions while preserving driver compatibility.
Changes:
- Adds public handlers, type forwarding, documentation, and transitive configuration dependencies.
- Adds schema, forwarding, and separate-process compatibility tests.
- Adds build and package support for the new test fixture.
| File | Description |
|---|---|
BUILDGUIDE.md |
Documents compatibility-test commands. |
build.proj |
Adds the authentication test target. |
doc/samples/SqlAuthenticationProviders.config |
Adds a configuration example. |
src/Microsoft.Data.SqlClient.Extensions/Abstractions/src/Abstractions.csproj |
Adds ConfigurationManager dependency. |
src/Microsoft.Data.SqlClient.Extensions/Abstractions/src/PackageReadme.md |
Documents exposed handlers. |
src/Microsoft.Data.SqlClient.Extensions/Abstractions/src/SqlAuthenticationProviderConfigurationSection.cs |
Defines public configuration handlers. |
src/Microsoft.Data.SqlClient.slnx |
Adds the fixture project. |
src/Microsoft.Data.SqlClient/notsupported/Microsoft.Data.SqlClient.csproj |
Includes type forwards. |
src/Microsoft.Data.SqlClient/ref/Microsoft.Data.SqlClient.csproj |
Includes reference-assembly forwards. |
src/Microsoft.Data.SqlClient/src/Microsoft.Data.SqlClient.nuspec |
Exposes ConfigurationManager compile assets. |
src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlAuthenticationProviderManager.cs |
Removes relocated handler definitions. |
src/Microsoft.Data.SqlClient/src/TypeForwards.Abstractions.cs |
Forwards both handler types. |
src/Microsoft.Data.SqlClient/tests/AuthenticationTests/ConfigurationTest/ConfigurationTest.csproj |
Defines the compatibility executable. |
src/Microsoft.Data.SqlClient/tests/AuthenticationTests/ConfigurationTest/Program.cs |
Validates runtime configuration behavior. |
src/Microsoft.Data.SqlClient/tests/AuthenticationTests/ConfigurationTest/app.config |
Tests the current declaration. |
src/Microsoft.Data.SqlClient/tests/AuthenticationTests/ConfigurationTest/legacy.config |
Tests the legacy declaration. |
src/Microsoft.Data.SqlClient/tests/AuthenticationTests/RunAuthenticationTests.ps1 |
Builds and runs fixture scenarios. |
src/Microsoft.Data.SqlClient/tests/UnitTests/Microsoft/Data/SqlClient/AuthenticationConfigurationSchemaTest.cs |
Verifies public schema compatibility. |
src/Microsoft.Data.SqlClient/tests/UnitTests/TypeForwardTests.cs |
Verifies handler forwarding. |
🧠 Review effort: Balanced
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
e2f2d90 to
6c74ee2
Compare
6c74ee2 to
fd6bc96
Compare
67a6075 to
1a79dde
Compare
1a79dde to
e2d6552
Compare
cheenamalhotra
left a comment
There was a problem hiding this comment.
Type forwards and schema look good. One concern before merge:
- New dependency for .NET Framework apps. The driver's
net462nuspec group never depended onSystem.Configuration.ConfigurationManager. Abstractions only targetsnetstandard2.0, so net462 apps now get SCCM 10.0.0.0 transitively. Apps without auto-generated binding redirects (classic ASP.NET, packages.config, or mixed SCCM versions) can hitFileLoadException. #4817's net462 CI run already shows this load error once redirects are missing.
Smaller items:
- No test covers a real config file with the legacy
SqlAuthenticationProviderssection. FunctionalTestsapp.configonly covers the modern one. - Please add a release-notes entry for the two new public types.
- Consider sealing
SqlClientAuthenticationProviderConfigurationSection; once public, it's hard to change later.
|
@paulmedynski This pull request has been marked as Author attention needed. When you have addressed the reviewer feedback and are ready for another review, please post a comment with |
e2d6552 to
6fc1921
Compare
Use framework configuration in the net462 Abstractions target. Expose sealed sibling handlers with separate source and XML documentation. Keep driver configuration normalization as a temporary bridge to #4821. Cover real legacy/current configuration activation and preserved reader behavior. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>


Description
Move the current and legacy authentication configuration handlers into Microsoft.Data.SqlClient.Extensions.Abstractions while preserving existing app.config declarations.
Why?
Authentication configuration types need to live alongside the provider abstractions so registration can be owned by Abstractions without depending on the driver implementation.
How
Public API and behavior changes
Compared with current
main, this PR adds public configuration infrastructure; it is not only an assembly-internal move.SqlAuthenticationProviderConfigurationSectionNameconstant andProviders,InitializerType,ApplicationClientIdandUseWamBrokergetters.EditorBrowsableState.Never, but still public and available to consumers.SqlClientAuthenticationProviderConfigurationSectionNameconstant and inherited properties.Authentication configuration reading and provider activation retain their existing driver behavior in this PR. Stricter loading is introduced separately in #4860 and wired into the runtime by #4821.
Issues
Related follow-ups: configuration loading in #4860 and registry integration in #4821.
Testing