-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Reuse failed auth results in AuthN #43269
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
|
Thanks for your PR, @Kahbazi. Someone from the team will get assigned to your PR shortly and we'll get it reviewed. |
davidfowl
left a comment
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.
Keep these changes coming 👍🏾
davidfowl
left a comment
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.
Turns out you can mutate these results 😢
I can't see how! Could you please elaborate? Is it because of the |
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.
Can you change AuthenticateResult.NoResult to cache?
There's a theoretical issue with caching AuthenticateResult, it can reference mutable structures like ClaimsPrincipal, AuthenticationProerties, Exception, etc.. NoResult, Skipped, and Handled might be the only cases truly safe to cache because they don't hold any mutable objects. That might be worth overlooking for extremely common scenarios. Are any of these failures especially common?
edit Oh, already discussed above 😁.
(Merged since the feedback was trivial and we're at the rc1 deadline)
|
|
||
| internal static class AuthenticateResults | ||
| { | ||
| internal static AuthenticateResult NoSelfSigned = AuthenticateResult.Fail("Options do not allow self signed certificates."); |
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.
Style: Why define these in separate classes if they're only used in one class?
| /// </summary> | ||
| public class HandleRequestResult : AuthenticateResult | ||
| { | ||
| private static readonly HandleRequestResult _noResult = new() { None = true }; |
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.
Style: I think we use "NoResult" for class statics, and "_noResult" for class fields.
|
Hi @Kahbazi. It looks like you just commented on a closed PR. The team will most probably miss it. If you'd like to bring something important up to their attention, consider filing a new issue and add enough details to build context. |
No description provided.