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

AnonymousAuthenticationFilter should cache its Supplier<SecurityContext> #11900

Closed
jzheaux opened this issue Sep 26, 2022 · 1 comment
Closed
Assignees
Labels
in: web An issue in web modules (web, webmvc) type: enhancement A general enhancement
Milestone

Comments

@jzheaux
Copy link
Contributor

jzheaux commented Sep 26, 2022

The Supplier<SecurityContext> in AnonymousAuthenticationFilter gets invoked several times on each request. Essentially, any time getContext is invoked downstream of it. While each call is quick, it seems a bit wasteful.

One way to cache it would be SingletonSupplier

@jzheaux jzheaux added status: waiting-for-triage An issue we've not yet triaged type: enhancement A general enhancement labels Sep 26, 2022
@jzheaux jzheaux modified the milestones: 6.0.0, 5.8.0 Sep 26, 2022
@evgeniycheban
Copy link
Contributor

Hey, @jzheaux I can work on this.

@sjohnr sjohnr added in: web An issue in web modules (web, webmvc) and removed status: waiting-for-triage An issue we've not yet triaged labels Sep 30, 2022
evgeniycheban added a commit to evgeniycheban/spring-security that referenced this issue Oct 6, 2022
@sjohnr sjohnr closed this as completed in 56b9bad Oct 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: web An issue in web modules (web, webmvc) type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

3 participants