Skip to content

TEZ-4742: AMWebController CORS: only reflect Origin when it matches configured Tez UI base URL#528

Merged
abstractdog merged 1 commit into
apache:masterfrom
Aggarwal-Raghav:TEZ-4742
Jul 21, 2026
Merged

TEZ-4742: AMWebController CORS: only reflect Origin when it matches configured Tez UI base URL#528
abstractdog merged 1 commit into
apache:masterfrom
Aggarwal-Raghav:TEZ-4742

Conversation

@Aggarwal-Raghav

Copy link
Copy Markdown
Contributor

No description provided.

@tez-yetus

Copy link
Copy Markdown

💔 -1 overall

Vote Subsystem Runtime Logfile Comment
+0 🆗 reexec 0m 12s Docker mode activated.
_ Prechecks _
+1 💚 dupname 0m 0s No case conflicting files found.
+0 🆗 detsecrets 0m 0s detect-secrets was not available.
+1 💚 @author 0m 0s The patch does not contain any @author tags.
-1 ❌ test4tests 0m 0s The patch doesn't appear to include any new or modified tests. Please justify why no new tests are needed for this patch. Also please list what manual steps were performed to verify this patch.
_ master Compile Tests _
+1 💚 mvninstall 4m 40s master passed
+1 💚 compile 4m 6s master passed
+1 💚 checkstyle 0m 44s master passed
+1 💚 javadoc 0m 31s master passed
+0 🆗 spotbugs 1m 41s tez-dag in master has 537 extant spotbugs warnings.
_ Patch Compile Tests _
+1 💚 mvninstall 3m 48s the patch passed
+1 💚 codespell 1m 36s No new issues.
+1 💚 compile 4m 0s the patch passed
+1 💚 javac 4m 1s the patch passed
+1 💚 blanks 0m 0s The patch has no blanks issues.
+1 💚 checkstyle 0m 37s the patch passed
+1 💚 javadoc 0m 30s the patch passed
+1 💚 spotbugs 1m 56s the patch passed
_ Other Tests _
-1 ❌ unit 76m 4s /patch-unit-root.txt root in the patch passed.
+1 💚 asflicense 0m 34s The patch does not generate ASF License warnings.
102m 39s
Reason Tests
Failed junit tests tez.dag.app.web.TestAMWebController
Subsystem Report/Notes
Docker ClientAPI=1.55 ServerAPI=1.55 base: https://ci-hadoop.apache.org/job/tez-multibranch/job/PR-528/1/artifact/out/Dockerfile
Optional Tests dupname compile unit asflicense javac javadoc spotbugs checkstyle codespell detsecrets
uname Linux 574a98fe61df 5.15.0-181-generic #191-Ubuntu SMP Fri May 22 19:09:02 UTC 2026 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality tez-personality.sh
git revision master / b9d8c0f
Default Java Eclipse Adoptium-21.0.11+10-LTS
Test Results https://ci-hadoop.apache.org/job/tez-multibranch/job/PR-528/1/testReport/
Max. process+thread count 2128 (vs. ulimit of 5500)
modules C: tez-dag U: tez-dag
Console output https://ci-hadoop.apache.org/job/tez-multibranch/job/PR-528/1/console
versions git=2.43.0 maven=3.9.15 spotbugs=4.9.3 codespell=2.4.1
Powered by Apache Yetus 0.15.1 https://yetus.apache.org

This message was automatically generated.

@tez-yetus

Copy link
Copy Markdown

🎊 +1 overall

Vote Subsystem Runtime Logfile Comment
+0 🆗 reexec 0m 12s Docker mode activated.
_ Prechecks _
+1 💚 dupname 0m 0s No case conflicting files found.
+0 🆗 detsecrets 0m 0s detect-secrets was not available.
+1 💚 @author 0m 0s The patch does not contain any @author tags.
+1 💚 test4tests 0m 0s The patch appears to include 1 new or modified test files.
_ master Compile Tests _
+1 💚 mvninstall 4m 48s master passed
+1 💚 compile 4m 3s master passed
+1 💚 checkstyle 0m 43s master passed
+1 💚 javadoc 0m 31s master passed
+0 🆗 spotbugs 1m 44s tez-dag in master has 537 extant spotbugs warnings.
_ Patch Compile Tests _
+1 💚 mvninstall 3m 42s the patch passed
+1 💚 codespell 1m 36s No new issues.
+1 💚 compile 4m 6s the patch passed
+1 💚 javac 4m 6s the patch passed
+1 💚 blanks 0m 0s The patch has no blanks issues.
+1 💚 checkstyle 0m 37s the patch passed
+1 💚 javadoc 0m 29s the patch passed
+1 💚 spotbugs 1m 55s the patch passed
_ Other Tests _
+1 💚 unit 74m 47s root in the patch passed.
+1 💚 asflicense 0m 34s The patch does not generate ASF License warnings.
101m 26s
Subsystem Report/Notes
Docker ClientAPI=1.55 ServerAPI=1.55 base: https://ci-hadoop.apache.org/job/tez-multibranch/job/PR-528/2/artifact/out/Dockerfile
Optional Tests dupname compile unit asflicense javac javadoc spotbugs checkstyle codespell detsecrets
uname Linux e8849ff190eb 5.15.0-181-generic #191-Ubuntu SMP Fri May 22 19:09:02 UTC 2026 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality tez-personality.sh
git revision master / b9d8c0f
Default Java Eclipse Adoptium-21.0.11+10-LTS
Test Results https://ci-hadoop.apache.org/job/tez-multibranch/job/PR-528/2/testReport/
Max. process+thread count 1535 (vs. ulimit of 5500)
modules C: tez-dag U: tez-dag
Console output https://ci-hadoop.apache.org/job/tez-multibranch/job/PR-528/2/console
versions git=2.43.0 maven=3.9.15 spotbugs=4.9.3 codespell=2.4.1
Powered by Apache Yetus 0.15.1 https://yetus.apache.org

