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

Consider favoring ObjectProvider#getIfAvailable #15821

Open
jzheaux opened this issue Sep 17, 2024 · 0 comments
Open

Consider favoring ObjectProvider#getIfAvailable #15821

jzheaux opened this issue Sep 17, 2024 · 0 comments
Labels
in: config An issue in spring-security-config type: breaks-passivity A change that breaks passivity with the previous release type: enhancement A general enhancement
Milestone

Comments

@jzheaux
Copy link
Contributor

jzheaux commented Sep 17, 2024

Given #15816, it may be easier to make Spring Security's bean resolution policy more consistent.

Reports like #15751 and #15538 make it clear that the existing behavior in some parts of Spring Security is surprising. To alleviate that, we can favor ObjectProvider#getIfAvailable. This is already an improvement over getBeanOrNull since it also supports the @Primary annotation, simplifying the remediation for duplicate beans.

Because getIfAvailable throws an exception when there are multiple candidate beans and getIfUnique does not, this is not a passive change, so it would need to happen in Spring Security 7 or later.

@jzheaux jzheaux added status: waiting-for-triage An issue we've not yet triaged type: enhancement A general enhancement in: config An issue in spring-security-config type: breaks-passivity A change that breaks passivity with the previous release and removed status: waiting-for-triage An issue we've not yet triaged labels Sep 17, 2024
@jzheaux jzheaux added this to the 7.0.x milestone Sep 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: config An issue in spring-security-config type: breaks-passivity A change that breaks passivity with the previous release type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

1 participant