Skip to content

No introduction to CachingUserDetailsService in the documentation #10914

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

Closed
linghengqian opened this issue Feb 27, 2022 · 8 comments
Closed

No introduction to CachingUserDetailsService in the documentation #10914

linghengqian opened this issue Feb 27, 2022 · 8 comments
Assignees
Labels
in: docs An issue in Documentation or samples status: duplicate A duplicate of another issue status: ideal-for-contribution An issue that we actively are looking for someone to help us with type: enhancement A general enhancement
Milestone

Comments

@linghengqian
Copy link

linghengqian commented Feb 27, 2022

Expected Behavior

There should be a subsection in https://docs.spring.io/spring-security/reference/ describing org.springframework.security.authentication.CachingUserDetailsService .

Current Behavior

In fact there is no such text passage to mention this class.

image

Context

This class does not give too much description in the javadoc, and some people use outdated information to judge the role of this class in the closed issues, for example #2837 .

According to the discussion on Stack Overflow (refer to https://stackoverflow.com/questions/40766098/springcachebasedusercache-is-null ), it seems that many people have the need to cache authentication information, but the official website documentation is not mentioned this class. Should it be mentioned if possible?

Because the function of this class is relatively intuitive and simple, is it the opinion of the community that it is not recommended to use this class? If so, then I think it should be explained in the documentation.

@linghengqian linghengqian added status: waiting-for-triage An issue we've not yet triaged type: enhancement A general enhancement labels Feb 27, 2022
@sjohnr sjohnr added in: docs An issue in Documentation or samples and removed status: waiting-for-triage An issue we've not yet triaged labels Mar 1, 2022
@sjohnr
Copy link
Member

sjohnr commented Mar 1, 2022

@linghengqian, thanks for the suggestion. I think many don't know of this class, and personally I have always used Spring's @Cacheable annotation for this case. However, the class has been modified as recently as 2018 and is not deprecated, so including a brief description in the documentation should be just fine. Would you like to submit a PR?

@linghengqian
Copy link
Author

linghengqian commented Mar 1, 2022

Would you like to submit a PR?

I just realized @Cacheable exists. Because I am not familiar with this area, I do not expect me to submit this PR.

@sjohnr
Copy link
Member

sjohnr commented Mar 2, 2022

@linghengqian, no problem, thanks for the update.

@ghost
Copy link

ghost commented Mar 10, 2022

Hello, may I take this task, please?

@sjohnr
Copy link
Member

sjohnr commented Mar 11, 2022

Sure!

@sjohnr sjohnr assigned ghost Mar 11, 2022
@ghost ghost removed their assignment Sep 18, 2022
@linghengqian
Copy link
Author

@timofeli Any updates?

@jzheaux jzheaux added the status: ideal-for-contribution An issue that we actively are looking for someone to help us with label May 31, 2023
@FdHerrera
Copy link

Hello,

I'd like to take this issue, if it's ok for you.

According to the discussion in this thread, the idea is to recommend using @Cacheable instead of a bean of this class? If so, makes sense to deprecate this class?

@sjohnr
Copy link
Member

sjohnr commented Nov 28, 2023

@FdHerrera

I'd like to take this issue, if it's ok for you.

Thanks!

According to the discussion in this thread, the idea is to recommend using @Cacheable instead of a bean of this class? If so, makes sense to deprecate this class?

I don't think we need to deprecate this class. However, the documentation could show an example of how to use it (declare it as a @Bean wrapping another concrete UserDetailsService) in addition to demonstrating or recommending an alternative using @Cacheable. I think both options would be good for readers to know about.

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 status: duplicate A duplicate of another issue status: ideal-for-contribution An issue that we actively are looking for someone to help us with type: enhancement A general enhancement
Projects
None yet
4 participants