Skip to content

fix[SP-7346]: update doSetMetadata endpoint to accept XML#6254

Merged
joana-fb merged 2 commits into
11.0from
SP-7346
May 29, 2026
Merged

fix[SP-7346]: update doSetMetadata endpoint to accept XML#6254
joana-fb merged 2 commits into
11.0from
SP-7346

Conversation

@befc

@befc befc commented May 29, 2026

Copy link
Copy Markdown
Contributor

joana-fb added 2 commits May 29, 2026 11:49
* fix[BISERVER-15545]: update doSetMetadata endpoint to accept XML

* Apply suggestion from @Copilot

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* fix[BISERVER-15545]: update doSetMetadata endpoint to accept XML

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

Backported for: SP-7346
Copilot AI review requested due to automatic review settings May 29, 2026 10:50
@befc befc requested a review from a team as a code owner May 29, 2026 10:50

Copilot AI 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.

Pull request overview

Backports the addition of an XML-consuming overload for PUT /repo/files/{pathId}/metadata (originally from PRs #6201 and #6251) to the 11.0 branch. The new endpoint securely unmarshals XML using a StAX reader that disables external entities/DTDs (mitigating XXE), reusing the existing getSecureXmlStreamReader/getUnmarshaller helpers already employed by the ACL and creator XML endpoints. Tests for XXE protection and XML success/error paths are restored.

Changes:

  • Adds XML overload of doSetMetadata with secure unmarshalling, plus private helpers unmarshalMetadata, closeXmlStreamReader, and InvalidXmlPayloadException.
  • Renames existing JSON tests and adds new tests for XML success/error paths and XXE handling (415 on malicious payload, 200 on clean payload).

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
extensions/src/main/java/org/pentaho/platform/web/http/api/resources/FileResource.java Adds the new XML overload for doSetMetadata and supporting helpers/exception type.
extensions/src/test/java/org/pentaho/platform/web/http/api/resources/FileResourceTest.java Restores XXE tests, renames JSON metadata tests, and adds XML success/error tests.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@hitachivantarasonarqube

Copy link
Copy Markdown

Failed Quality Gate failed

  • 72.70% Coverage on New Code (is less than 80.00%)
  • 1 New Issues (is greater than 0)

Project ID: pentaho:pentaho-platform-ce-parent

View in SonarQube

@buildguy

Copy link
Copy Markdown
Collaborator

👍 Frogbot scanned this pull request and did not find any new security issues.

Note:

Frogbot also supports Contextual Analysis, Secret Detection, IaC and SAST Vulnerabilities Scanning. This features are included as part of the JFrog Advanced Security package, which isn't enabled on your system.


@buildguy

Copy link
Copy Markdown
Collaborator

✅ Build finished in 41m 5s

Build command:

mvn clean verify -B -e -Daudit -Djs.no.sandbox -pl extensions

👌 All tests passed!

Tests run: 1796, Failures: 0, Skipped: 1    Test Results


ℹ️ This is an automatic message

@joana-fb joana-fb merged commit 4f06a73 into 11.0 May 29, 2026
2 of 3 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.

4 participants