-
Notifications
You must be signed in to change notification settings - Fork 317
Move AAD/Entra Authentication into new Azure package #3680
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: feat/azure-split
Are you sure you want to change the base?
Move AAD/Entra Authentication into new Azure package #3680
Conversation
src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlAuthenticationParameters.cs
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Commentary for reviewers and some TODOs for me.
src/Microsoft.Data.SqlClient.Extensions/Abstractions/src/Abstractions.csproj
Show resolved
Hide resolved
src/Microsoft.Data.SqlClient.Extensions/Abstractions/src/SqlAuthenticationMethod.cs
Show resolved
Hide resolved
src/Microsoft.Data.SqlClient.Extensions/Abstractions/src/SqlAuthenticationParameters.cs
Show resolved
Hide resolved
src/Microsoft.Data.SqlClient.Extensions/Abstractions/src/SqlAuthenticationToken.cs
Show resolved
Hide resolved
...ta.SqlClient/src/Microsoft/Data/SqlClient/ActiveDirectoryAuthenticationTimeoutRetryHelper.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlAuthenticationParametersBuilder.cs
Show resolved
Hide resolved
src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlAuthenticationProviderManager.cs
Show resolved
Hide resolved
src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/TdsParserHelperClasses.cs
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Commentary for reviewers.
doc/snippets/Microsoft.Data.SqlClient/SqlAuthenticationProviderManager.xml
Outdated
Show resolved
Hide resolved
ddc22a7 to
71fd319
Compare
a60a025 to
7f88ea6
Compare
71fd319 to
283f241
Compare
src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/TdsParserHelperClasses.cs
Show resolved
Hide resolved
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## feat/azure-split #3680 +/- ##
===================================================
Coverage ? 76.77%
===================================================
Files ? 269
Lines ? 45029
Branches ? 0
===================================================
Hits ? 34573
Misses ? 10456
Partials ? 0
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
7f88ea6 to
c66066a
Compare
- Removed addition of PDBs from <AllowedOutputExtensionsInPackageBuildOutputFolder>. - Removed MDS package ref dependency on Abstractions until pipelines are ready. - Renamed AbstractionsPackage to Abstractions in targets. - Updated BUILDGUIDE based on project ref behaviour. - Added feature branches to CI pipeline triggers. - Added missing/incomplete paths to the trigger. - Added dev/* branches to the CI triggers so PRs that target other dev/ branches can run CI. - Added missing MdsPackageVersion property to signed build pipeline job. - Commented-out failing NuGet tool installer task. - Re-ordered Guardian analysis step _before_ build step to avoid clobbering versioned DLLs. - Added MDS package version to AKV build/package steps. - Restored AKV nuspec ReferenceType property for AKV Official builds. - Explicitly building tooling before analysis. - Fixing validation steps to match XML props files. - Added PR automation triggers, and documented other pipeline sections. - Added ReferenceType throughout the MDS/AKV CI build steps. - Added NuGet.config update to main CI build step for Package reference mode. - Swapped Abstractions download and NuGet.config update to ensure packages/ exists before attempting to re-configure NuGet. - Clean target no longer removes packages/ - Uncommented package refs to Abstractions. - Added separate MDS and AKV project builds to support Package mode. - Added $ReferenceType$ property to MDS .nuspec like it is for AKV. - Removed obsolete version variables from merge conflict. - Adding $ReferenceType$ back to AKV nuspec. - Moved SqlAuthenticationProvider and friends into Abstractions. - Moved ActiveDirectoryAuthenticationProvider into a new Azure package. - Moved a bunch of docs into Abstractions and Azure projects. - Updated Abstractions classes to be abstract with minimal implementation. - Added back the implementations to MDS. - Re-worked some of the docs. - SqlAuthentication* classes separated out into Base classes in Abstractions. - Updated docs accordingly. - MDS compiles. - Some Azure package code moved, but not compiling. - Added an exception class for authentication errors. - Enabled XML doc compilation and validation. - Updated MDS to handle SqlAuthenticationProviderException instead of MSAL exceptions. - Removed Azure.Identity from MDS. - Got existing tests compiling using the new Azure package. - Added Azure package build targets. - Updated docs related to ReferenceType - Got all projects properly adhering to Package reference type. - Removed TestMicrosoftDataSqlClientVersion in favour of MdsPackageVersion. - Fixed tools restore from build.proj. - Fixed missing using for dummy auth provider. - Fixed obsolete warnings for password auth. - Moved SqlAuthenticationParameters entirely into Abstractions, avoiding an empty base class. - Moved SqlAuthenticationToken entirely into Abstractions. - Moved SqlAuthenticationProvider entirely into Abstractions. - Removed SqlAuthenticationProviderBase. - Exposed SqlAuthenticationProviderManager as a public API in MDS. - Moved SetProvider() and GetProvider() to the Manager where they should have been all along (Breaking Change). - Added catch-all exception handlers in prep for proper analysis and specific exception handling. - Some improvements to avoid meaningless nulls. - Added PR/CI pipeline support for the Azure package. - Fixed Abstractions download path. - Updated SqlAuthenticationProviderException to use Method instead of Action. - Fixed NRE in SqlException. - Fixed SqlAuthenticationProviderException use in MDS. - Added chaining Add() to SqlErrorCollection. - Added a useful message when _fedAuthToken is null after attempting to acquire a token. - Fixed auth provider error handling to mimic the old code. - Removing unnecessary database checks that are hanging forever. - Fixed timestamp truncation from long to uint causing cached tokens to be erroneously expired.
87be738 to
224a316
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Commentary for reviewers, and a few things for me to fix.
src/Microsoft.Data.SqlClient.Extensions/Abstractions/doc/SqlAuthenticationProviderException.xml
Show resolved
Hide resolved
...rosoft.Data.SqlClient.Extensions/Abstractions/test/SqlAuthenticationProviderExceptionTest.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.Data.SqlClient.Extensions/Abstractions/test/SqlAuthenticationTokenTest.cs
Show resolved
Hide resolved
src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlAuthenticationProviderManager.cs
Show resolved
Hide resolved
src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlException.cs
Show resolved
Hide resolved
src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/TdsParserHelperClasses.cs
Show resolved
Hide resolved
...rosoft.Data.SqlClient/tests/ManualTests/SQL/DataClassificationTest/DataClassificationTest.cs
Show resolved
Hide resolved
src/Microsoft.Data.SqlClient.Extensions/Azure/src/AuthenticationException.cs
Show resolved
Hide resolved
...crosoft.Data.SqlClient/src/Microsoft/Data/SqlClient/ActiveDirectoryAuthenticationProvider.cs
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Partial 45/89 review
src/Microsoft.Data.SqlClient.Extensions/Abstractions/doc/SqlAuthenticationProvider.xml
Outdated
Show resolved
Hide resolved
src/Microsoft.Data.SqlClient.Extensions/Abstractions/doc/SqlAuthenticationParameters.xml
Outdated
Show resolved
Hide resolved
src/Microsoft.Data.SqlClient.Extensions/Abstractions/src/SqlAuthenticationProvider.cs
Show resolved
Hide resolved
src/Microsoft.Data.SqlClient.Extensions/Abstractions/src/SqlAuthenticationToken.cs
Show resolved
Hide resolved
src/Microsoft.Data.SqlClient.Extensions/Abstractions/test/SqlAuthenticationMethodTest.cs
Show resolved
Hide resolved
src/Microsoft.Data.SqlClient.Extensions/Abstractions/test/SqlAuthenticationParametersTest.cs
Show resolved
Hide resolved
...rosoft.Data.SqlClient.Extensions/Abstractions/test/SqlAuthenticationProviderExceptionTest.cs
Show resolved
Hide resolved
src/Microsoft.Data.SqlClient.Extensions/Azure/src/AuthenticationException.cs
Show resolved
Hide resolved
src/Microsoft.Data.SqlClient.Extensions/Azure/test/Azure.Test.csproj
Outdated
Show resolved
Hide resolved
…r to maintain API for now. - Addressed review comments.
- Added some config improvements to xUnit runners.
src/Microsoft.Data.SqlClient.Extensions/Abstractions/src/SqlAuthenticationParameters.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.Data.SqlClient.Extensions/Abstractions/src/SqlAuthenticationProvider.cs
Show resolved
Hide resolved
src/Microsoft.Data.SqlClient.Extensions/Abstractions/src/SqlAuthenticationProviderInternal.cs
Show resolved
Hide resolved
src/Microsoft.Data.SqlClient.Extensions/Abstractions/test/SqlAuthenticationProviderTest.cs
Outdated
Show resolved
Hide resolved
c66066a to
287309f
Compare
- Reverted SqlAuthenticationParameters authenticationTimeout constructor argument to its original name connectionTimeout and added docs explaining why.
doc/snippets/Microsoft.Data.SqlClient/SqlAuthenticationProviderManager.xml
Outdated
Show resolved
Hide resolved
src/Microsoft.Data.SqlClient.Extensions/Abstractions/src/SqlAuthenticationParameters.cs
Outdated
Show resolved
Hide resolved
- Moved some tests around to get access to internals and to compile everywhere.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I reverted all of the previous public API changes and left notes about what we may want to bring back in the future.
Overview
This PR contains changes to move the
ActiveDirectoryAuthenticationProviderout of the MDS package and into the new Azure package. Please refer to the design here:MDS Azure Extension Design
This PR is only concerned with moving the provider code out of MDS and creating the necessary base classes and types in the Abstractions package, which includes:
ActiveDirectoryAuthenticationProvider.csfile into the Azure package.Future PRs will address:
AcquireToken()method.This builds on the previous 2 PRs:
Testing
All existing tests in the MDS project are passing. This confirms that the move didn't break anything that is currently being tested.