HADOOP-19958. Support IPv6 delegation token service addresses - #8669
Open
smengcl wants to merge 1 commit into
Open
HADOOP-19958. Support IPv6 delegation token service addresses#8669smengcl wants to merge 1 commit into
smengcl wants to merge 1 commit into
Conversation
|
💔 -1 overall
This message was automatically generated. |
There was a problem hiding this comment.
Pull request overview
This PR addresses ambiguity in delegation token service identifiers when the host is an IPv6 literal by introducing a consistent bracketed "[host]:port" representation and ensuring socket address creation accepts bracketed IPv6 authorities.
Changes:
- Add
NetUtils.getHostPortString(host, port)to formathost:portwhile bracketing IPv6 literals. - Update delegation token service string construction to use the shared host/port formatter.
- Add tests covering IPv6 host/port formatting, bracketed IPv6 socket address parsing, and delegation token service round-trips.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/security/TestSecurityUtil.java | Updates token-service string expectations and adds an IPv6 token service round-trip test. |
| hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/net/TestNetUtils.java | Adds tests for IPv6 host/port formatting, bracketed parsing, and rejection of ambiguous unbracketed IPv6 authorities. |
| hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/SecurityUtil.java | Uses the shared host/port formatter when building token service identifiers. |
| hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/net/NetUtils.java | Adds IPv6-aware host/port formatting and strips brackets from parsed URI hosts. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+788
to
+791
| if (normalizedHost != null && normalizedHost.contains(":")) { | ||
| return "[" + normalizedHost + "]:" + port; | ||
| } | ||
| return normalizedHost + ":" + port; |
|
💔 -1 overall
This message was automatically generated. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Generated-by: Codex (GPT-5.6 Sol)
Description of PR
Jira: HADOOP-19958
Parent Jira: HADOOP-11890
Delegation token services use
host:port. This representation is ambiguous when the host is an IPv6 literal.This change:
NetUtilshelper that formats IPv6 addresses as[host]:port;hadoop.security.token.service.use_ipistrueorfalse;How was this patch tested?
JAVA_HOME=<JDK17> mvn -B -pl :hadoop-common -Dtest=TestNetUtils,TestSecurityUtil test --no-transfer-progressgit diff --check asf/trunk...HEADFor code changes:
(e.g. 'HADOOP-17799. Your PR title ...')?
declared according to the connector-specific documentation? Note: Automated CI
testing doesn't cover all cases so manual testing with cloud storage is still
required. Not applicable to this change.
under ASF 2.0? No new dependencies are added.
LICENSE,LICENSE-binary,NOTICE-binaryfiles?No license or notice changes are required.
AI Tooling
Contains content generated by Codex.
If an AI tool was used:
where is the name of the AI tool used.
https://www.apache.org/legal/generative-tooling.html