gnodet-bot commented on code in PR #30212:
URL: https://github.com/apache/camel/pull/30212#discussion_r4587663645
##########
core/camel-core-model/src/main/java/org/apache/camel/model/dataformat/JaxbDataFormat.java:
##########
@@ -92,6 +92,12 @@ public class JaxbDataFormat extends DataFormatDefinition
implements ContentTypeH
@Metadata(label = "advanced", description = "XML namespace to use for
fragment parsing.")
private String partNamespace;
@XmlAttribute
+ @Metadata(label = "advanced", javaType = "java.lang.Boolean",
+ description = "Whether the CamelJaxbPartClass and
CamelJaxbPartNamespace headers are used, when set, instead of"
+ + " the partClass and partNamespace options when
marshalling and unmarshalling."
+ + " This should only be enabled when desired to be
used.")
Review Comment:
⚠️ **(Re-raised from prior review)** The trailing sentence "This should only
be enabled when desired to be used." is tautological — it applies to every
option that exists and adds no information. Replace it with a concrete security
implication:
```suggestion
@Metadata(label = "advanced", javaType = "java.lang.Boolean",
description = "Whether the CamelJaxbPartClass and
CamelJaxbPartNamespace headers are used, when set, instead of"
+ " the partClass and partNamespace options when
marshalling and unmarshalling."
+ " Only enable this if the route intentionally
sets these headers; do not enable on"
+ " routes that process external input, as it
allows the caller to control the class to unmarshal to.")
```
##########
core/camel-core-model/src/main/java/org/apache/camel/model/dataformat/JaxbDataFormat.java:
##########
@@ -564,6 +581,26 @@ public Builder partNamespace(String partNamespace) {
return this;
}
+ /**
+ * Whether the CamelJaxbPartClass and CamelJaxbPartNamespace headers
are used, when set, instead of the
+ * partClass and partNamespace options when marshalling and
unmarshalling. This should only be enabled when
+ * desired to be used.
+ */
+ public Builder allowPartClassFromHeader(String
allowPartClassFromHeader) {
+ this.allowPartClassFromHeader = allowPartClassFromHeader;
+ return this;
+ }
+
+ /**
+ * Whether the CamelJaxbPartClass and CamelJaxbPartNamespace headers
are used, when set, instead of the
+ * partClass and partNamespace options when marshalling and
unmarshalling. This should only be enabled when
+ * desired to be used.
+ */
Review Comment:
Same tautological tail — should match the corrected Javadoc above.
```suggestion
/**
* Whether the CamelJaxbPartClass and CamelJaxbPartNamespace headers
are used, when set, instead of the
* partClass and partNamespace options when marshalling and
unmarshalling. Only enable this if the route
* intentionally sets these headers; do not enable on routes that
process external input.
*/
```
##########
core/camel-core-model/src/main/java/org/apache/camel/model/dataformat/JaxbDataFormat.java:
##########
@@ -564,6 +581,26 @@ public Builder partNamespace(String partNamespace) {
return this;
}
+ /**
+ * Whether the CamelJaxbPartClass and CamelJaxbPartNamespace headers
are used, when set, instead of the
+ * partClass and partNamespace options when marshalling and
unmarshalling. This should only be enabled when
+ * desired to be used.
+ */
Review Comment:
Same tautological tail in the Builder Javadoc — should match the `@Metadata`
description.
```suggestion
/**
* Whether the CamelJaxbPartClass and CamelJaxbPartNamespace headers
are used, when set, instead of the
* partClass and partNamespace options when marshalling and
unmarshalling. Only enable this if the route
* intentionally sets these headers; do not enable on routes that
process external input.
*/
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]