Skip to content

Expose authentication configuration handlers from Abstractions - #4816

Draft
paulmedynski wants to merge 1 commit into
dev/paul/aot/phase-1.1from
dev/paul/aot/phase-1.2
Draft

paulmedynski wants to merge 1 commit into
dev/paul/aot/phase-1.1from
dev/paul/aot/phase-1.2

Conversation

@paulmedynski

Copy link
Copy Markdown
Contributor

Description

Expose the current and legacy authentication configuration handlers from Abstractions while preserving existing app.config declarations.

  • Preserve full type/section names, schema, constants and empty defaults.
  • Forward both handler types from driver, reference and unsupported-platform assemblies.
  • Make ConfigurationManager a transitive compile dependency; remove the driver's nuspec compile exclusions.
  • Keep the old manager and SqlAuthenticationInitializer in the driver for this intermediate layer.
  • Add public documentation, a configuration sample and separate-process compatibility fixtures under tests/AuthenticationTests/, outside the Abstractions unit-test project.

Layer 2 of 6 in the seven-PR phase-one authentication stack; based on Logging-owned family-version validation.

Issues

No issue is automatically closed by this compatibility layer.

Testing

The two new handler-identity tests failed before relocation, then passed after implementation.

  • dotnet test src/Microsoft.Data.SqlClient/tests/UnitTests/Microsoft.Data.SqlClient.UnitTests.csproj -c Release -f net10.0 --filter 'FullyQualifiedName~AuthenticationConfigurationSchemaTest|FullyQualifiedName~TypeForwardTests' --blame-hang-timeout 10m --verbosity quiet — passed, 9 tests, including after rebasing onto the preceding layer.
  • dotnet build build.proj -t:TestAuthenticationConfiguration -p:Configuration=Release -p:TestFramework=net10.0 -p:ReferenceType=Project -v:m — passed, current and legacy real app.config declarations; zero warnings/errors.
  • dotnet build build.proj -t:BuildSqlClient -p:Configuration=Release -p:ReferenceType=Project -v:q — passed, driver net462/net10.0 and reference/unsupported net462/net10.0/netstandard2.0; zero warnings/errors.
  • NUGET_PACKAGES=/home/paul/.copilot/session-state/2eb9e30f-a8b8-40d3-ba6a-0f07157aae76/files/pr2-package-cache dotnet build build.proj -t:TestAuthenticationConfiguration -p:Configuration=Release -p:TestFramework=net10.0 -p:ReferenceType=Package -p:PackageVersionSqlClient=7.1.0-stack.2.final -v:m — passed, fresh production packages and both runtime scenarios. The package-only fixture directly compiles the public handler and ConfigurationSection base type using transitive assets.
  • NUGET_PACKAGES=/home/paul/.copilot/session-state/2eb9e30f-a8b8-40d3-ba6a-0f07157aae76/files/pr2-package-cache dotnet build src/Microsoft.Data.SqlClient/tests/AuthenticationTests/ConfigurationTest/ConfigurationTest.csproj -c Release -f net462 -p:ReferenceType=Package -p:SqlClientPackageVersion=7.1.0-stack.2.final -v:q — passed, cross-build only.
  • git diff --check — passed before commit.

An initial concurrent build encountered a shared obj file-in-use error; sequential retries passed. .NET Framework execution was not performed on Linux. NuGet emitted pre-existing informational missing-readme notices during driver packaging.

Guidelines

Please review the contribution guidelines before submitting a pull request:

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings October 9, 2026 18:24
@github-project-automation github-project-automation Bot moved this to To triage in SqlClient Board Oct 9, 2026
@paulmedynski
paulmedynski added this pull request to stack #4822 October 9, 2026 18:25

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 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.

Comment thread build.proj
<AuthenticationPackageVersionArgument Condition="'$(PackageVersionSqlClient)' != ''">-PackageVersionSqlClient "$(PackageVersionSqlClient)"</AuthenticationPackageVersionArgument>
<TestAuthenticationConfigurationDependsOn Condition="'$(ReferenceType)' == 'Package' AND '$(SkipDependencyPack)' != 'true'">PackSqlClient</TestAuthenticationConfigurationDependsOn>
</PropertyGroup>
<Target Name="TestAuthenticationConfiguration" DependsOnTargets="$(TestAuthenticationConfigurationDependsOn)">

function Invoke-DotNet {
param([string[]]$CommandArguments)
& dotnet @CommandArguments
[ConfigurationProperty("applicationClientId", IsRequired = false)]
public string ApplicationClientId => this["applicationClientId"] as string ?? string.Empty;

/// <summary>Gets the Windows Authentication Manager broker preference, or an empty string when unset.</summary>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: To triage

Development

Successfully merging this pull request may close these issues.

2 participants