Skip to content

Sorting in AuthorizationAdvisorProxyFactory should be thread-safe #16834

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

Merged
merged 3 commits into from
Mar 27, 2025

Conversation

ngocnhan-tran1996
Copy link
Contributor

Closes gh-16819

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Mar 27, 2025
Copy link
Contributor

@jzheaux jzheaux left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, @ngocnhan-tran1996 for the PR! I've left some feedback inline.

@jzheaux jzheaux self-assigned this Mar 27, 2025
@jzheaux jzheaux added in: core An issue in spring-security-core type: bug A general bug and removed status: waiting-for-triage An issue we've not yet triaged labels Mar 27, 2025
@jzheaux
Copy link
Contributor

jzheaux commented Mar 27, 2025

Additionally, will you please rebase this on 6.3.x since that is where the bug first occurs?

@jzheaux jzheaux added this to the 6.3.x milestone Mar 27, 2025
@ngocnhan-tran1996 ngocnhan-tran1996 changed the base branch from main to 6.3.x March 27, 2025 18:48
@ngocnhan-tran1996 ngocnhan-tran1996 changed the title Use lock for preventing ConcurrentModificationException Implement SmartInitializingSingleton for preventing ConcurrentModificationException Mar 27, 2025
ngocnhan-tran1996 and others added 2 commits March 27, 2025 14:09
In order to make so that authorization advisors are sorted
only one time and also as part of the configuration lifecycle,
AuthorizationAdvisorProxyFactory now implements
SmartInitializingBean.

Closes spring-projectsgh-16819

Signed-off-by: Tran Ngoc Nhan <ngocnhan.tran1996@gmail.com>
This commit ensures that the default advisors and added advisors
are sorted in the event that this component is not being published
as a Spring bean.

Issue spring-projectsgh-16819
@jzheaux jzheaux changed the title Implement SmartInitializingSingleton for preventing ConcurrentModificationException Sorting in AuthorizationAdvisorProxyFactory should be thread-safe Mar 27, 2025
@jzheaux jzheaux merged commit 456604a into spring-projects:6.3.x Mar 27, 2025
6 checks passed
@jzheaux
Copy link
Contributor

jzheaux commented Mar 27, 2025

Thanks for the quick turnaround on this PR, @ngocnhan-tran1996! I added a polish commit to take care of scenarios where AuthorizationAdvisorProxyFactory is not published as a Spring bean.

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
Status: No status
Development

Successfully merging this pull request may close these issues.

Sorting in AuthorizationAdvisorProxyFactory should be thread-safe
3 participants