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

Documentation inconsistency in AuthorizationManager's verify method return type #15704

Closed
ijnooyah opened this issue Aug 28, 2024 · 1 comment
Assignees
Labels
in: docs An issue in Documentation or samples type: bug A general bug
Milestone

Comments

@ijnooyah
Copy link

Hi,

I noticed a discrepancy between the official Spring Security documentation and the actual code regarding the verify method in the AuthorizationManager interface.

Discrepancy:
In the official documentation, the verify method is shown as returning an AuthorizationDecision:

default AuthorizationDecision verify(Supplier<Authentication> authentication, Object secureObject)
        throws AccessDeniedException {
    // ...
}

However, in both the actual code and the same online API documentation, the verify method has a void return type:

    default void verify(Supplier<Authentication> authentication, T object) {
        AuthorizationDecision decision = this.check(authentication, object);
        if (decision != null && !decision.isGranted()) {
            throw new AccessDeniedException("Access Denied");
        }
    }

You can also see this in the official online API documentation:
AuthorizationManager API Documentation

Request for Clarification:

  • Was this an intentional difference in the documentation, perhaps to illustrate a conceptual point?
  • Or is this an error in the documentation that should be corrected?

It would be helpful to clarify whether the documentation needs to be updated to reflect the actual method signature in the code, or if there is an intended reason for this difference that we should be aware of.

Thank you for your assistance!

Best regards,
yoonji

@jzheaux
Copy link
Contributor

jzheaux commented Sep 18, 2024

Hi, @ijnooyah, thanks for pointing this out. This is now repaired in the documentation and should be visible in the next release.

You'll also see it in the SNAPSHOT version in the next few minutes once the build completes.

@jzheaux jzheaux self-assigned this Sep 18, 2024
@jzheaux jzheaux added in: docs An issue in Documentation or samples and removed status: waiting-for-triage An issue we've not yet triaged labels Sep 18, 2024
@jzheaux jzheaux added this to the 6.2.7 milestone Sep 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: docs An issue in Documentation or samples type: bug A general bug
Projects
None yet
Development

No branches or pull requests

2 participants