diff --git a/itests/hive-minikdc/src/test/java/org/apache/hive/minikdc/TestJdbcNonKrbSASLWithMiniKdc.java b/itests/hive-minikdc/src/test/java/org/apache/hive/minikdc/TestJdbcNonKrbSASLWithMiniKdc.java index 948c7daded1d..31623a4d2908 100644 --- a/itests/hive-minikdc/src/test/java/org/apache/hive/minikdc/TestJdbcNonKrbSASLWithMiniKdc.java +++ b/itests/hive-minikdc/src/test/java/org/apache/hive/minikdc/TestJdbcNonKrbSASLWithMiniKdc.java @@ -42,7 +42,7 @@ public class TestJdbcNonKrbSASLWithMiniKdc extends TestJdbcWithMiniKdc{ public static class CustomAuthenticator implements PasswdAuthenticationProvider { @Override - public void Authenticate(String user, String password) throws AuthenticationException { + public void authenticate(String user, String password) throws AuthenticationException { if (!(SASL_NONKRB_USER1.equals(user) && SASL_NONKRB_PWD.equals(password)) && !(SASL_NONKRB_USER2.equals(user) && SASL_NONKRB_PWD.equals(password))) { throw new AuthenticationException("Authentication failed"); diff --git a/itests/hive-unit/src/test/java/org/apache/hive/service/auth/TestCustomAuthentication.java b/itests/hive-unit/src/test/java/org/apache/hive/service/auth/TestCustomAuthentication.java index 9705c65af893..b866f8d1fe7b 100644 --- a/itests/hive-unit/src/test/java/org/apache/hive/service/auth/TestCustomAuthentication.java +++ b/itests/hive-unit/src/test/java/org/apache/hive/service/auth/TestCustomAuthentication.java @@ -108,7 +108,7 @@ private void init(){ } @Override - public void Authenticate(String user, String password) throws AuthenticationException { + public void authenticate(String user, String password) throws AuthenticationException { if(!userMap.containsKey(user)){ throw new AuthenticationException("Invalid user : "+user); diff --git a/itests/hive-unit/src/test/java/org/apache/hive/service/auth/TrustDomainAuthenticationTest.java b/itests/hive-unit/src/test/java/org/apache/hive/service/auth/TrustDomainAuthenticationTest.java index e83ac0e97f56..f2fe7076b800 100644 --- a/itests/hive-unit/src/test/java/org/apache/hive/service/auth/TrustDomainAuthenticationTest.java +++ b/itests/hive-unit/src/test/java/org/apache/hive/service/auth/TrustDomainAuthenticationTest.java @@ -183,7 +183,7 @@ private void init(){ } @Override - public void Authenticate(String user, String password) throws AuthenticationException { + public void authenticate(String user, String password) throws AuthenticationException { if(!userMap.containsKey(user)){ throw new AuthenticationException("Invalid user : "+user); diff --git a/service/src/java/org/apache/hive/service/auth/AnonymousAuthenticationProviderImpl.java b/service/src/java/org/apache/hive/service/auth/AnonymousAuthenticationProviderImpl.java index ece3c756fafd..566fe3d38b83 100644 --- a/service/src/java/org/apache/hive/service/auth/AnonymousAuthenticationProviderImpl.java +++ b/service/src/java/org/apache/hive/service/auth/AnonymousAuthenticationProviderImpl.java @@ -26,7 +26,7 @@ public class AnonymousAuthenticationProviderImpl implements PasswdAuthenticationProvider { @Override - public void Authenticate(String user, String password) throws AuthenticationException { + public void authenticate(String user, String password) throws AuthenticationException { // no-op authentication } diff --git a/service/src/java/org/apache/hive/service/auth/CustomAuthenticationProviderImpl.java b/service/src/java/org/apache/hive/service/auth/CustomAuthenticationProviderImpl.java index 3d7ccd96feaa..ab6f20330b0e 100644 --- a/service/src/java/org/apache/hive/service/auth/CustomAuthenticationProviderImpl.java +++ b/service/src/java/org/apache/hive/service/auth/CustomAuthenticationProviderImpl.java @@ -50,8 +50,8 @@ public class CustomAuthenticationProviderImpl implements PasswdAuthenticationPro } @Override - public void Authenticate(String user, String password) throws AuthenticationException { - customProvider.Authenticate(user, password); + public void authenticate(String user, String password) throws AuthenticationException { + customProvider.authenticate(user, password); } } diff --git a/service/src/java/org/apache/hive/service/auth/LdapAuthenticationProviderImpl.java b/service/src/java/org/apache/hive/service/auth/LdapAuthenticationProviderImpl.java index 31351b1da4a2..cd8dedc01d03 100644 --- a/service/src/java/org/apache/hive/service/auth/LdapAuthenticationProviderImpl.java +++ b/service/src/java/org/apache/hive/service/auth/LdapAuthenticationProviderImpl.java @@ -69,7 +69,7 @@ public LdapAuthenticationProviderImpl(HiveConf conf) { } @Override - public void Authenticate(String user, String password) throws AuthenticationException { + public void authenticate(String user, String password) throws AuthenticationException { DirSearch search = null; String bindUser = this.conf.getVar(HiveConf.ConfVars.HIVE_SERVER2_PLAIN_LDAP_BIND_USER); String bindPassword = null; diff --git a/service/src/java/org/apache/hive/service/auth/PamAuthenticationProviderImpl.java b/service/src/java/org/apache/hive/service/auth/PamAuthenticationProviderImpl.java index fff378a7e9e7..f430e954ce6c 100644 --- a/service/src/java/org/apache/hive/service/auth/PamAuthenticationProviderImpl.java +++ b/service/src/java/org/apache/hive/service/auth/PamAuthenticationProviderImpl.java @@ -32,7 +32,7 @@ public class PamAuthenticationProviderImpl implements PasswdAuthenticationProvid } @Override - public void Authenticate(String user, String password) throws AuthenticationException { + public void authenticate(String user, String password) throws AuthenticationException { if (pamServiceNames == null || pamServiceNames.trim().isEmpty()) { throw new AuthenticationException("No PAM services are set."); diff --git a/service/src/java/org/apache/hive/service/auth/PasswdAuthenticationProvider.java b/service/src/java/org/apache/hive/service/auth/PasswdAuthenticationProvider.java index fdc6857a929e..a97bae13fc2a 100644 --- a/service/src/java/org/apache/hive/service/auth/PasswdAuthenticationProvider.java +++ b/service/src/java/org/apache/hive/service/auth/PasswdAuthenticationProvider.java @@ -35,5 +35,5 @@ public interface PasswdAuthenticationProvider { * @throws AuthenticationException When a user is found to be * invalid by the implementation */ - void Authenticate(String user, String password) throws AuthenticationException; + void authenticate(String user, String password) throws AuthenticationException; } diff --git a/service/src/java/org/apache/hive/service/auth/PlainSaslHelper.java b/service/src/java/org/apache/hive/service/auth/PlainSaslHelper.java index 66a803ba355f..775893abedfc 100644 --- a/service/src/java/org/apache/hive/service/auth/PlainSaslHelper.java +++ b/service/src/java/org/apache/hive/service/auth/PlainSaslHelper.java @@ -18,7 +18,6 @@ package org.apache.hive.service.auth; import java.io.IOException; -import java.net.InetAddress; import java.security.Security; import java.util.HashMap; @@ -160,7 +159,7 @@ public void handle(Callback[] callbacks) throws IOException, UnsupportedCallback PasswdAuthenticationProvider provider = AuthenticationProviderFactory.getAuthenticationProvider(authMethod); try { - provider.Authenticate(username, password); + provider.authenticate(username, password); } catch (Exception e) { LOG.error("Login attempt is failed for user : " + username + ". Error Messsage : " + e.getMessage()); throw e; diff --git a/service/src/java/org/apache/hive/service/auth/ldap/LdapAuthService.java b/service/src/java/org/apache/hive/service/auth/ldap/LdapAuthService.java index be047099b4ec..42d38facd83e 100644 --- a/service/src/java/org/apache/hive/service/auth/ldap/LdapAuthService.java +++ b/service/src/java/org/apache/hive/service/auth/ldap/LdapAuthService.java @@ -69,7 +69,7 @@ public boolean authenticate(HttpServletRequest request, HttpServletResponse resp String clientUserName = validateCookie(request); if (clientUserName == null) { clientUserName = getUsername(request); - authProvider.Authenticate(clientUserName, getPassword(request)); + authProvider.authenticate(clientUserName, getPassword(request)); String cookieToken = HttpAuthUtils.createCookieToken(clientUserName); Cookie hs2Cookie = signAndCreateCookie(cookieToken); diff --git a/service/src/java/org/apache/hive/service/cli/thrift/ThriftHttpServlet.java b/service/src/java/org/apache/hive/service/cli/thrift/ThriftHttpServlet.java index 05e33cff9cb0..ea774e2eb058 100644 --- a/service/src/java/org/apache/hive/service/cli/thrift/ThriftHttpServlet.java +++ b/service/src/java/org/apache/hive/service/cli/thrift/ThriftHttpServlet.java @@ -417,7 +417,7 @@ private String doPasswdAuth(HttpServletRequest request, String authType) AuthMethods authMethod = AuthMethods.getValidAuthMethod(authType); PasswdAuthenticationProvider provider = AuthenticationProviderFactory.getAuthenticationProvider(authMethod, hiveConf); - provider.Authenticate(userName, httpAuthService.getPassword(request)); + provider.authenticate(userName, httpAuthService.getPassword(request)); } catch (Exception e) { throw new HttpAuthenticationException(e); } diff --git a/service/src/test/org/apache/hive/service/auth/TestLdapAuthenticationProviderImpl.java b/service/src/test/org/apache/hive/service/auth/TestLdapAuthenticationProviderImpl.java index c8632aefb9da..7faa404752d6 100644 --- a/service/src/test/org/apache/hive/service/auth/TestLdapAuthenticationProviderImpl.java +++ b/service/src/test/org/apache/hive/service/auth/TestLdapAuthenticationProviderImpl.java @@ -63,21 +63,21 @@ public void setup() throws AuthenticationException { public void authenticateGivenBlankPassword() throws Exception { auth = new LdapAuthenticationProviderImpl(conf, new LdapSearchFactory()); expectAuthenticationExceptionForInvalidPassword(); - auth.Authenticate("user", ""); + auth.authenticate("user", ""); } @Test public void authenticateGivenStringWithNullCharacterForPassword() throws Exception { auth = new LdapAuthenticationProviderImpl(conf, new LdapSearchFactory()); expectAuthenticationExceptionForInvalidPassword(); - auth.Authenticate("user", "\0"); + auth.authenticate("user", "\0"); } @Test public void authenticateGivenNullForPassword() throws Exception { auth = new LdapAuthenticationProviderImpl(conf, new LdapSearchFactory()); expectAuthenticationExceptionForInvalidPassword(); - auth.Authenticate("user", null); + auth.authenticate("user", null); } @Test @@ -93,7 +93,7 @@ public void testAuthenticateNoUserOrGroupFilter() throws NamingException, Authen when(factory.getInstance(conf, "cn=user1,ou=Users,dc=mycorp,dc=com", "Blah")).thenThrow(AuthenticationException.class); auth = new LdapAuthenticationProviderImpl(conf, factory); - auth.Authenticate("user1", "Blah"); + auth.authenticate("user1", "Blah"); verify(factory, times(2)).getInstance(isA(HiveConf.class), anyString(), eq("Blah")); verify(search, atLeastOnce()).close(); @@ -271,7 +271,7 @@ public void testAuthenticateWhenUserMembershipKeyFilterPasses() throws NamingExc when(search.isUserMemberOfGroup("user1", groupDn)).thenReturn(true); auth = new LdapAuthenticationProviderImpl(conf, factory); - auth.Authenticate("user1", "Blah"); + auth.authenticate("user1", "Blah"); verify(factory, times(1)).getInstance(isA(HiveConf.class), anyString(), eq("Blah")); verify(search, times(1)).findGroupDn(anyString()); @@ -293,7 +293,7 @@ public void testAuthenticateWhenUserMembershipKeyFilterFails() throws NamingExce when(search.isUserMemberOfGroup("user1", groupDn)).thenReturn(false); auth = new LdapAuthenticationProviderImpl(conf, factory); - auth.Authenticate("user1", "Blah"); + auth.authenticate("user1", "Blah"); } @Test @@ -316,7 +316,7 @@ public void testAuthenticateWhenUserMembershipKeyFilter2x2PatternsPasses() throw when(search.isUserMemberOfGroup("user1", "cn=HIVE-USERS2,ou=Groups,ou=branch1,dc=mycorp,dc=com")).thenReturn(true); auth = new LdapAuthenticationProviderImpl(conf, factory); - auth.Authenticate("user1", "Blah"); + auth.authenticate("user1", "Blah"); verify(factory, times(1)).getInstance(isA(HiveConf.class), anyString(), eq("Blah")); verify(search, times(2)).findGroupDn(anyString()); @@ -341,7 +341,7 @@ public void testAuthenticateWithBindInCredentialFilePasses() throws Authenticati when(search.findUserDn(eq(authUser))).thenReturn(authFullUser); auth = new LdapAuthenticationProviderImpl(conf, factory); - auth.Authenticate(authUser, authPass); + auth.authenticate(authUser, authPass); verify(factory, times(1)).getInstance(isA(HiveConf.class), eq(bindUser), eq(bindPass)); verify(factory, times(1)).getInstance(isA(HiveConf.class), eq(authFullUser), eq(authPass)); @@ -359,7 +359,7 @@ public void testAuthenticateWithBindInMissingCredentialFilePasses() throws Authe conf.set(CredentialProviderFactory.CREDENTIAL_PROVIDER_PATH, credentialsPath); auth = new LdapAuthenticationProviderImpl(conf, factory); - auth.Authenticate(authUser, authPass); + auth.authenticate(authUser, authPass); verify(factory, times(1)).getInstance(isA(HiveConf.class), eq(authUser), eq(authPass)); } @@ -377,7 +377,7 @@ public void testAuthenticateWithBindUserPasses() throws AuthenticationException, when(search.findUserDn(eq(authUser))).thenReturn(authFullUser); auth = new LdapAuthenticationProviderImpl(conf, factory); - auth.Authenticate(authUser, authPass); + auth.authenticate(authUser, authPass); verify(factory, times(1)).getInstance(isA(HiveConf.class), eq(bindUser), eq(bindPass)); verify(factory, times(1)).getInstance(isA(HiveConf.class), eq(authFullUser), eq(authPass)); @@ -400,7 +400,7 @@ public void testAuthenticateWithBindUserFailsOnAuthentication() throws Authentic when(search.findUserDn(eq(authUser))).thenReturn(authFullUser); auth = new LdapAuthenticationProviderImpl(conf, factory); - auth.Authenticate(authUser, authPass); + auth.authenticate(authUser, authPass); } @Test @@ -417,7 +417,7 @@ public void testAuthenticateWithBindUserFailsOnGettingDn() throws Authentication when(search.findUserDn(eq(authUser))).thenThrow(NamingException.class); auth = new LdapAuthenticationProviderImpl(conf, factory); - auth.Authenticate(authUser, authPass); + auth.authenticate(authUser, authPass); } @Test @@ -433,7 +433,7 @@ public void testAuthenticateWithBindUserFailsOnBinding() throws AuthenticationEx when(factory.getInstance(any(HiveConf.class), eq(bindUser), eq(bindPass))).thenThrow(AuthenticationException.class); auth = new LdapAuthenticationProviderImpl(conf, factory); - auth.Authenticate(authUser, authPass); + auth.authenticate(authUser, authPass); } private void expectAuthenticationExceptionForInvalidPassword() { @@ -444,7 +444,7 @@ private void expectAuthenticationExceptionForInvalidPassword() { private void authenticateUserAndCheckSearchIsClosed(String user) throws IOException { auth = new LdapAuthenticationProviderImpl(conf, factory); try { - auth.Authenticate(user, "password doesn't matter"); + auth.authenticate(user, "password doesn't matter"); } finally { verify(search, atLeastOnce()).close(); } diff --git a/service/src/test/org/apache/hive/service/auth/ldap/LdapAuthenticationTestCase.java b/service/src/test/org/apache/hive/service/auth/ldap/LdapAuthenticationTestCase.java index 40b99f47b90e..575ac59b558b 100644 --- a/service/src/test/org/apache/hive/service/auth/ldap/LdapAuthenticationTestCase.java +++ b/service/src/test/org/apache/hive/service/auth/ldap/LdapAuthenticationTestCase.java @@ -42,7 +42,7 @@ private LdapAuthenticationTestCase(Builder builder) { public void assertAuthenticatePasses(Credentials credentials) { try { - ldapProvider.Authenticate(credentials.getUser(), credentials.getPassword()); + ldapProvider.authenticate(credentials.getUser(), credentials.getPassword()); } catch (AuthenticationException e) { String message = String.format("Authentication failed for user '%s' with password '%s'", credentials.getUser(), credentials.getPassword()); @@ -60,7 +60,7 @@ public void assertAuthenticateFailsUsingWrongPassword(Credentials credentials) { public void assertAuthenticateFails(String user, String password) { try { - ldapProvider.Authenticate(user, password); + ldapProvider.authenticate(user, password); Assert.fail(String.format("Expected authentication to fail for %s", user)); } catch (AuthenticationException expected) { Assert.assertNotNull("Expected authentication exception", expected); diff --git a/service/src/test/org/apache/hive/service/server/TestHS2HttpServerLDAP.java b/service/src/test/org/apache/hive/service/server/TestHS2HttpServerLDAP.java index 5d48d1323f86..cdcf98ca7f6f 100644 --- a/service/src/test/org/apache/hive/service/server/TestHS2HttpServerLDAP.java +++ b/service/src/test/org/apache/hive/service/server/TestHS2HttpServerLDAP.java @@ -185,7 +185,7 @@ public static void afterTests() { public static class DummyLdapAuthenticationProviderImpl implements PasswdAuthenticationProvider { @Override - public void Authenticate(String user, String password) throws AuthenticationException { + public void authenticate(String user, String password) throws AuthenticationException { if (!(user.equals(VALID_USER) && password.equals(VALID_PASS))) throw new AuthenticationException(); }