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

[SDCISA-13736] Fix bad habits in ModuleConfigurationAuthentication. #156

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,13 @@
import io.vertx.ext.auth.authentication.AuthenticationProvider;
import io.vertx.ext.auth.authentication.Credentials;
import io.vertx.ext.auth.authentication.UsernamePasswordCredentials;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.swisspush.reststorage.util.ModuleConfiguration;

import java.util.Objects;
import java.util.logging.Logger;

import static org.slf4j.LoggerFactory.getLogger;

/**
* Custom implementation of a {@link AuthenticationProvider} using credentials from {@link ModuleConfiguration}
Expand All @@ -20,7 +23,7 @@
*/
public class ModuleConfigurationAuthentication implements AuthenticationProvider {

private final static Logger logger = Logger.getLogger(ModuleConfigurationAuthentication.class.getName());
private final static Logger logger = getLogger(ModuleConfigurationAuthentication.class);

private static final String INVALID_CREDENTIALS = "invalid credentials";

Expand All @@ -43,7 +46,7 @@
String password = configuration.getHttpRequestHandlerPassword();

if (StringUtil.isNullOrEmpty(username) || StringUtil.isNullOrEmpty(password)) {
logger.warning("Credentials are missing/empty");
logger.warn("Credentials are missing/empty");

Check warning on line 49 in src/main/java/org/swisspush/reststorage/ModuleConfigurationAuthentication.java

View check run for this annotation

Codecov / codecov/patch

src/main/java/org/swisspush/reststorage/ModuleConfigurationAuthentication.java#L49

Added line #L49 was not covered by tests
this.user = null;
} else {
this.user = new User(username, password);
Expand Down