Skip to content
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

Add AuthenticatedSchemes option #1047

Merged
merged 10 commits into from
Jul 21, 2023
Merged

Add AuthenticatedSchemes option #1047

merged 10 commits into from
Jul 21, 2023

Conversation

@Shane32 Shane32 added this to the 7.6 milestone Jul 5, 2023
@Shane32 Shane32 self-assigned this Jul 5, 2023
@codecov-commenter
Copy link

Codecov Report

Merging #1047 (178ae2f) into master (fb37cfc) will decrease coverage by 1.04%.
The diff coverage is 42.22%.

❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more.

@@            Coverage Diff             @@
##           master    #1047      +/-   ##
==========================================
- Coverage   93.44%   92.40%   -1.04%     
==========================================
  Files          44       45       +1     
  Lines        2180     2224      +44     
  Branches      367      379      +12     
==========================================
+ Hits         2037     2055      +18     
- Misses        102      124      +22     
- Partials       41       45       +4     
Impacted Files Coverage Δ
src/Transports.AspNetCore/SecurityHelper.cs 26.66% <26.66%> (ø)
src/Transports.AspNetCore/GraphQLHttpMiddleware.cs 92.47% <48.27%> (-2.78%) ⬇️
...nsports.AspNetCore/GraphQLHttpMiddlewareOptions.cs 100.00% <100.00%> (ø)

Comment on lines +296 to +303
foreach (var scheme in _options.AuthenticationSchemes)
{
var result = await context.AuthenticateAsync(scheme);
if (result != null && result.Succeeded)
{
newPrincipal = SecurityHelper.MergeUserPrincipal(newPrincipal, result.Principal);
}
}

Check notice

Code scanning / CodeQL

Missed opportunity to use Select

This foreach loop immediately [maps its iteration variable to another variable](1) - consider mapping the sequence explicitly using '.Select(...)'.
@Shane32 Shane32 added enhancement New feature or request and removed documentation test labels Jul 5, 2023
@Shane32 Shane32 requested a review from sungam3r July 5, 2023 19:12
@Shane32 Shane32 merged commit 1383231 into master Jul 21, 2023
@Shane32 Shane32 deleted the add_authenticationschemes branch July 21, 2023 05:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants