[
https://issues.apache.org/jira/browse/HADOOP-19306?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17898013#comment-17898013
]
ASF GitHub Bot commented on HADOOP-19306:
-----------------------------------------
szetszwo commented on code in PR #7140:
URL: https://github.com/apache/hadoop/pull/7140#discussion_r1840925600
##########
hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocol/datatransfer/sasl/SaslDataTransferServer.java:
##########
@@ -224,21 +225,8 @@ static final class SaslServerCallbackHandler
*/
SaslServerCallbackHandler(Configuration conf, PasswordFunction
passwordFunction) {
this.passwordFunction = passwordFunction;
-
- final Class<?> clazz = conf.getClass(
-
HdfsClientConfigKeys.DFS_DATA_TRANSFER_SASL_CUSTOMIZEDCALLBACKHANDLER_CLASS_KEY,
- CustomizedCallbackHandler.DefaultHandler.class);
- final Object callbackHandler;
- try {
- callbackHandler = clazz.newInstance();
- } catch (Exception e) {
- throw new IllegalStateException("Failed to create a new instance of "
+ clazz, e);
- }
- if (callbackHandler instanceof CustomizedCallbackHandler) {
- customizedCallbackHandler = (CustomizedCallbackHandler)
callbackHandler;
- } else {
- customizedCallbackHandler =
CustomizedCallbackHandler.delegate(callbackHandler);
- }
+ this.customizedCallbackHandler = CustomizedCallbackHandler.get(
+
HdfsClientConfigKeys.DFS_DATA_TRANSFER_SASL_CUSTOMIZEDCALLBACKHANDLER_CLASS_KEY,
conf);
Review Comment:
That's a good idea. Let's use the same conf.
> Support user defined auth Callback in SaslRpcServer
> ---------------------------------------------------
>
> Key: HADOOP-19306
> URL: https://issues.apache.org/jira/browse/HADOOP-19306
> Project: Hadoop Common
> Issue Type: Improvement
> Components: ipc, security
> Reporter: Tsz-wo Sze
> Assignee: Tsz-wo Sze
> Priority: Major
> Labels: pull-request-available
>
> Similar to HDFS-17576, SaslRpcServer should support CustomizedCallbackHandler.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]