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

Refactor ScimUserProvisioning Dependency Injection #3026

Merged
merged 9 commits into from
Sep 10, 2024
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
import java.util.List;
import java.util.Map;
import java.util.UUID;
import java.util.regex.Pattern;

import org.cloudfoundry.identity.uaa.audit.event.SystemDeletable;
import org.cloudfoundry.identity.uaa.constants.OriginKeys;
Expand Down Expand Up @@ -131,8 +130,6 @@ public Logger getLogger() {

private static final RowMapper<ScimUser> mapper = new ScimUserRowMapper();

private Pattern usernamePattern = Pattern.compile("[\\p{L}+0-9+\\-_.@'!]+");
Copy link
Member

Choose a reason for hiding this comment

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

Could you provide some context on how this is now an obsolete property. Is this property obsolete globally in UAA, or just obsolete in JdbcScimUserProvisioning?

If the former (globally), this property still exist in these places and need to be cleaned up:

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for the hint, I removed the variable in commit c7c8bdc.


private TimeService timeService = new TimeServiceImpl();

private final JdbcIdentityZoneProvisioning jdbcIdentityZoneProvisioning;
Expand Down Expand Up @@ -510,14 +507,6 @@ public void setDeactivateOnDelete(boolean deactivateOnDelete) {
this.deactivateOnDelete = deactivateOnDelete;
}

/**
* Sets the regular expression which will be used to validate the username.
*/
public void setUsernamePattern(String usernamePattern) {
Assert.hasText(usernamePattern, "Username pattern must not be empty");
this.usernamePattern = Pattern.compile(usernamePattern);
}

@Override
public int deleteByIdentityZone(String zoneId) {
jdbcTemplate.update(HARD_DELETE_OF_GROUP_MEMBERS_BY_ZONE, zoneId);
Expand Down
1 change: 0 additions & 1 deletion uaa/src/main/webapp/WEB-INF/spring/scim-endpoints.xml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@
<property name="queryConverter" ref="scimUserQueryConverter"/>
<property name="joinConverter" ref="scimJoinQueryConverter"/>
<property name="deactivateOnDelete" value="${scim.delete.deactivate:false}"/>
<property name="usernamePattern" value="${scim.username_pattern:[\p{L}+0-9+\-_.@'!]+}"/>
<property name="timeService" ref="timeService"/>
<constructor-arg name="passwordEncoder" ref="nonCachingPasswordEncoder"/>
</bean>
Expand Down