mind review findings

This commit is contained in:
Eduard Heimbuch
2020-10-28 08:42:13 +01:00
parent c1a018a00d
commit 76dac8bc6b
3 changed files with 11 additions and 7 deletions

View File

@@ -80,7 +80,7 @@ public final class SyncingRealmHelper {
* @param ctx administration context
* @param userManager user manager
* @param groupManager group manager
* @deprecated
* @deprecated Use the other constructor including {@link ExternalUserConverter} instead.
*/
@Deprecated
public SyncingRealmHelper(AdministrationContext ctx, UserManager userManager, GroupManager groupManager) {

View File

@@ -26,14 +26,18 @@ package sonia.scm.user;
import sonia.scm.plugin.ExtensionPoint;
/**
* The external user converter can be used to modify users
* which are provided by external systems before creation in SCM-Manager.
* The implementations will be called in the {@link sonia.scm.security.SyncingRealmHelper}
* @since 2.9.0
*/
@ExtensionPoint
public interface ExternalUserConverter {
/**
* Returns the converted user.
*
* @return converted user
* @since 2.9.0
*/
User convert(User user);
}

View File

@@ -167,7 +167,7 @@ public class User extends BasicPropertiesAware implements Principal, ModelObject
return Objects.equal(name, other.name)
&& Objects.equal(displayName, other.displayName)
&& Objects.equal(mail, other.mail)
&& Objects.equal(type, other.type)
&& Objects.equal(external, other.external)
&& Objects.equal(active, other.active)
&& Objects.equal(password, other.password)
&& Objects.equal(creationDate, other.creationDate)
@@ -177,8 +177,8 @@ public class User extends BasicPropertiesAware implements Principal, ModelObject
@Override
public int hashCode() {
return Objects.hashCode(name, displayName, mail, type, password,
active, creationDate, lastModified, properties);
return Objects.hashCode(name, displayName, mail, password,
active, external, creationDate, lastModified, properties);
}
@Override
@@ -195,6 +195,7 @@ public class User extends BasicPropertiesAware implements Principal, ModelObject
.add("password", pwd)
.add("type", type)
.add("active", active)
.add("external", external)
.add("creationDate", creationDate)
.add("lastModified", lastModified)
.add("properties", properties)
@@ -205,7 +206,6 @@ public class User extends BasicPropertiesAware implements Principal, ModelObject
@Override
public boolean isValid() {
return ValidationUtil.isNameValid(name) && Util.isNotEmpty(displayName)
&& Util.isNotEmpty(type)
&& ((Util.isEmpty(mail)) || ValidationUtil.isMailAddressValid(mail));
}