Github user haoch commented on a diff in the pull request:
    --- Diff: 
    @@ -0,0 +1,61 @@
    +package org.apache.eagle.server.authentication;
    +import com.sun.jersey.api.core.HttpContext;
    +import com.sun.jersey.api.model.Parameter;
    +import com.sun.jersey.core.spi.component.ComponentContext;
    +import com.sun.jersey.server.impl.inject.AbstractHttpContextInjectable;
    +import com.sun.jersey.spi.inject.Injectable;
    +import io.dropwizard.auth.Auth;
    +import io.dropwizard.auth.Authenticator;
    +import io.dropwizard.auth.CachingAuthenticator;
    +import io.dropwizard.auth.basic.BasicAuthProvider;
    +import io.dropwizard.auth.basic.BasicCredentials;
    +import io.dropwizard.setup.Environment;
    +import org.apache.eagle.common.authentication.User;
    +import java.util.HashMap;
    +import java.util.Map;
    +public class BasicAuthProviderBuilder {
    +    private static final String SIMPLE_MODE_REALM = 
    +    private static final String LDAP_MODE_REALM = "LDAP_AUTHENTICATION";
    +    private static final Map<String, BasicAuthProvider<User>> MAPPING = 
new HashMap<>();
    +    private AuthenticationSettings authSettings;
    +    private Environment environment;
    +    public BasicAuthProviderBuilder(AuthenticationSettings authSettings, 
Environment environment) {
    +        this.authSettings = authSettings;
    +        this.environment = environment;
    +        Authenticator<BasicCredentials, User> simpleAuthenticator = new 
    +        Authenticator<BasicCredentials, User> ldapAuthenticator = new 
    +        boolean needsCaching = authSettings.needsCaching();
    --- End diff --
    Better to register static object in static scope instead of in instance 
constructor, and move check `needsCaching` to `build` method.

If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at or file a JIRA ticket
with INFRA.

Reply via email to