[ 
https://issues.apache.org/jira/browse/HADOOP-19958?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18119011#comment-18119011
 ] 

ASF GitHub Bot commented on HADOOP-19958:
-----------------------------------------

smengcl commented on code in PR #8669:
URL: https://github.com/apache/hadoop/pull/8669#discussion_r4100668729


##########
hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/security/TestSecurityUtil.java:
##########
@@ -366,6 +366,14 @@ public void testSocketAddrWithIP() {
     verifyServiceAddr(staticHost, "127.0.0.1");
   }
 
+  @Test
+  public void testSocketAddrWithIPv6() throws Exception {
+    SecurityUtil.setTokenServiceUseIp(false);
+    String host = "::1";
+    InetSocketAddress addr = NetUtils.createSocketAddr("[::1]:123");
+    verifyAddress(addr, host, InetAddress.getByName(host).getHostAddress(), 
123);

Review Comment:
   Done. Static resolution keeps the IPv6 hostname stable across systems, while 
the test still verifies both token-service modes





> Support IPv6 delegation token service addresses
> -----------------------------------------------
>
>                 Key: HADOOP-19958
>                 URL: https://issues.apache.org/jira/browse/HADOOP-19958
>             Project: Hadoop Common
>          Issue Type: Sub-task
>            Reporter: Siyao Meng
>            Assignee: Siyao Meng
>            Priority: Major
>              Labels: pull-request-available
>
> Hadoop formats delegation token services as host:port. This format is 
> ambiguous for IPv6 literals. Update NetUtils and SecurityUtil to use 
> bracketed IPv6 authorities. Verify round trips with 
> hadoop.security.token.service.use_ip set to true and false. Reject ambiguous 
> unbracketed IPv6 authorities.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to