-
Notifications
You must be signed in to change notification settings - Fork 312
APIScan | MSAL WithClientId
usage
#3354
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
Conversation
…licationOptions static constructor.
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.
Pull Request Overview
This PR refactors the MSAL client application initialization by replacing undocumented With* methods with a builder-based approach using application options. The key changes include:
- Switching to PublicClientApplicationBuilder.CreateWithApplicationOptions.
- Introducing a conditional addition of WithParentActivityOrWindow for NETFRAMEWORK builds.
- Consolidating the builder configuration and build process.
Comments suppressed due to low confidence (1)
src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/ActiveDirectoryAuthenticationProvider.cs:557
- Consider adding unit tests to validate both the branch where _iWin32WindowFunc is set and the branch where it is null to ensure the builder configuration is correct in all cases.
if (_iWin32WindowFunc is not null)
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3354 +/- ##
==========================================
+ Coverage 65.16% 67.05% +1.88%
==========================================
Files 300 300
Lines 65379 65376 -3
==========================================
+ Hits 42606 43839 +1233
+ Misses 22773 21537 -1236
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:
|
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.
LGTM, please also backport this change to release branches we support, to avoid getting flagged in other branches.
This PR is now officially "optional" - see description for details
Description: APIScan was giving us two major errors - usage of undocumented SNI APIs (which we are working on an exception for) and usage of undocumented MSAL APIs. This PR addresses the latter by replacing usages of undocumented
With*
methods by providing builder constructor with the application options.When I went back into the automated builds to check to make sure I got all the undocumented MSAL APIs covered, I discovered the errors were no longer in the APIscan results. As it turns out, the APIs have since been documented and are no longer throwing errors. However, in working out a replacement for the formerly-undocumented methods, I worked out a slightly cleaner implementation. So, this change is completely optional from a APIScan perspective, but I think it still has some small value.
Testing: Since this all has to do with AAD, I don't really have the right setup to setup for local testing. Everything still builds, let's see what CI says.