diff --git a/presto-main/src/main/java/com/facebook/presto/server/security/PrestoAuthenticator.java b/presto-main/src/main/java/com/facebook/presto/server/security/CustomPrestoAuthenticator.java similarity index 89% rename from presto-main/src/main/java/com/facebook/presto/server/security/PrestoAuthenticator.java rename to presto-main/src/main/java/com/facebook/presto/server/security/CustomPrestoAuthenticator.java index 2754f8cdfc22a..61106bab27c35 100644 --- a/presto-main/src/main/java/com/facebook/presto/server/security/PrestoAuthenticator.java +++ b/presto-main/src/main/java/com/facebook/presto/server/security/CustomPrestoAuthenticator.java @@ -24,13 +24,13 @@ import static java.util.Objects.requireNonNull; -public class PrestoAuthenticator +public class CustomPrestoAuthenticator implements Authenticator { private PrestoAuthenticatorManager authenticatorManager; @Inject - public PrestoAuthenticator(PrestoAuthenticatorManager authenticatorManager) + public CustomPrestoAuthenticator(PrestoAuthenticatorManager authenticatorManager) { this.authenticatorManager = requireNonNull(authenticatorManager, "authenticatorManager is null"); authenticatorManager.setRequired(); @@ -41,7 +41,6 @@ public Principal authenticate(HttpServletRequest request) throws AuthenticationException { try { - //wrapped the original HttpServletRequest in a RestrictedHttpServletRequest ReadOnlyHttpServletRequest restrictedRequest = new ReadOnlyHttpServletRequest(request); return authenticatorManager.getAuthenticator().createAuthenticatedPrincipal(restrictedRequest); } diff --git a/presto-main/src/main/java/com/facebook/presto/server/security/ServerSecurityModule.java b/presto-main/src/main/java/com/facebook/presto/server/security/ServerSecurityModule.java index 6a42c22b69a8f..cd7943e40b313 100644 --- a/presto-main/src/main/java/com/facebook/presto/server/security/ServerSecurityModule.java +++ b/presto-main/src/main/java/com/facebook/presto/server/security/ServerSecurityModule.java @@ -61,7 +61,7 @@ else if (authType == JWT) { authBinder.addBinding().to(JsonWebTokenAuthenticator.class).in(Scopes.SINGLETON); } else if (authType == CUSTOM) { - authBinder.addBinding().to(PrestoAuthenticator.class).in(Scopes.SINGLETON); + authBinder.addBinding().to(CustomPrestoAuthenticator.class).in(Scopes.SINGLETON); } else { throw new AssertionError("Unhandled auth type: " + authType);