This message was automatically generated.

@Aggarwal-Raghav

Copy link
Copy Markdown
Contributor Author

CC @abstractdog , ready for review

@abstractdog abstractdog left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minor comment

Comment on lines +140 to 147
if (!historyUrlBase.isEmpty()) {
try {
URL url = URI.create(historyUrlBase).toURL();
origin = url.getProtocol() + "://" + url.getAuthority();
trustedOrigin = url.getProtocol() + "://" + url.getAuthority();
} catch (IllegalArgumentException | MalformedURLException e) {
LOG.debug("Invalid url set for tez history url base: {}", historyUrlBase, e);
}
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe refactor this to a method that derives the origin or returns null

Comment on lines +152 to +153
if (requestOrigin == null || requestOrigin.equals(trustedOrigin)) {
res.setHeader(ACCESS_CONTROL_ALLOW_ORIGIN, encodeHeader(trustedOrigin));

@abstractdog abstractdog Jul 21, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

make a code comment above this for "educational purposes" regarding why we cannot reflect the request origin without checking the server's trusted origin, as this is the core of this fix

@tez-yetus

Copy link
Copy Markdown

🎊 +1 overall

Vote Subsystem Runtime Logfile Comment
+0 🆗 reexec 0m 12s Docker mode activated.
_ Prechecks _
+1 💚 dupname 0m 0s No case conflicting files found.
+0 🆗 detsecrets 0m 0s detect-secrets was not available.
+1 💚 @author 0m 0s The patch does not contain any @author tags.
+1 💚 test4tests 0m 0s The patch appears to include 1 new or modified test files.
_ master Compile Tests _
+1 💚 mvninstall 4m 51s master passed
+1 💚 compile 4m 3s master passed
+1 💚 checkstyle 0m 44s master passed
+1 💚 javadoc 0m 31s master passed
+0 🆗 spotbugs 1m 44s tez-dag in master has 537 extant spotbugs warnings.
_ Patch Compile Tests _
+1 💚 mvninstall 3m 46s the patch passed
+1 💚 codespell 1m 34s No new issues.
+1 💚 compile 4m 6s the patch passed
+1 💚 javac 4m 6s the patch passed
+1 💚 blanks 0m 1s The patch has no blanks issues.
+1 💚 checkstyle 0m 37s the patch passed
+1 💚 javadoc 0m 29s the patch passed
+1 💚 spotbugs 1m 54s the patch passed
_ Other Tests _
+1 💚 unit 76m 52s root in the patch passed.
+1 💚 asflicense 0m 35s The patch does not generate ASF License warnings.
103m 35s
Subsystem Report/Notes
Docker ClientAPI=1.55 ServerAPI=1.55 base: https://ci-hadoop.apache.org/job/tez-multibranch/job/PR-528/3/artifact/out/Dockerfile
Optional Tests dupname compile unit asflicense javac javadoc spotbugs checkstyle codespell detsecrets
uname Linux a838b4f77acc 5.15.0-181-generic #191-Ubuntu SMP Fri May 22 19:09:02 UTC 2026 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality tez-personality.sh
git revision master / 0f389d2
Default Java Eclipse Adoptium-21.0.11+10-LTS
Test Results https://ci-hadoop.apache.org/job/tez-multibranch/job/PR-528/3/testReport/
Max. process+thread count 1406 (vs. ulimit of 5500)
modules C: tez-dag U: tez-dag
Console output https://ci-hadoop.apache.org/job/tez-multibranch/job/PR-528/3/console
versions git=2.43.0 maven=3.9.15 spotbugs=4.9.3 codespell=2.4.1
Powered by Apache Yetus 0.15.1 https://yetus.apache.org

This message was automatically generated.

@abstractdog abstractdog left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@abstractdog
abstractdog merged commit 74bb821 into apache:master Jul 21, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants