-
Notifications
You must be signed in to change notification settings - Fork 10.4k
Fix XML comments for return values on IAuthorizationService #62765
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
base: main
Are you sure you want to change the base?
Conversation
Greetings human! You've submitted a PR that modifies code that is shared with https://github.com/dotnet/runtime . Please make sure you synchronize this code with the changes in that repo! |
Co-authored-by: JamesNK <[email protected]>
@copilot Also update DefaultAuthorizationService |
Updated XML documentation for DefaultAuthorizationService methods to correctly describe return values as Task<AuthorizationResult> instead of boolean flags, matching the pattern used for IAuthorizationService interface. Co-authored-by: JamesNK <[email protected]>
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 updates the XML <returns>
documentation on IAuthorizationService
methods and their extensions to accurately describe the Task<AuthorizationResult>
return type and guide consumers to use the AuthorizationResult.Succeeded
property for success checks.
- Corrected
<returns>
tags in the interface, default implementation, and extension methods - Added
<see>
references forTask{TResult}
andAuthorizationResult
- Clarified usage of
AuthorizationResult.Succeeded
instead of boolean return flags
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
File | Description |
---|---|
src/Security/Authorization/Core/src/IAuthorizationService.cs | Updated <returns> doc on interface methods |
src/Security/Authorization/Core/src/DefaultAuthorizationService.cs | Updated <returns> doc on implementation |
src/Security/Authorization/Core/src/AuthorizationServiceExtensions.cs | Updated <returns> doc on extension methods |
Comments suppressed due to low confidence (2)
src/Security/Authorization/Core/src/IAuthorizationService.cs:25
- For clearer XML linkage, reference the concrete return type by using
<see cref="Task{AuthorizationResult}"/>
instead of the generic<see cref="Task{TResult}"/>
.
/// A <see cref="Task{TResult}"/> that contains an <see cref="AuthorizationResult"/> indicating whether authorization has succeeded.
src/Security/Authorization/Core/src/AuthorizationServiceExtensions.cs:24
- [nitpick] To reduce duplicated XML comments across multiple overloads, consider using
<inheritdoc cref="IAuthorizationService.AuthorizeAsync(ClaimsPrincipal, object?, IAuthorizationRequirement)"/>
(and equivalents) in each extension method.
/// A <see cref="Task{TResult}"/> that contains an <see cref="AuthorizationResult"/> indicating whether requirement evaluation has succeeded or failed.
The XML documentation for
IAuthorizationService
methods and their extension methods incorrectly described return values as boolean flags, when they actually returnTask<AuthorizationResult>
.Before:
After:
Changes:
IAuthorizationService.cs
AuthorizationServiceExtensions.cs
Task<AuthorizationResult>
return typeTask{TResult}
andAuthorizationResult
typesAuthorizationResult.Succeeded
propertyThe documentation now accurately reflects the actual return types and provides clear guidance on how to check authorization results.
Fixes #62764.
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.