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

Add setter method for userDetailsChecker in CasAuthenticationProvider(#10277) #15047

Merged
merged 1 commit into from
May 24, 2024

Conversation

Kyoungwoong
Copy link
Contributor

@Kyoungwoong Kyoungwoong commented May 12, 2024

This commit introduces a setter method for the userDetailsChecker property in the CasAuthenticationProvider class. Previously, the userDetailsChecker was initialized with a default AccountStatusUserDetailsChecker instance, limiting customization options. Now, users can inject their own UserDetailsChecker implementation through the setter method, providing greater flexibility in handling user details validation.

fixes: #10277

@pivotal-cla
Copy link

@Kyoungwoong Please sign the Contributor License Agreement!

Click here to manually synchronize the status of this Pull Request.

See the FAQ for frequently asked questions.

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label May 12, 2024
@pivotal-cla
Copy link

@Kyoungwoong Thank you for signing the Contributor License Agreement!

*
* @param userDetailsChecker the UserDetailsChecker to be set
*/
public void setUserDetailsChecker(UserDetailsChecker userDetailsChecker) {

Choose a reason for hiding this comment

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

Suggested change
public void setUserDetailsChecker(UserDetailsChecker userDetailsChecker) {
public void setUserDetailsChecker(final UserDetailsChecker userDetailsChecker) {

@marcusdacoregio marcusdacoregio self-assigned this May 13, 2024
@marcusdacoregio marcusdacoregio added in: cas An issue in spring-security-cas type: enhancement A general enhancement and removed status: waiting-for-triage An issue we've not yet triaged labels May 13, 2024
Copy link
Contributor

@marcusdacoregio marcusdacoregio left a comment

Choose a reason for hiding this comment

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

Thanks for the PR @Kyoungwoong, I've left some feedback inline.

Can you please add a test that makes sure that when setting the UserDetailsChecker it is used where needed?

@@ -1,5 +1,5 @@
/*
* Copyright 2004, 2005, 2006 Acegi Technology Pty Limited
* Copyright 2004, 2005, 2006, 2024 Acegi Technology Pty Limited
Copy link
Contributor

Choose a reason for hiding this comment

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

We don't typically change copyright notices from Acegi, you can leave it as it was.

Suggested change
* Copyright 2004, 2005, 2006, 2024 Acegi Technology Pty Limited
* Copyright 2004, 2005, 2006 Acegi Technology Pty Limited

* @param userDetailsChecker the UserDetailsChecker to be set
*/
public void setUserDetailsChecker(final UserDetailsChecker userDetailsChecker) {
this.userDetailsChecker = userDetailsChecker;
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you please verify that the userDetailsChecker is not null?

Suggested change
this.userDetailsChecker = userDetailsChecker;
Assert.notNull(userDetailsChecker, "userDetailsChecker cannot be null");
this.userDetailsChecker = userDetailsChecker;

* Sets the UserDetailsChecker to be used for checking the status of retrieved user details.
* This allows customization of the UserDetailsChecker implementation.
*
* @param userDetailsChecker the UserDetailsChecker to be set
Copy link
Contributor

Choose a reason for hiding this comment

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

Please add @since 6.4

…pring-projects#10277)

This commit introduces a setter method for the userDetailsChecker property in the CasAuthenticationProvider class. Previously, the userDetailsChecker was initialized with a default AccountStatusUserDetailsChecker instance, limiting customization options. Now, users can inject their own UserDetailsChecker implementation through the setter method, providing greater flexibility in handling user details validation.
@Kyoungwoong
Copy link
Contributor Author

All review has been resolved.

@marcusdacoregio marcusdacoregio merged commit 9b2910c into spring-projects:main May 24, 2024
4 checks passed
@marcusdacoregio
Copy link
Contributor

Thanks @Kyoungwoong. This is now merged into main.

@Kyoungwoong Kyoungwoong deleted the add-setter branch May 25, 2024 11:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: cas An issue in spring-security-cas type: enhancement A general enhancement
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

Allow set of userDetailsChecker
5 participants