This is an automated email from the ASF dual-hosted git repository. davsclaus pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/camel.git
commit 5dae1b1ad992f9fd765f9f05e153731cedfa6662 Author: Claus Ibsen <claus.ib...@gmail.com> AuthorDate: Tue May 12 09:33:00 2020 +0200 CAMEL-15050: Templating components - Variable map to be limited to body/headers --- .../velocity/VelocityComponentConfigurer.java | 5 ++++ .../velocity/VelocityEndpointConfigurer.java | 5 ++++ .../apache/camel/component/velocity/velocity.json | 2 ++ .../src/main/docs/velocity-component.adoc | 6 ++-- .../component/velocity/VelocityComponent.java | 17 +++++++++++ .../camel/component/velocity/VelocityEndpoint.java | 2 +- .../component/velocity/VelocityEndpointTest.java | 1 + .../velocity/VelocityMethodInvokationTest.java | 2 +- .../velocity/VelocityOverridesPropertiesTest.java | 2 +- .../component/velocity/VelocitySetHeaderTest.java | 2 +- .../velocity/VelocitySupplementalContextTest.java | 2 +- .../camel/component/velocity/VelocityTest.java | 2 +- .../velocity/VelocityValuesInPropertiesTest.java | 2 +- .../camel/component/velocity/camel-context.xml | 4 +-- .../dsl/VelocityComponentBuilderFactory.java | 18 ++++++++++++ .../dsl/VelocityEndpointBuilderFactory.java | 34 ++++++++++++++++++++++ 16 files changed, 95 insertions(+), 11 deletions(-) diff --git a/components/camel-velocity/src/generated/java/org/apache/camel/component/velocity/VelocityComponentConfigurer.java b/components/camel-velocity/src/generated/java/org/apache/camel/component/velocity/VelocityComponentConfigurer.java index c064366..67b0a74 100644 --- a/components/camel-velocity/src/generated/java/org/apache/camel/component/velocity/VelocityComponentConfigurer.java +++ b/components/camel-velocity/src/generated/java/org/apache/camel/component/velocity/VelocityComponentConfigurer.java @@ -19,6 +19,8 @@ public class VelocityComponentConfigurer extends PropertyConfigurerSupport imple public boolean configure(CamelContext camelContext, Object obj, String name, Object value, boolean ignoreCase) { VelocityComponent target = (VelocityComponent) obj; switch (ignoreCase ? name.toLowerCase() : name) { + case "allowcontextmapall": + case "allowContextMapAll": target.setAllowContextMapAll(property(camelContext, boolean.class, value)); return true; case "allowtemplatefromheader": case "allowTemplateFromHeader": target.setAllowTemplateFromHeader(property(camelContext, boolean.class, value)); return true; case "basicpropertybinding": @@ -34,6 +36,7 @@ public class VelocityComponentConfigurer extends PropertyConfigurerSupport imple @Override public Map<String, Object> getAllOptions(Object target) { Map<String, Object> answer = new CaseInsensitiveMap(); + answer.put("allowContextMapAll", boolean.class); answer.put("allowTemplateFromHeader", boolean.class); answer.put("basicPropertyBinding", boolean.class); answer.put("lazyStartProducer", boolean.class); @@ -45,6 +48,8 @@ public class VelocityComponentConfigurer extends PropertyConfigurerSupport imple public Object getOptionValue(Object obj, String name, boolean ignoreCase) { VelocityComponent target = (VelocityComponent) obj; switch (ignoreCase ? name.toLowerCase() : name) { + case "allowcontextmapall": + case "allowContextMapAll": return target.isAllowContextMapAll(); case "allowtemplatefromheader": case "allowTemplateFromHeader": return target.isAllowTemplateFromHeader(); case "basicpropertybinding": diff --git a/components/camel-velocity/src/generated/java/org/apache/camel/component/velocity/VelocityEndpointConfigurer.java b/components/camel-velocity/src/generated/java/org/apache/camel/component/velocity/VelocityEndpointConfigurer.java index d9b44ff..7b7da14 100644 --- a/components/camel-velocity/src/generated/java/org/apache/camel/component/velocity/VelocityEndpointConfigurer.java +++ b/components/camel-velocity/src/generated/java/org/apache/camel/component/velocity/VelocityEndpointConfigurer.java @@ -19,6 +19,8 @@ public class VelocityEndpointConfigurer extends PropertyConfigurerSupport implem public boolean configure(CamelContext camelContext, Object obj, String name, Object value, boolean ignoreCase) { VelocityEndpoint target = (VelocityEndpoint) obj; switch (ignoreCase ? name.toLowerCase() : name) { + case "allowcontextmapall": + case "allowContextMapAll": target.setAllowContextMapAll(property(camelContext, boolean.class, value)); return true; case "allowtemplatefromheader": case "allowTemplateFromHeader": target.setAllowTemplateFromHeader(property(camelContext, boolean.class, value)); return true; case "basicpropertybinding": @@ -40,6 +42,7 @@ public class VelocityEndpointConfigurer extends PropertyConfigurerSupport implem @Override public Map<String, Object> getAllOptions(Object target) { Map<String, Object> answer = new CaseInsensitiveMap(); + answer.put("allowContextMapAll", boolean.class); answer.put("allowTemplateFromHeader", boolean.class); answer.put("basicPropertyBinding", boolean.class); answer.put("contentCache", boolean.class); @@ -55,6 +58,8 @@ public class VelocityEndpointConfigurer extends PropertyConfigurerSupport implem public Object getOptionValue(Object obj, String name, boolean ignoreCase) { VelocityEndpoint target = (VelocityEndpoint) obj; switch (ignoreCase ? name.toLowerCase() : name) { + case "allowcontextmapall": + case "allowContextMapAll": return target.isAllowContextMapAll(); case "allowtemplatefromheader": case "allowTemplateFromHeader": return target.isAllowTemplateFromHeader(); case "basicpropertybinding": diff --git a/components/camel-velocity/src/generated/resources/org/apache/camel/component/velocity/velocity.json b/components/camel-velocity/src/generated/resources/org/apache/camel/component/velocity/velocity.json index 8f830ac..64762c3 100644 --- a/components/camel-velocity/src/generated/resources/org/apache/camel/component/velocity/velocity.json +++ b/components/camel-velocity/src/generated/resources/org/apache/camel/component/velocity/velocity.json @@ -21,6 +21,7 @@ "lenientProperties": false }, "componentProperties": { + "allowContextMapAll": { "kind": "property", "displayName": "Allow Context Map All", "group": "producer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": 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 CamelContext. Doing so impose a [...] "allowTemplateFromHeader": { "kind": "property", "displayName": "Allow Template From Header", "group": "producer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": 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 security vulnerability if the he [...] "lazyStartProducer": { "kind": "property", "displayName": "Lazy Start Producer", "group": "producer", "label": "producer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": 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 during starting and cause the r [...] "basicPropertyBinding": { "kind": "property", "displayName": "Basic Property Binding", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "secret": false, "defaultValue": false, "description": "Whether the component should use basic property binding (Camel 2.x) or the newer property binding with additional capabilities" }, @@ -28,6 +29,7 @@ }, "properties": { "resourceUri": { "kind": "path", "displayName": "Resource Uri", "group": "producer", "label": "", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "secret": false, "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 lookup the resource in the registry. bean will call a method on a [...] + "allowContextMapAll": { "kind": "parameter", "displayName": "Allow Context Map All", "group": "producer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": 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 CamelContext. Doing so impose a [...] "allowTemplateFromHeader": { "kind": "parameter", "displayName": "Allow Template From Header", "group": "producer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": 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 security vulnerability if the h [...] "contentCache": { "kind": "parameter", "displayName": "Content Cache", "group": "producer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "secret": false, "defaultValue": "false", "description": "Sets whether to use resource content cache or not" }, "encoding": { "kind": "parameter", "displayName": "Encoding", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": false, "description": "Character encoding of the resource content." }, diff --git a/components/camel-velocity/src/main/docs/velocity-component.adoc b/components/camel-velocity/src/main/docs/velocity-component.adoc index 9fe4992..e9fc32f 100644 --- a/components/camel-velocity/src/main/docs/velocity-component.adoc +++ b/components/camel-velocity/src/main/docs/velocity-component.adoc @@ -48,13 +48,14 @@ You can append query options to the URI in the following format, // component options: START -The Velocity component supports 4 options, which are listed below. +The Velocity component supports 5 options, which are listed below. [width="100%",cols="2,5,^1,2",options="header"] |=== | Name | Description | Default | Type +| *allowContextMapAll* (producer) | 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 CamelContext. Doing so impose a potential security risk as this opens access to the full power of CamelContext API. | false | boolean | *allowTemplateFromHeader* (producer) | 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. | false | boolean | *lazyStartProducer* (producer) | 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 during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel's routing error handlers. Beware that when the first message is processed then creating and [...] | *basicPropertyBinding* (advanced) | Whether the component should use basic property binding (Camel 2.x) or the newer property binding with additional capabilities | false | boolean @@ -84,12 +85,13 @@ with the following path and query parameters: |=== -=== Query Parameters (8 parameters): +=== Query Parameters (9 parameters): [width="100%",cols="2,5,^1,2",options="header"] |=== | Name | Description | Default | Type +| *allowContextMapAll* (producer) | 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 CamelContext. Doing so impose a potential security risk as this opens access to the full power of CamelContext API. | false | boolean | *allowTemplateFromHeader* (producer) | 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. | false | boolean | *contentCache* (producer) | Sets whether to use resource content cache or not | false | boolean | *encoding* (producer) | Character encoding of the resource content. | | String diff --git a/components/camel-velocity/src/main/java/org/apache/camel/component/velocity/VelocityComponent.java b/components/camel-velocity/src/main/java/org/apache/camel/component/velocity/VelocityComponent.java index 58adafe..9c57389 100644 --- a/components/camel-velocity/src/main/java/org/apache/camel/component/velocity/VelocityComponent.java +++ b/components/camel-velocity/src/main/java/org/apache/camel/component/velocity/VelocityComponent.java @@ -30,6 +30,8 @@ public class VelocityComponent extends DefaultComponent { @Metadata(defaultValue = "false") private boolean allowTemplateFromHeader; + @Metadata(defaultValue = "false") + private boolean allowContextMapAll; @Metadata(label = "advanced") private VelocityEngine velocityEngine; @@ -61,6 +63,20 @@ public class VelocityComponent extends DefaultComponent { this.allowTemplateFromHeader = allowTemplateFromHeader; } + public boolean isAllowContextMapAll() { + return allowContextMapAll; + } + + /** + * 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 CamelContext. + * Doing so impose a potential security risk as this opens access to the full power of CamelContext API. + */ + public void setAllowContextMapAll(boolean allowContextMapAll) { + this.allowContextMapAll = allowContextMapAll; + } + @Override protected Endpoint createEndpoint(String uri, String remaining, Map<String, Object> parameters) throws Exception { boolean cache = getAndRemoveParameter(parameters, "contentCache", Boolean.class, Boolean.TRUE); @@ -69,6 +85,7 @@ public class VelocityComponent extends DefaultComponent { answer.setContentCache(cache); answer.setVelocityEngine(velocityEngine); answer.setAllowTemplateFromHeader(allowTemplateFromHeader); + answer.setAllowContextMapAll(allowContextMapAll); setProperties(answer, parameters); diff --git a/components/camel-velocity/src/main/java/org/apache/camel/component/velocity/VelocityEndpoint.java b/components/camel-velocity/src/main/java/org/apache/camel/component/velocity/VelocityEndpoint.java index 8dc7870..ee20784 100644 --- a/components/camel-velocity/src/main/java/org/apache/camel/component/velocity/VelocityEndpoint.java +++ b/components/camel-velocity/src/main/java/org/apache/camel/component/velocity/VelocityEndpoint.java @@ -218,7 +218,7 @@ public class VelocityEndpoint extends ResourceEndpoint { velocityContext = exchange.getIn().getHeader(VelocityConstants.VELOCITY_CONTEXT, Context.class); } if (velocityContext == null) { - Map<String, Object> variableMap = ExchangeHelper.createVariableMap(exchange); + Map<String, Object> variableMap = ExchangeHelper.createVariableMap(exchange, isAllowContextMapAll()); if (allowTemplateFromHeader) { @SuppressWarnings("unchecked") Map<String, Object> supplementalMap = exchange.getIn().getHeader(VelocityConstants.VELOCITY_SUPPLEMENTAL_CONTEXT, Map.class); diff --git a/components/camel-velocity/src/test/java/org/apache/camel/component/velocity/VelocityEndpointTest.java b/components/camel-velocity/src/test/java/org/apache/camel/component/velocity/VelocityEndpointTest.java index f54e795..99040cb 100644 --- a/components/camel-velocity/src/test/java/org/apache/camel/component/velocity/VelocityEndpointTest.java +++ b/components/camel-velocity/src/test/java/org/apache/camel/component/velocity/VelocityEndpointTest.java @@ -28,6 +28,7 @@ public class VelocityEndpointTest extends VelocityTest { endpoint.setCamelContext(context); endpoint.setResourceUri("org/apache/camel/component/velocity/example.vm"); endpoint.setAllowTemplateFromHeader(true); + endpoint.setAllowContextMapAll(true); context.addEndpoint("velo", endpoint); diff --git a/components/camel-velocity/src/test/java/org/apache/camel/component/velocity/VelocityMethodInvokationTest.java b/components/camel-velocity/src/test/java/org/apache/camel/component/velocity/VelocityMethodInvokationTest.java index 0ff97cf..e79d3f2 100644 --- a/components/camel-velocity/src/test/java/org/apache/camel/component/velocity/VelocityMethodInvokationTest.java +++ b/components/camel-velocity/src/test/java/org/apache/camel/component/velocity/VelocityMethodInvokationTest.java @@ -46,7 +46,7 @@ public class VelocityMethodInvokationTest extends CamelTestSupport { public void configure() { from("direct:a") .setHeader("esc", constant(new EscapeTool())) - .to("velocity:org/apache/camel/component/velocity/escape.vm"); + .to("velocity:org/apache/camel/component/velocity/escape.vm?allowContextMapAll=true"); } }; } diff --git a/components/camel-velocity/src/test/java/org/apache/camel/component/velocity/VelocityOverridesPropertiesTest.java b/components/camel-velocity/src/test/java/org/apache/camel/component/velocity/VelocityOverridesPropertiesTest.java index 306bea6..48938d6 100644 --- a/components/camel-velocity/src/test/java/org/apache/camel/component/velocity/VelocityOverridesPropertiesTest.java +++ b/components/camel-velocity/src/test/java/org/apache/camel/component/velocity/VelocityOverridesPropertiesTest.java @@ -44,7 +44,7 @@ public class VelocityOverridesPropertiesTest extends CamelTestSupport { return new RouteBuilder() { public void configure() throws Exception { from("direct:a") - .to("velocity:org/apache/camel/component/velocity/example.vm?propertiesFile=org/apache/camel/component/velocity/velocity-logging.properties"); + .to("velocity:org/apache/camel/component/velocity/example.vm?propertiesFile=org/apache/camel/component/velocity/velocity-logging.properties&allowContextMapAll=true"); } }; } diff --git a/components/camel-velocity/src/test/java/org/apache/camel/component/velocity/VelocitySetHeaderTest.java b/components/camel-velocity/src/test/java/org/apache/camel/component/velocity/VelocitySetHeaderTest.java index b5048f8..d208e87 100644 --- a/components/camel-velocity/src/test/java/org/apache/camel/component/velocity/VelocitySetHeaderTest.java +++ b/components/camel-velocity/src/test/java/org/apache/camel/component/velocity/VelocitySetHeaderTest.java @@ -36,7 +36,7 @@ public class VelocitySetHeaderTest extends CamelSpringTestSupport { assertRespondsWith("orange", "I am an orange"); } - protected void assertRespondsWith(final String value, String expectedBody) throws InvalidPayloadException, InterruptedException { + protected void assertRespondsWith(final String value, String expectedBody) throws Exception { MockEndpoint mock = getMockEndpoint("mock:result"); mock.expectedMessageCount(1); mock.expectedHeaderReceived("fruit", value); diff --git a/components/camel-velocity/src/test/java/org/apache/camel/component/velocity/VelocitySupplementalContextTest.java b/components/camel-velocity/src/test/java/org/apache/camel/component/velocity/VelocitySupplementalContextTest.java index 4c5a1d6..cd774a8 100644 --- a/components/camel-velocity/src/test/java/org/apache/camel/component/velocity/VelocitySupplementalContextTest.java +++ b/components/camel-velocity/src/test/java/org/apache/camel/component/velocity/VelocitySupplementalContextTest.java @@ -61,7 +61,7 @@ public class VelocitySupplementalContextTest extends CamelTestSupport { public void configure() throws Exception { from("direct:input") .setHeader(VelocityConstants.VELOCITY_SUPPLEMENTAL_CONTEXT).constant(supplementalContext) - .to("velocity:template-in-header?allowTemplateFromHeader=true") + .to("velocity:template-in-header?allowTemplateFromHeader=true&allowContextMapAll=true") .to("mock:results"); } }; diff --git a/components/camel-velocity/src/test/java/org/apache/camel/component/velocity/VelocityTest.java b/components/camel-velocity/src/test/java/org/apache/camel/component/velocity/VelocityTest.java index 6859e80..4145f12 100644 --- a/components/camel-velocity/src/test/java/org/apache/camel/component/velocity/VelocityTest.java +++ b/components/camel-velocity/src/test/java/org/apache/camel/component/velocity/VelocityTest.java @@ -72,7 +72,7 @@ public class VelocityTest extends CamelTestSupport { public void configure() { // START SNIPPET: example from("direct:a"). - to("velocity:org/apache/camel/component/velocity/example.vm?allowTemplateFromHeader=true"); + to("velocity:org/apache/camel/component/velocity/example.vm?allowTemplateFromHeader=true&allowContextMapAll=true"); // END SNIPPET: example } }; diff --git a/components/camel-velocity/src/test/java/org/apache/camel/component/velocity/VelocityValuesInPropertiesTest.java b/components/camel-velocity/src/test/java/org/apache/camel/component/velocity/VelocityValuesInPropertiesTest.java index 156d6ea..755bb0c 100644 --- a/components/camel-velocity/src/test/java/org/apache/camel/component/velocity/VelocityValuesInPropertiesTest.java +++ b/components/camel-velocity/src/test/java/org/apache/camel/component/velocity/VelocityValuesInPropertiesTest.java @@ -50,7 +50,7 @@ public class VelocityValuesInPropertiesTest extends CamelTestSupport { return new RouteBuilder() { public void configure() throws Exception { from("direct:a") - .to("velocity:dummy?allowTemplateFromHeader=true") + .to("velocity:dummy?allowTemplateFromHeader=true&allowContextMapAll=true") .to("mock:result"); } }; diff --git a/components/camel-velocity/src/test/resources/org/apache/camel/component/velocity/camel-context.xml b/components/camel-velocity/src/test/resources/org/apache/camel/component/velocity/camel-context.xml index 8cf4d43..b48dad3 100644 --- a/components/camel-velocity/src/test/resources/org/apache/camel/component/velocity/camel-context.xml +++ b/components/camel-velocity/src/test/resources/org/apache/camel/component/velocity/camel-context.xml @@ -28,12 +28,12 @@ <from uri="direct:start"/> <filter> <method ref="fruitFilter" method="isApple"/> - <to uri="velocity:org/apache/camel/component/velocity/AppleTemplate.vm" /> + <to uri="velocity:org/apache/camel/component/velocity/AppleTemplate.vm?allowContextMapAll=true" /> <to uri="mock:result" /> </filter> <filter> <method ref="fruitFilter" method="isOrange"/> - <to uri="velocity:org/apache/camel/component/velocity/OrangeTemplate.vm" /> + <to uri="velocity:org/apache/camel/component/velocity/OrangeTemplate.vm?allowContextMapAll=true" /> <to uri="mock:result" /> </filter> </route> diff --git a/core/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/VelocityComponentBuilderFactory.java b/core/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/VelocityComponentBuilderFactory.java index d7481a4..c40f33b 100644 --- a/core/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/VelocityComponentBuilderFactory.java +++ b/core/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/VelocityComponentBuilderFactory.java @@ -49,6 +49,23 @@ public interface VelocityComponentBuilderFactory { extends ComponentBuilder<VelocityComponent> { /** + * 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 + * CamelContext. Doing so impose a potential security risk as this opens + * access to the full power of CamelContext API. + * + * The option is a: <code>boolean</code> type. + * + * Default: false + * Group: producer + */ + default VelocityComponentBuilder allowContextMapAll( + boolean allowContextMapAll) { + 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 @@ -130,6 +147,7 @@ public interface VelocityComponentBuilderFactory { String name, Object value) { switch (name) { + case "allowContextMapAll": ((VelocityComponent) component).setAllowContextMapAll((boolean) value); return true; case "allowTemplateFromHeader": ((VelocityComponent) component).setAllowTemplateFromHeader((boolean) value); return true; case "lazyStartProducer": ((VelocityComponent) component).setLazyStartProducer((boolean) value); return true; case "basicPropertyBinding": ((VelocityComponent) component).setBasicPropertyBinding((boolean) value); return true; diff --git a/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/VelocityEndpointBuilderFactory.java b/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/VelocityEndpointBuilderFactory.java index f2ad67e..e6a5e7b 100644 --- a/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/VelocityEndpointBuilderFactory.java +++ b/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/VelocityEndpointBuilderFactory.java @@ -38,6 +38,40 @@ public interface VelocityEndpointBuilderFactory { return (AdvancedVelocityEndpointBuilder) this; } /** + * 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 + * CamelContext. Doing so impose a potential security risk as this opens + * access to the full power of CamelContext API. + * + * The option is a: <code>boolean</code> type. + * + * Default: false + * Group: producer + */ + default VelocityEndpointBuilder allowContextMapAll( + boolean allowContextMapAll) { + doSetProperty("allowContextMapAll", allowContextMapAll); + return this; + } + /** + * 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 + * CamelContext. Doing so impose a potential security risk as this opens + * access to the full power of CamelContext API. + * + * The option will be converted to a <code>boolean</code> type. + * + * Default: false + * Group: producer + */ + default VelocityEndpointBuilder allowContextMapAll( + String allowContextMapAll) { + 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