Skip to content

Commit 43c0de7

Browse files
committed
HADOOP-19359. Accelerate token negotiation for other similar mechanisms.
1 parent a1d2cf4 commit 43c0de7

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ipc/Server.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2673,7 +2673,7 @@ private RpcSaslProto buildSaslNegotiateResponse()
26732673
// accelerate token negotiation by sending initial challenge
26742674
// in the negotiation response
26752675
if (enabledAuthMethods.contains(AuthMethod.TOKEN)
2676-
&& SaslMechanismFactory.isDefaultMechanism(AuthMethod.TOKEN.getMechanismName())) {
2676+
&& SaslMechanismFactory.isDigestMechanism(AuthMethod.TOKEN.getMechanismName())) {
26772677
saslServer = createSaslServer(AuthMethod.TOKEN);
26782678
byte[] challenge = saslServer.evaluateResponse(new byte[0]);
26792679
RpcSaslProto.Builder negotiateBuilder =

hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/CustomizedCallbackHandler.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ private static synchronized CustomizedCallbackHandler getSynchronously(
4747

4848
//cache miss
4949
final Class<?> clazz = conf.getClass(key, DefaultHandler.class);
50-
LOG.info("{} = {}", key, clazz);
50+
LOG.debug("{} = {}", key, clazz);
5151
if (clazz == DefaultHandler.class) {
5252
return DefaultHandler.INSTANCE;
5353
}

hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/SaslMechanismFactory.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,5 +65,13 @@ public static boolean isDefaultMechanism(String saslMechanism) {
6565
return HADOOP_SECURITY_SASL_MECHANISM_DEFAULT.equals(saslMechanism);
6666
}
6767

68+
public static boolean isDigestMechanism(String saslMechanism) {
69+
return saslMechanism.startsWith("DIGEST-");
70+
}
71+
6872
private SaslMechanismFactory() {}
73+
74+
public static void main(String[] args) {
75+
System.out.println("SASL_MECHANISM = " + getMechanism());
76+
}
6977
}

0 commit comments

Comments
 (0)