-
Notifications
You must be signed in to change notification settings - Fork 10.4k
Annotate Authorization.Core, Authorization.Policy with nullable #22990
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
Hello @pranavkm! Because this pull request has the Do note that I've been instructed to only help merge pull requests of this repository that have been opened for at least 60 minutes. No worries though, I will be back when the time is right! 😉 p.s. you can customize the way I help with merging this pull request, such as holding this pull request until a specific person approves. Simply @mention me (
|
74de638
to
86fccf3
Compare
@@ -2,6 +2,7 @@ | |||
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. | |||
|
|||
using System.Collections.Generic; | |||
using System.Diagnostics.CodeAnalysis; |
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.
nit: is this using needed?
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.
Nope. Will clean up in a follow up
@@ -2,6 +2,7 @@ | |||
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. | |||
|
|||
using System; | |||
using System.Diagnostics.CodeAnalysis; |
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.
nit: needed?
@@ -37,7 +37,16 @@ public static IServiceCollection AddAuthorizationPolicyEvaluator(this IServiceCo | |||
/// <param name="services">The <see cref="IServiceCollection" /> to add services to.</param> | |||
/// <returns>The <see cref="IServiceCollection"/> so that additional calls can be chained.</returns> | |||
public static IServiceCollection AddAuthorization(this IServiceCollection services) | |||
=> services.AddAuthorization(configure: null); | |||
{ |
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.
Is there no clean way to share chain these methods anymore?
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 was following from MVC where it does an explicit null check if you call the overload that takes an option. That unfortunately necessitates having separate code paths.
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.
Thanks for the review. I'll clean up the extra attributez
@@ -2,6 +2,7 @@ | |||
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. | |||
|
|||
using System.Collections.Generic; | |||
using System.Diagnostics.CodeAnalysis; |
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.
Nope. Will clean up in a follow up
@@ -37,7 +37,16 @@ public static IServiceCollection AddAuthorizationPolicyEvaluator(this IServiceCo | |||
/// <param name="services">The <see cref="IServiceCollection" /> to add services to.</param> | |||
/// <returns>The <see cref="IServiceCollection"/> so that additional calls can be chained.</returns> | |||
public static IServiceCollection AddAuthorization(this IServiceCollection services) | |||
=> services.AddAuthorization(configure: null); | |||
{ |
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 was following from MVC where it does an explicit null check if you call the overload that takes an option. That unfortunately necessitates having separate code paths.
services.Configure(configure); | ||
} | ||
|
||
services.Configure(configure); |
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.
This can null ref now if the caller hasn't turned on annotations.
Contributes to #5680