8000 6.0 | APIScan | MSAL `WithClientName` by benrr101 · Pull Request #3360 · dotnet/SqlClient · GitHub
[go: up one dir, main page]

Skip to content

6.0 | APIScan | MSAL WithClientName #3360

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

Merged
merged 3 commits into from
May 23, 2025

Conversation

benrr101
Copy link
Contributor

Description: Backporting rewriting MSAL application building code to use CreateWithApplicationOptions and avoid (formerly) undocumented APIs. See #3354 for full details of change.

@benrr101 benrr101 requested review from a team and Copilot May 19, 2025 17:44
Copy link
@Copilot 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

This PR backports the MSAL application building code to utilize CreateWithApplicationOptions, replacing undocumented APIs and streamlining builder configuration.

  • Use of PublicClientApplicationBuilder.CreateWithApplicationOptions for a more robust application instance creation
  • Conditional inclusion of ParentActivityOrWindow for NETFRAMEWORK builds
  • Removal of redundant duplicated builder calls
Comments suppressed due to low confidence (1)

src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/ActiveDirectoryAuthenticationProvider.cs:547

  • Ensure that all necessary options required by the MSAL framework and your application context are configured in PublicClientApplicationOptions to fully replicate the previous behavior.
.CreateWithApplicationOptions(new PublicClientApplicationOptions {

.WithClientVersion(Common.ADP.GetAssemblyVersion().ToString())
.WithRedirectUri(publicClientAppKey._redirectUri)
.Build();
builder.WithParentActivityOrWindow(_iWin32WindowFunc);
Copy link
Contributor

Choose a reason for hiding this comment

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

This needs the reassignment fix too.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

🤦‍♂️

Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think there's anything to fix. Chaining returns the same object, not a new instance.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yep, after chat with @paulmedynski we are in agreement that there's nothing required here

@benrr101 benrr101 requested a review from mdaigle May 19, 2025 21:24
Copy link
codecov bot commented May 21, 2025

Codecov Report

Attention: Patch coverage is 91.66667% with 1 line in your changes missing coverage. Please review.

Project coverage is 72.70%. Comparing base (77db4ad) to head (77f41a5).
Report is 1 commits behind head on release/6.0.

Files with missing lines Patch % Lines
...SqlClient/ActiveDirectoryAuthenticationProvider.cs 91.66% 1 Missing ⚠️
Additional details and impacted files
@@               Coverage Diff               @@
##           release/6.0    #3360      +/-   ##
===============================================
- Coverage        72.74%   72.70%   -0.05%     
===============================================
  Files              285      285              
  Lines            59165    59162       -3     
===============================================
- Hits             43042    43014      -28     
- Misses           16123    16148      +25     
Flag Coverage Δ
addons 92.58% <ø> (ø)
netcore 75.55% <100.00%> (-0.07%) ⬇️
netfx 71.06% <91.66%> (+0.04%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@benrr101 benrr101 merged commit 90bc83c into release/6.0 May 23, 2025
129 checks passed
@benrr101 benrr101 deleted the dev/russellben/apiscan-msal-6.0 branch May 23, 2025 16:19
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.

3 participants
0