Skip to content

Commit 57e80a2

Browse files
authored
HIVE-28502: Refactor method names that start with capital letters in PasswdAuthenticationProvider class (#5434)(Dmitriy Fingerman, reviewed by Denys Kuzmenko, Butao Zhang)
1 parent 096469c commit 57e80a2

14 files changed

Lines changed: 29 additions & 30 deletions

itests/hive-minikdc/src/test/java/org/apache/hive/minikdc/TestJdbcNonKrbSASLWithMiniKdc.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public class TestJdbcNonKrbSASLWithMiniKdc extends TestJdbcWithMiniKdc{
4242

4343
public static class CustomAuthenticator implements PasswdAuthenticationProvider {
4444
@Override
45-
public void Authenticate(String user, String password) throws AuthenticationException {
45+
public void authenticate(String user, String password) throws AuthenticationException {
4646
if (!(SASL_NONKRB_USER1.equals(user) && SASL_NONKRB_PWD.equals(password)) &&
4747
!(SASL_NONKRB_USER2.equals(user) && SASL_NONKRB_PWD.equals(password))) {
4848
throw new AuthenticationException("Authentication failed");

itests/hive-unit/src/test/java/org/apache/hive/service/auth/TestCustomAuthentication.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ private void init(){
108108
}
109109

110110
@Override
111-
public void Authenticate(String user, String password) throws AuthenticationException {
111+
public void authenticate(String user, String password) throws AuthenticationException {
112112

113113
if(!userMap.containsKey(user)){
114114
throw new AuthenticationException("Invalid user : "+user);

itests/hive-unit/src/test/java/org/apache/hive/service/auth/TrustDomainAuthenticationTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ private void init(){
183183
}
184184

185185
@Override
186-
public void Authenticate(String user, String password) throws AuthenticationException {
186+
public void authenticate(String user, String password) throws AuthenticationException {
187187

188188
if(!userMap.containsKey(user)){
189189
throw new AuthenticationException("Invalid user : "+user);

service/src/java/org/apache/hive/service/auth/AnonymousAuthenticationProviderImpl.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
public class AnonymousAuthenticationProviderImpl implements PasswdAuthenticationProvider {
2727

2828
@Override
29-
public void Authenticate(String user, String password) throws AuthenticationException {
29+
public void authenticate(String user, String password) throws AuthenticationException {
3030
// no-op authentication
3131
}
3232

service/src/java/org/apache/hive/service/auth/CustomAuthenticationProviderImpl.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@ public class CustomAuthenticationProviderImpl implements PasswdAuthenticationPro
5050
}
5151

5252
@Override
53-
public void Authenticate(String user, String password) throws AuthenticationException {
54-
customProvider.Authenticate(user, password);
53+
public void authenticate(String user, String password) throws AuthenticationException {
54+
customProvider.authenticate(user, password);
5555
}
5656

5757
}

service/src/java/org/apache/hive/service/auth/LdapAuthenticationProviderImpl.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ public LdapAuthenticationProviderImpl(HiveConf conf) {
6969
}
7070

7171
@Override
72-
public void Authenticate(String user, String password) throws AuthenticationException {
72+
public void authenticate(String user, String password) throws AuthenticationException {
7373
DirSearch search = null;
7474
String bindUser = this.conf.getVar(HiveConf.ConfVars.HIVE_SERVER2_PLAIN_LDAP_BIND_USER);
7575
String bindPassword = null;

service/src/java/org/apache/hive/service/auth/PamAuthenticationProviderImpl.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public class PamAuthenticationProviderImpl implements PasswdAuthenticationProvid
3232
}
3333

3434
@Override
35-
public void Authenticate(String user, String password) throws AuthenticationException {
35+
public void authenticate(String user, String password) throws AuthenticationException {
3636

3737
if (pamServiceNames == null || pamServiceNames.trim().isEmpty()) {
3838
throw new AuthenticationException("No PAM services are set.");

service/src/java/org/apache/hive/service/auth/PasswdAuthenticationProvider.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,5 +35,5 @@ public interface PasswdAuthenticationProvider {
3535
* @throws AuthenticationException When a user is found to be
3636
* invalid by the implementation
3737
*/
38-
void Authenticate(String user, String password) throws AuthenticationException;
38+
void authenticate(String user, String password) throws AuthenticationException;
3939
}

service/src/java/org/apache/hive/service/auth/PlainSaslHelper.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
package org.apache.hive.service.auth;
1919

2020
import java.io.IOException;
21-
import java.net.InetAddress;
2221
import java.security.Security;
2322
import java.util.HashMap;
2423

@@ -160,7 +159,7 @@ public void handle(Callback[] callbacks) throws IOException, UnsupportedCallback
160159
PasswdAuthenticationProvider provider =
161160
AuthenticationProviderFactory.getAuthenticationProvider(authMethod);
162161
try {
163-
provider.Authenticate(username, password);
162+
provider.authenticate(username, password);
164163
} catch (Exception e) {
165164
LOG.error("Login attempt is failed for user : " + username + ". Error Messsage : " + e.getMessage());
166165
throw e;

service/src/java/org/apache/hive/service/auth/ldap/LdapAuthService.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ public boolean authenticate(HttpServletRequest request, HttpServletResponse resp
6969
String clientUserName = validateCookie(request);
7070
if (clientUserName == null) {
7171
clientUserName = getUsername(request);
72-
authProvider.Authenticate(clientUserName, getPassword(request));
72+
authProvider.authenticate(clientUserName, getPassword(request));
7373

7474
String cookieToken = HttpAuthUtils.createCookieToken(clientUserName);
7575
Cookie hs2Cookie = signAndCreateCookie(cookieToken);

0 commit comments

Comments
 (0)