diff --git a/backend/src/main/java/com/bakdata/conquery/models/auth/basic/LocalAuthenticationRealm.java b/backend/src/main/java/com/bakdata/conquery/models/auth/basic/LocalAuthenticationRealm.java index c3d44f1943..016782e7e1 100644 --- a/backend/src/main/java/com/bakdata/conquery/models/auth/basic/LocalAuthenticationRealm.java +++ b/backend/src/main/java/com/bakdata/conquery/models/auth/basic/LocalAuthenticationRealm.java @@ -63,7 +63,7 @@ public class LocalAuthenticationRealm extends AuthenticatingRealm implements Con private static final int ENVIRONMNENT_CLOSING_RETRYS = 2; private static final int ENVIRONMNENT_CLOSING_TIMEOUT = 2; // seconds - // Get the path for the storage here so it is set when as soon the first class is instantiated (in the ManagerNode) + // Get the path for the storage here, so it is set as soon the first class is instantiated (in the ManagerNode) // In the DistributedStandaloneCommand this directory is overriden multiple times before LocalAuthenticationRealm::onInit for the ShardNodes, so this is a problem. private final File storageDir; @@ -165,7 +165,7 @@ private HashEntry toHashEntry(CredentialType credential) { if (credential instanceof PasswordCredential passwordCredential) { return new HashEntry(Password.hash(passwordCredential.password()) .with(defaultHashingFunction) - .getResult()); //.with(defaultHashingFunction).getResult()); + .getResult()); } else if (credential instanceof PasswordHashCredential passwordHashCredential) { return new HashEntry(passwordHashCredential.hash()); @@ -212,6 +212,11 @@ public boolean addUser(@NonNull User user, @NonNull CredentialType credential) { @Override public boolean updateUser(User user, CredentialType credential) { + if (credential == null) { + log.warn("Skipping user '{}' because no credential was provided", user.getId()); + return false; + } + try { final HashEntry hashEntry = toHashEntry(credential); passwordStore.update(user.getId(), hashEntry); diff --git a/backend/src/main/java/com/bakdata/conquery/models/config/auth/LocalAuthenticationConfig.java b/backend/src/main/java/com/bakdata/conquery/models/config/auth/LocalAuthenticationConfig.java index bc756a2f02..fb3f005465 100644 --- a/backend/src/main/java/com/bakdata/conquery/models/config/auth/LocalAuthenticationConfig.java +++ b/backend/src/main/java/com/bakdata/conquery/models/config/auth/LocalAuthenticationConfig.java @@ -84,7 +84,7 @@ public ConqueryAuthenticationRealm createRealm(ManagerNode manager) { final BenchmarkResult result = SystemChecker.benchmarkBcrypt(BCRYPT_MAX_MILLISECONDS); final BcryptFunction prototype = result.getPrototype(); - int rounds = prototype.getLogarithmicRounds(); // 12 + int rounds = prototype.getLogarithmicRounds(); long realElapsed = result.getElapsed();