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

AuthorizationAnnotationUtils.findUniqueAnnotation broken for synthetic methods #13132

Closed
f-cramer opened this issue May 4, 2023 · 1 comment · Fixed by #13148
Closed

AuthorizationAnnotationUtils.findUniqueAnnotation broken for synthetic methods #13132

f-cramer opened this issue May 4, 2023 · 1 comment · Fixed by #13148
Assignees
Labels
in: core An issue in spring-security-core type: bug A general bug
Milestone

Comments

@f-cramer
Copy link

f-cramer commented May 4, 2023

Describe the bug
When annotating a method that causes a synthetic method to be created (for example when overriding Spring Datas ListCrudRepository#findAllById which in turn overrides CrudRepository#findAllById) both the original and the synthetic method will contain this annotation when checking at runtime. This leads to a AnnotationConfigurationException being thrown when trying to call the overridden method although the annotation is only present once in the source code

To Reproduce
Check out https://github.com/f-cramer/spring-security-synthetic-methods an call http://localhost:8080/books with username admin and password abc123.

Expected behavior
Synthetic methods should be ignored when validating the uniqueness of security annotations

@f-cramer f-cramer added status: waiting-for-triage An issue we've not yet triaged type: bug A general bug labels May 4, 2023
@jzheaux
Copy link
Contributor

jzheaux commented May 8, 2023

Good catch, @f-cramer. Are you able to provide a PR against the 5.8.x branch that includes a test to address the issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: core An issue in spring-security-core type: bug A general bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants