Conversation
* 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
…seable XML payloads (#6251) Backported for: SP-7346
There was a problem hiding this comment.
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
doSetMetadatawith secure unmarshalling, plus private helpersunmarshalMetadata,closeXmlStreamReader, andInvalidXmlPayloadException. - 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.
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. |
✅ Build finished in 41m 5sBuild 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 |


NOTE: This PR was created by Copilot automation.
Backport Information
Changes
Conflict Resolution
Target