This is an automated email from the ASF dual-hosted git repository. davsclaus pushed a commit to branch re in repository https://gitbox.apache.org/repos/asf/camel.git
commit acafbeba2fa9b08fe5d546a833d281076e3edff7 Author: Claus Ibsen <[email protected]> AuthorDate: Thu Jun 26 10:47:27 2025 +0200 CAMEL-22200: components that are resource endpoint based should have content cache true as default and make it configurable on component level. --- .../camel/catalog/components/json-patch.json | 11 ++++--- .../camel/catalog/components/json-validator.json | 9 ++--- .../apache/camel/catalog/components/jsonata.json | 8 +++-- .../org/apache/camel/catalog/components/jte.json | 11 ++++--- .../dsl/JsonPatchEndpointBuilderFactory.java | 38 ++++++++++++++++++++++ 5 files changed, 61 insertions(+), 16 deletions(-) diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/json-patch.json b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/json-patch.json index f357b56c2d7..b3a716845c8 100644 --- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/json-patch.json +++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/json-patch.json @@ -24,8 +24,10 @@ "remote": false }, "componentProperties": { - "lazyStartProducer": { "index": 0, "kind": "property", "displayName": "Lazy Start Producer", "group": "producer", "label": "producer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail [...] - "autowiredEnabled": { "index": 1, "kind": "property", "displayName": "Autowired Enabled", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Whether autowiring is enabled. This is used for automatic autowiring options (the option must be marked as autowired) by looking up in the registry to find if there is a single instance of matching t [...] + "allowTemplateFromHeader": { "index": 0, "kind": "property", "displayName": "Allow Template From Header", "group": "producer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether to allow to use resource template from header or not (default false). Enabling this allows to specify dynamic templates via message header. However this can be seen as a potential se [...] + "contentCache": { "index": 1, "kind": "property", "displayName": "Content Cache", "group": "producer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Sets whether to use resource content cache or not" }, + "lazyStartProducer": { "index": 2, "kind": "property", "displayName": "Lazy Start Producer", "group": "producer", "label": "producer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail [...] + "autowiredEnabled": { "index": 3, "kind": "property", "displayName": "Autowired Enabled", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Whether autowiring is enabled. This is used for automatic autowiring options (the option must be marked as autowired) by looking up in the registry to find if there is a single instance of matching t [...] }, "headers": { "CamelJsonPatchResourceUri": { "index": 0, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The resource URI", "constantName": "org.apache.camel.component.jsonpatch.JsonPatchConstants#JSON_PATCH_RESOURCE_URI" } @@ -33,7 +35,8 @@ "properties": { "resourceUri": { "index": 0, "kind": "path", "displayName": "Resource Uri", "group": "producer", "label": "", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "supportFileReference": true, "description": "Path to the resource. You can prefix with: classpath, file, http, ref, or bean. classpath, file and http loads the resource using these protocols (classpath is default). ref will look [...] "allowContextMapAll": { "index": 1, "kind": "parameter", "displayName": "Allow Context Map All", "group": "producer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Sets whether the context map should allow access to all details. By default only the message body and headers can be accessed. This option can be enabled for full access to the current Exchange and C [...] - "contentCache": { "index": 2, "kind": "parameter", "displayName": "Content Cache", "group": "producer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Sets whether to use resource content cache or not" }, - "lazyStartProducer": { "index": 3, "kind": "parameter", "displayName": "Lazy Start Producer", "group": "producer (advanced)", "label": "producer,advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a produc [...] + "allowTemplateFromHeader": { "index": 2, "kind": "parameter", "displayName": "Allow Template From Header", "group": "producer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether to allow to use resource template from header or not (default false). Enabling this allows to specify dynamic templates via message header. However this can be seen as a potential s [...] + "contentCache": { "index": 3, "kind": "parameter", "displayName": "Content Cache", "group": "producer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Sets whether to use resource content cache or not" }, + "lazyStartProducer": { "index": 4, "kind": "parameter", "displayName": "Lazy Start Producer", "group": "producer (advanced)", "label": "producer,advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a produc [...] } } diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/json-validator.json b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/json-validator.json index a39fa4b9af3..92d061c7f29 100644 --- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/json-validator.json +++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/json-validator.json @@ -24,10 +24,11 @@ "remote": false }, "componentProperties": { - "lazyStartProducer": { "index": 0, "kind": "property", "displayName": "Lazy Start Producer", "group": "producer", "label": "producer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail [...] - "useDefaultObjectMapper": { "index": 1, "kind": "property", "displayName": "Use Default Object Mapper", "group": "producer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Whether to lookup and use default Jackson ObjectMapper from the registry." }, - "autowiredEnabled": { "index": 2, "kind": "property", "displayName": "Autowired Enabled", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Whether autowiring is enabled. This is used for automatic autowiring options (the option must be marked as autowired) by looking up in the registry to find if there is a single instance of matching t [...] - "objectMapper": { "index": 3, "kind": "property", "displayName": "Object Mapper", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Lookup and use the existing ObjectMapper with the given id." } + "contentCache": { "index": 0, "kind": "property", "displayName": "Content Cache", "group": "producer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Sets whether to use resource content cache or not" }, + "lazyStartProducer": { "index": 1, "kind": "property", "displayName": "Lazy Start Producer", "group": "producer", "label": "producer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail [...] + "useDefaultObjectMapper": { "index": 2, "kind": "property", "displayName": "Use Default Object Mapper", "group": "producer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Whether to lookup and use default Jackson ObjectMapper from the registry." }, + "autowiredEnabled": { "index": 3, "kind": "property", "displayName": "Autowired Enabled", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Whether autowiring is enabled. This is used for automatic autowiring options (the option must be marked as autowired) by looking up in the registry to find if there is a single instance of matching t [...] + "objectMapper": { "index": 4, "kind": "property", "displayName": "Object Mapper", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Lookup and use the existing ObjectMapper with the given id." } }, "properties": { "resourceUri": { "index": 0, "kind": "path", "displayName": "Resource Uri", "group": "producer", "label": "", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "supportFileReference": true, "description": "Path to the resource. You can prefix with: classpath, file, http, ref, or bean. classpath, file and http loads the resource using these protocols (classpath is default). ref will look [...] diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/jsonata.json b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/jsonata.json index ab46b61d8a8..af8b338bccf 100644 --- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/jsonata.json +++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/jsonata.json @@ -24,9 +24,11 @@ "remote": false }, "componentProperties": { - "lazyStartProducer": { "index": 0, "kind": "property", "displayName": "Lazy Start Producer", "group": "producer", "label": "producer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail [...] - "autowiredEnabled": { "index": 1, "kind": "property", "displayName": "Autowired Enabled", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Whether autowiring is enabled. This is used for automatic autowiring options (the option must be marked as autowired) by looking up in the registry to find if there is a single instance of matching t [...] - "frameBinding": { "index": 2, "kind": "property", "displayName": "Frame Binding", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "org.apache.camel.component.jsonata.JsonataFrameBinding", "deprecated": false, "autowired": false, "secret": false, "description": "To configure custom frame bindings and inject user functions." } + "allowTemplateFromHeader": { "index": 0, "kind": "property", "displayName": "Allow Template From Header", "group": "producer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether to allow to use resource template from header or not (default false). Enabling this allows to specify dynamic templates via message header. However this can be seen as a potential se [...] + "contentCache": { "index": 1, "kind": "property", "displayName": "Content Cache", "group": "producer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Sets whether to use resource content cache or not" }, + "lazyStartProducer": { "index": 2, "kind": "property", "displayName": "Lazy Start Producer", "group": "producer", "label": "producer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail [...] + "autowiredEnabled": { "index": 3, "kind": "property", "displayName": "Autowired Enabled", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Whether autowiring is enabled. This is used for automatic autowiring options (the option must be marked as autowired) by looking up in the registry to find if there is a single instance of matching t [...] + "frameBinding": { "index": 4, "kind": "property", "displayName": "Frame Binding", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "org.apache.camel.component.jsonata.JsonataFrameBinding", "deprecated": false, "autowired": false, "secret": false, "description": "To configure custom frame bindings and inject user functions." } }, "properties": { "resourceUri": { "index": 0, "kind": "path", "displayName": "Resource Uri", "group": "producer", "label": "", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "supportFileReference": true, "description": "Path to the resource. You can prefix with: classpath, file, http, ref, or bean. classpath, file and http loads the resource using these protocols (classpath is default). ref will look [...] diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/jte.json b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/jte.json index 7d99557c103..bd67bc92018 100644 --- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/jte.json +++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/jte.json @@ -26,11 +26,12 @@ "componentProperties": { "allowContextMapAll": { "index": 0, "kind": "property", "displayName": "Allow Context Map All", "group": "producer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Sets whether the context map should allow access to all details. By default only the message body and headers can be accessed. This option can be enabled for full access to the current Exchange and Ca [...] "allowTemplateFromHeader": { "index": 1, "kind": "property", "displayName": "Allow Template From Header", "group": "producer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether to allow to use resource template from header or not (default false). Enabling this allows to specify dynamic templates via message header. However this can be seen as a potential se [...] - "contentType": { "index": 2, "kind": "property", "displayName": "Content Type", "group": "producer", "label": "", "required": false, "type": "object", "javaType": "gg.jte.ContentType", "enum": [ "Plain", "Html" ], "deprecated": false, "autowired": false, "secret": false, "defaultValue": "Plain", "description": "Content type the JTE engine should use." }, - "lazyStartProducer": { "index": 3, "kind": "property", "displayName": "Lazy Start Producer", "group": "producer", "label": "producer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail [...] - "preCompile": { "index": 4, "kind": "property", "displayName": "Pre Compile", "group": "producer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "To speed up startup and rendering on your production server, it is possible to precompile all templates during the build. This way, the template engine can load each template's .class file directly without first compil [...] - "workDir": { "index": 5, "kind": "property", "displayName": "Work Dir", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "defaultValue": "jte-classes", "description": "Work directory where JTE will store compiled templates." }, - "autowiredEnabled": { "index": 6, "kind": "property", "displayName": "Autowired Enabled", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Whether autowiring is enabled. This is used for automatic autowiring options (the option must be marked as autowired) by looking up in the registry to find if there is a single instance of matching t [...] + "contentCache": { "index": 2, "kind": "property", "displayName": "Content Cache", "group": "producer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Sets whether to use resource content cache or not" }, + "contentType": { "index": 3, "kind": "property", "displayName": "Content Type", "group": "producer", "label": "", "required": false, "type": "object", "javaType": "gg.jte.ContentType", "enum": [ "Plain", "Html" ], "deprecated": false, "autowired": false, "secret": false, "defaultValue": "Plain", "description": "Content type the JTE engine should use." }, + "lazyStartProducer": { "index": 4, "kind": "property", "displayName": "Lazy Start Producer", "group": "producer", "label": "producer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail [...] + "preCompile": { "index": 5, "kind": "property", "displayName": "Pre Compile", "group": "producer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "To speed up startup and rendering on your production server, it is possible to precompile all templates during the build. This way, the template engine can load each template's .class file directly without first compil [...] + "workDir": { "index": 6, "kind": "property", "displayName": "Work Dir", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "defaultValue": "jte-classes", "description": "Work directory where JTE will store compiled templates." }, + "autowiredEnabled": { "index": 7, "kind": "property", "displayName": "Autowired Enabled", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Whether autowiring is enabled. This is used for automatic autowiring options (the option must be marked as autowired) by looking up in the registry to find if there is a single instance of matching t [...] }, "headers": { "CamelJteResourceUri": { "index": 0, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "A URI for the template resource to use instead of the endpoint configured.", "constantName": "org.apache.camel.component.jte.JteConstants#JTE_RESOURCE_URI" }, diff --git a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/JsonPatchEndpointBuilderFactory.java b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/JsonPatchEndpointBuilderFactory.java index b4e211029b9..c77213d0ccb 100644 --- a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/JsonPatchEndpointBuilderFactory.java +++ b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/JsonPatchEndpointBuilderFactory.java @@ -82,6 +82,44 @@ public interface JsonPatchEndpointBuilderFactory { doSetProperty("allowContextMapAll", allowContextMapAll); return this; } + /** + * Whether to allow to use resource template from header or not (default + * false). Enabling this allows to specify dynamic templates via message + * header. However this can be seen as a potential security + * vulnerability if the header is coming from a malicious user, so use + * this with care. + * + * The option is a: <code>boolean</code> type. + * + * Default: false + * Group: producer + * + * @param allowTemplateFromHeader the value to set + * @return the dsl builder + */ + default JsonPatchEndpointBuilder allowTemplateFromHeader(boolean allowTemplateFromHeader) { + doSetProperty("allowTemplateFromHeader", allowTemplateFromHeader); + return this; + } + /** + * Whether to allow to use resource template from header or not (default + * false). Enabling this allows to specify dynamic templates via message + * header. However this can be seen as a potential security + * vulnerability if the header is coming from a malicious user, so use + * this with care. + * + * The option will be converted to a <code>boolean</code> type. + * + * Default: false + * Group: producer + * + * @param allowTemplateFromHeader the value to set + * @return the dsl builder + */ + default JsonPatchEndpointBuilder allowTemplateFromHeader(String allowTemplateFromHeader) { + doSetProperty("allowTemplateFromHeader", allowTemplateFromHeader); + return this; + } /** * Sets whether to use resource content cache or not. *
