This is an automated email from the ASF dual-hosted git repository.
davsclaus pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel-spring-boot.git
The following commit(s) were added to refs/heads/main by this push:
new 7a3d8d14bad CAMEL-24641: camel-opa-starter - add the Spring Boot
starter for the camel-opa component (#1948)
7a3d8d14bad is described below
commit 7a3d8d14bad9db4b2b7427ca187d480d04b51e1a
Author: Andrea Cosentino <[email protected]>
AuthorDate: Tue Sep 8 07:46:47 2026 +0200
CAMEL-24641: camel-opa-starter - add the Spring Boot starter for the
camel-opa component (#1948)
camel-opa (CAMEL-24634, Camel 4.23.0) is a new component that had no Spring
Boot
starter. Generate camel-opa-starter so the component is usable from Camel
Spring
Boot applications like every other component: the starter module and its
autoconfiguration, the Spring Boot catalog entry, the BOM and dependencies
management, the navigation and the starter documentation page are added.
Claude-Session: https://claude.ai/code/session_011xgdrCNcnzLtaeNYwAgCnp
Signed-off-by: Andrea Cosentino <[email protected]>
Co-authored-by: Claude Opus 4.8 <[email protected]>
---
.../camel/springboot/catalog/components.properties | 1 +
.../camel/springboot/catalog/components/opa.json | 54 ++++++
components-starter/camel-opa-starter/pom.xml | 48 +++++
.../camel-opa-starter/src/main/docs/opa.json | 99 ++++++++++
.../springboot/OpaComponentAutoConfiguration.java | 74 ++++++++
.../opa/springboot/OpaComponentConfiguration.java | 188 +++++++++++++++++++
.../opa/springboot/OpaComponentConverter.java | 54 ++++++
.../src/main/resources/META-INF/LICENSE.txt | 203 +++++++++++++++++++++
.../src/main/resources/META-INF/NOTICE.txt | 11 ++
...rk.boot.autoconfigure.AutoConfiguration.imports | 18 ++
components-starter/pom.xml | 1 +
docs/spring-boot/modules/ROOT/nav.adoc | 1 +
.../modules/ROOT/pages/starters/opa.adoc | 42 +++++
tooling/camel-spring-boot-bom/pom.xml | 5 +
tooling/camel-spring-boot-dependencies/pom.xml | 5 +
15 files changed, 804 insertions(+)
diff --git
a/catalog/camel-catalog-provider-springboot/src/main/resources/org/apache/camel/springboot/catalog/components.properties
b/catalog/camel-catalog-provider-springboot/src/main/resources/org/apache/camel/springboot/catalog/components.properties
index e258cedd288..09fffc8e95e 100644
---
a/catalog/camel-catalog-provider-springboot/src/main/resources/org/apache/camel/springboot/catalog/components.properties
+++
b/catalog/camel-catalog-provider-springboot/src/main/resources/org/apache/camel/springboot/catalog/components.properties
@@ -281,6 +281,7 @@ oaipmh
olingo2
olingo4
once
+opa
openai
opensearch
openshift-build-configs
diff --git
a/catalog/camel-catalog-provider-springboot/src/main/resources/org/apache/camel/springboot/catalog/components/opa.json
b/catalog/camel-catalog-provider-springboot/src/main/resources/org/apache/camel/springboot/catalog/components/opa.json
new file mode 100644
index 00000000000..778e0aa8b28
--- /dev/null
+++
b/catalog/camel-catalog-provider-springboot/src/main/resources/org/apache/camel/springboot/catalog/components/opa.json
@@ -0,0 +1,54 @@
+{
+ "component": {
+ "kind": "component",
+ "name": "opa",
+ "title": "OPA",
+ "description": "Evaluate Open Policy Agent (Rego) policies against an
Exchange and record the allow\/deny decision on it.",
+ "deprecated": false,
+ "firstVersion": "4.23.0",
+ "label": "security",
+ "javaType": "org.apache.camel.component.opa.OpaComponent",
+ "supportLevel": "Preview",
+ "groupId": "org.apache.camel.springboot",
+ "artifactId": "camel-opa-starter",
+ "version": "4.23.0-SNAPSHOT",
+ "scheme": "opa",
+ "extendsScheme": "",
+ "syntax": "opa:policyPath",
+ "async": false,
+ "api": false,
+ "consumerOnly": false,
+ "producerOnly": true,
+ "lenientProperties": false,
+ "browsable": false,
+ "remote": true
+ },
+ "componentProperties": {
+ "allowKey": { "index": 0, "kind": "property", "displayName": "Allow Key",
"group": "producer", "label": "", "required": false, "type": "string",
"javaType": "java.lang.String", "deprecated": false, "autowired": false,
"secret": false, "defaultValue": "allow", "configurationClass":
"org.apache.camel.component.opa.OpaConfiguration", "configurationField":
"configuration", "description": "The key to read the allow\/deny verdict from
when the policy returns an object rather than a plain b [...]
+ "configuration": { "index": 1, "kind": "property", "displayName":
"Configuration", "group": "producer", "label": "", "required": false, "type":
"object", "javaType": "org.apache.camel.component.opa.OpaConfiguration",
"deprecated": false, "autowired": false, "secret": false, "description": "The
component configuration." },
+ "includeBody": { "index": 2, "kind": "property", "displayName": "Include
Body", "group": "producer", "label": "", "required": false, "type": "boolean",
"javaType": "boolean", "deprecated": false, "autowired": false, "secret":
false, "defaultValue": false, "configurationClass":
"org.apache.camel.component.opa.OpaConfiguration", "configurationField":
"configuration", "description": "Whether to send the message body to OPA as
part of the input document. Disabled by default: bodies can b [...]
+ "includeHeaders": { "index": 3, "kind": "property", "displayName":
"Include Headers", "group": "producer", "label": "", "required": false, "type":
"string", "javaType": "java.lang.String", "deprecated": false, "autowired":
false, "secret": false, "defaultValue": "*", "configurationClass":
"org.apache.camel.component.opa.OpaConfiguration", "configurationField":
"configuration", "description": "Comma-separated list of message header names
to send to OPA in the input document. The defau [...]
+ "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 [...]
+ "serverUrl": { "index": 5, "kind": "property", "displayName": "Server
Url", "group": "producer", "label": "", "required": false, "type": "string",
"javaType": "java.lang.String", "deprecated": false, "autowired": false,
"secret": false, "defaultValue": "http:\/\/localhost:8181",
"configurationClass": "org.apache.camel.component.opa.OpaConfiguration",
"configurationField": "configuration", "description": "The base URL of the OPA
server, without the {code \/v1\/data} suffix. The defaul [...]
+ "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 [...]
+ "opaClient": { "index": 7, "kind": "property", "displayName": "Opa
Client", "group": "advanced", "label": "advanced", "required": false, "type":
"object", "javaType": "com.styra.opa.OPAClient", "deprecated": false,
"deprecationNote": "", "autowired": true, "secret": false,
"configurationClass": "org.apache.camel.component.opa.OpaConfiguration",
"configurationField": "configuration", "description": "An existing OPAClient to
use. When set, serverUrl and bearerToken are ignored." },
+ "bearerToken": { "index": 8, "kind": "property", "displayName": "Bearer
Token", "group": "security", "label": "security", "required": false, "type":
"string", "javaType": "java.lang.String", "deprecated": false, "autowired":
false, "secret": true, "security": "secret", "configurationClass":
"org.apache.camel.component.opa.OpaConfiguration", "configurationField":
"configuration", "description": "Bearer token sent to the OPA server in the
Authorization header, for an OPA instance that [...]
+ "failOpen": { "index": 9, "kind": "property", "displayName": "Fail Open",
"group": "security", "label": "security", "required": false, "type": "boolean",
"javaType": "boolean", "deprecated": false, "autowired": false, "secret":
false, "security": "insecure:dev", "defaultValue": false, "configurationClass":
"org.apache.camel.component.opa.OpaConfiguration", "configurationField":
"configuration", "description": "Whether to allow the exchange to proceed when
the policy cannot be evaluat [...]
+ },
+ "headers": {
+ "CamelOpaDecisionAllow": { "index": 0, "kind": "header", "displayName":
"", "group": "producer", "label": "producer", "required": false, "javaType":
"Boolean", "deprecated": false, "deprecationNote": "", "autowired": false,
"secret": false, "description": "The allow\/deny verdict of the policy
evaluation. Always overwritten by the component, so a value set by an inbound
message never survives into the route.", "constantName":
"org.apache.camel.component.opa.OpaConstants#DECISION_ALLOW" },
+ "CamelOpaDecision": { "index": 1, "kind": "header", "displayName": "",
"group": "producer", "label": "producer", "required": false, "javaType":
"Object", "deprecated": false, "deprecationNote": "", "autowired": false,
"secret": false, "description": "The raw decision document returned by OPA.
Useful for policies that return more than a boolean, such as obligations, row
filters or deny reasons.", "constantName":
"org.apache.camel.component.opa.OpaConstants#DECISION" },
+ "CamelOpaPolicyPath": { "index": 2, "kind": "header", "displayName": "",
"group": "producer", "label": "producer", "required": false, "javaType":
"String", "deprecated": false, "deprecationNote": "", "autowired": false,
"secret": false, "description": "The policy path that was evaluated. Set by the
component for observability; it is not read as an input and cannot be used to
select a different policy.", "constantName":
"org.apache.camel.component.opa.OpaConstants#POLICY_PATH" }
+ },
+ "properties": {
+ "policyPath": { "index": 0, "kind": "path", "displayName": "Policy Path",
"group": "producer", "label": "", "required": true, "type": "string",
"javaType": "java.lang.String", "deprecated": false, "deprecationNote": "",
"autowired": false, "secret": false, "description": "Path of the Rego rule head
to evaluate, relative to the OPA data document. For a rule named allow in a
policy declaring package authz.orders, this is authz\/orders\/allow. The path
is taken from the endpoint only: i [...]
+ "allowKey": { "index": 1, "kind": "parameter", "displayName": "Allow Key",
"group": "producer", "label": "", "required": false, "type": "string",
"javaType": "java.lang.String", "deprecated": false, "autowired": false,
"secret": false, "defaultValue": "allow", "configurationClass":
"org.apache.camel.component.opa.OpaConfiguration", "configurationField":
"configuration", "description": "The key to read the allow\/deny verdict from
when the policy returns an object rather than a plain [...]
+ "includeBody": { "index": 2, "kind": "parameter", "displayName": "Include
Body", "group": "producer", "label": "", "required": false, "type": "boolean",
"javaType": "boolean", "deprecated": false, "autowired": false, "secret":
false, "defaultValue": false, "configurationClass":
"org.apache.camel.component.opa.OpaConfiguration", "configurationField":
"configuration", "description": "Whether to send the message body to OPA as
part of the input document. Disabled by default: bodies can [...]
+ "includeHeaders": { "index": 3, "kind": "parameter", "displayName":
"Include Headers", "group": "producer", "label": "", "required": false, "type":
"string", "javaType": "java.lang.String", "deprecated": false, "autowired":
false, "secret": false, "defaultValue": "*", "configurationClass":
"org.apache.camel.component.opa.OpaConfiguration", "configurationField":
"configuration", "description": "Comma-separated list of message header names
to send to OPA in the input document. The defa [...]
+ "serverUrl": { "index": 4, "kind": "parameter", "displayName": "Server
Url", "group": "producer", "label": "", "required": false, "type": "string",
"javaType": "java.lang.String", "deprecated": false, "autowired": false,
"secret": false, "defaultValue": "http:\/\/localhost:8181",
"configurationClass": "org.apache.camel.component.opa.OpaConfiguration",
"configurationField": "configuration", "description": "The base URL of the OPA
server, without the {code \/v1\/data} suffix. The defau [...]
+ "lazyStartProducer": { "index": 5, "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 [...]
+ "opaClient": { "index": 6, "kind": "parameter", "displayName": "Opa
Client", "group": "advanced", "label": "advanced", "required": false, "type":
"object", "javaType": "com.styra.opa.OPAClient", "deprecated": false,
"deprecationNote": "", "autowired": true, "secret": false,
"configurationClass": "org.apache.camel.component.opa.OpaConfiguration",
"configurationField": "configuration", "description": "An existing OPAClient to
use. When set, serverUrl and bearerToken are ignored." },
+ "bearerToken": { "index": 7, "kind": "parameter", "displayName": "Bearer
Token", "group": "security", "label": "security", "required": false, "type":
"string", "javaType": "java.lang.String", "deprecated": false, "autowired":
false, "secret": true, "security": "secret", "configurationClass":
"org.apache.camel.component.opa.OpaConfiguration", "configurationField":
"configuration", "description": "Bearer token sent to the OPA server in the
Authorization header, for an OPA instance that [...]
+ "failOpen": { "index": 8, "kind": "parameter", "displayName": "Fail Open",
"group": "security", "label": "security", "required": false, "type": "boolean",
"javaType": "boolean", "deprecated": false, "autowired": false, "secret":
false, "security": "insecure:dev", "defaultValue": false, "configurationClass":
"org.apache.camel.component.opa.OpaConfiguration", "configurationField":
"configuration", "description": "Whether to allow the exchange to proceed when
the policy cannot be evalua [...]
+ }
+}
diff --git a/components-starter/camel-opa-starter/pom.xml
b/components-starter/camel-opa-starter/pom.xml
new file mode 100644
index 00000000000..2469584529c
--- /dev/null
+++ b/components-starter/camel-opa-starter/pom.xml
@@ -0,0 +1,48 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.camel.springboot</groupId>
+ <artifactId>components-starter</artifactId>
+ <version>4.23.0-SNAPSHOT</version>
+ </parent>
+ <artifactId>camel-opa-starter</artifactId>
+ <packaging>jar</packaging>
+ <name>Camel SB Starters :: OPA</name>
+ <dependencies>
+ <dependency>
+ <groupId>org.springframework.boot</groupId>
+ <artifactId>spring-boot-starter</artifactId>
+ <version>${spring-boot-version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel</groupId>
+ <artifactId>camel-opa</artifactId>
+ <version>${camel-version}</version>
+ </dependency>
+ <!--START OF GENERATED CODE-->
+ <dependency>
+ <groupId>org.apache.camel.springboot</groupId>
+ <artifactId>camel-core-starter</artifactId>
+ </dependency>
+ <!--END OF GENERATED CODE-->
+ </dependencies>
+</project>
diff --git a/components-starter/camel-opa-starter/src/main/docs/opa.json
b/components-starter/camel-opa-starter/src/main/docs/opa.json
new file mode 100644
index 00000000000..b57adca5dc2
--- /dev/null
+++ b/components-starter/camel-opa-starter/src/main/docs/opa.json
@@ -0,0 +1,99 @@
+{
+ "groups": [
+ {
+ "name": "camel.component.opa",
+ "type":
"org.apache.camel.component.opa.springboot.OpaComponentConfiguration",
+ "sourceType":
"org.apache.camel.component.opa.springboot.OpaComponentConfiguration"
+ },
+ {
+ "name": "camel.component.opa.customizer",
+ "type":
"org.apache.camel.spring.boot.ComponentConfigurationPropertiesCommon$CustomizerProperties",
+ "sourceType":
"org.apache.camel.component.opa.springboot.OpaComponentConfiguration",
+ "sourceMethod": "getCustomizer()"
+ }
+ ],
+ "properties": [
+ {
+ "name": "camel.component.opa.allow-key",
+ "type": "java.lang.String",
+ "description": "The key to read the allow\/deny verdict from when the
policy returns an object rather than a plain boolean. For a policy returning
{allow: true, reasons: } the default value of allow is what you want.",
+ "sourceType":
"org.apache.camel.component.opa.springboot.OpaComponentConfiguration",
+ "defaultValue": "allow"
+ },
+ {
+ "name": "camel.component.opa.autowired-enabled",
+ "type": "java.lang.Boolean",
+ "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
type, which then gets configured on the component. This can be used for
automatic configuring JDBC data sources, JMS connection factories, AWS Clients,
etc.",
+ "sourceType":
"org.apache.camel.component.opa.springboot.OpaComponentConfiguration",
+ "defaultValue": true
+ },
+ {
+ "name": "camel.component.opa.bearer-token",
+ "type": "java.lang.String",
+ "description": "Bearer token sent to the OPA server in the Authorization
header, for an OPA instance that has its API authentication enabled.",
+ "sourceType":
"org.apache.camel.component.opa.springboot.OpaComponentConfiguration"
+ },
+ {
+ "name": "camel.component.opa.configuration",
+ "type": "org.apache.camel.component.opa.OpaConfiguration",
+ "description": "The component configuration. The option is a
org.apache.camel.component.opa.OpaConfiguration type.",
+ "sourceType":
"org.apache.camel.component.opa.springboot.OpaComponentConfiguration"
+ },
+ {
+ "name": "camel.component.opa.customizer.enabled",
+ "type": "java.lang.Boolean",
+ "sourceType":
"org.apache.camel.spring.boot.ComponentConfigurationPropertiesCommon$CustomizerProperties"
+ },
+ {
+ "name": "camel.component.opa.enabled",
+ "type": "java.lang.Boolean",
+ "description": "Whether to enable auto configuration of the opa
component. This is enabled by default.",
+ "sourceType":
"org.apache.camel.component.opa.springboot.OpaComponentConfiguration"
+ },
+ {
+ "name": "camel.component.opa.fail-open",
+ "type": "java.lang.Boolean",
+ "description": "Whether to allow the exchange to proceed when the policy
cannot be evaluated at all, for example because the OPA server is unreachable.
Disabled by default so that an unreachable policy decision point denies rather
than grants access. Do not enable this in production.",
+ "sourceType":
"org.apache.camel.component.opa.springboot.OpaComponentConfiguration",
+ "defaultValue": false
+ },
+ {
+ "name": "camel.component.opa.include-body",
+ "type": "java.lang.Boolean",
+ "description": "Whether to send the message body to OPA as part of the
input document. Disabled by default: bodies can be large or streaming, and most
authorization decisions only need headers. When enabled on a streaming body,
enable stream caching so that the body is still readable by the rest of the
route.",
+ "sourceType":
"org.apache.camel.component.opa.springboot.OpaComponentConfiguration",
+ "defaultValue": false
+ },
+ {
+ "name": "camel.component.opa.include-headers",
+ "type": "java.lang.String",
+ "description": "Comma-separated list of message header names to send to
OPA in the input document. The default of {code } sends every header. Narrow it
when the policy only needs a few headers, or when the message carries headers
that should not leave the JVM.",
+ "sourceType":
"org.apache.camel.component.opa.springboot.OpaComponentConfiguration",
+ "defaultValue": "*"
+ },
+ {
+ "name": "camel.component.opa.lazy-start-producer",
+ "type": "java.lang.Boolean",
+ "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 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 starting the [...]
+ "sourceType":
"org.apache.camel.component.opa.springboot.OpaComponentConfiguration",
+ "defaultValue": false
+ },
+ {
+ "name": "camel.component.opa.opa-client",
+ "type": "com.styra.opa.OPAClient",
+ "description": "An existing OPAClient to use. When set, serverUrl and
bearerToken are ignored. The option is a com.styra.opa.OPAClient type.",
+ "sourceType":
"org.apache.camel.component.opa.springboot.OpaComponentConfiguration"
+ },
+ {
+ "name": "camel.component.opa.server-url",
+ "type": "java.lang.String",
+ "description": "The base URL of the OPA server, without the {code
\/v1\/data} suffix. The default assumes OPA running as a sidecar on the
standard port.",
+ "sourceType":
"org.apache.camel.component.opa.springboot.OpaComponentConfiguration",
+ "defaultValue": "http:\/\/localhost:8181"
+ }
+ ],
+ "hints": [],
+ "ignored": {
+ "properties": []
+ }
+}
\ No newline at end of file
diff --git
a/components-starter/camel-opa-starter/src/main/java/org/apache/camel/component/opa/springboot/OpaComponentAutoConfiguration.java
b/components-starter/camel-opa-starter/src/main/java/org/apache/camel/component/opa/springboot/OpaComponentAutoConfiguration.java
new file mode 100644
index 00000000000..982d1375ff0
--- /dev/null
+++
b/components-starter/camel-opa-starter/src/main/java/org/apache/camel/component/opa/springboot/OpaComponentAutoConfiguration.java
@@ -0,0 +1,74 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.component.opa.springboot;
+
+import org.apache.camel.CamelContext;
+import org.apache.camel.Component;
+import org.apache.camel.component.opa.OpaComponent;
+import org.apache.camel.spi.ComponentCustomizer;
+import org.apache.camel.spring.boot.CamelAutoConfiguration;
+import org.apache.camel.spring.boot.ComponentConfigurationProperties;
+import org.apache.camel.spring.boot.util.CamelPropertiesHelper;
+import
org.apache.camel.spring.boot.util.ConditionalOnCamelContextAndAutoConfigurationBeans;
+import org.apache.camel.spring.boot.util.ConditionalOnHierarchicalProperties;
+import org.apache.camel.spring.boot.util.HierarchicalPropertiesEvaluator;
+import org.springframework.boot.autoconfigure.AutoConfiguration;
+import
org.springframework.boot.context.properties.EnableConfigurationProperties;
+import org.springframework.context.ApplicationContext;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Conditional;
+import org.springframework.context.annotation.Lazy;
+
+/**
+ * Generated by camel-package-maven-plugin - do not edit this file!
+ */
+@AutoConfiguration(after = {CamelAutoConfiguration.class,
OpaComponentConverter.class})
+@Conditional(ConditionalOnCamelContextAndAutoConfigurationBeans.class)
+@EnableConfigurationProperties({ComponentConfigurationProperties.class,OpaComponentConfiguration.class})
+@ConditionalOnHierarchicalProperties({"camel.component",
"camel.component.opa"})
+public class OpaComponentAutoConfiguration {
+
+ private final ApplicationContext applicationContext;
+ private final OpaComponentConfiguration configuration;
+
+ public OpaComponentAutoConfiguration(
+ org.springframework.context.ApplicationContext applicationContext,
+
org.apache.camel.component.opa.springboot.OpaComponentConfiguration
configuration) {
+ this.applicationContext = applicationContext;
+ this.configuration = configuration;
+ }
+
+ @Lazy
+ @Bean
+ public ComponentCustomizer configureOpaComponent() {
+ return new ComponentCustomizer() {
+ @Override
+ public void configure(String name, Component target) {
+
CamelPropertiesHelper.copyConfigurationProperties(target.getCamelContext(),
applicationContext,
+ "camel.component.opa", configuration, target);
+ }
+ @Override
+ public boolean isEnabled(String name, Component target) {
+ return HierarchicalPropertiesEvaluator.evaluate(
+ applicationContext,
+ "camel.component.customizer",
+ "camel.component.opa.customizer")
+ && target instanceof OpaComponent;
+ }
+ };
+ }
+}
\ No newline at end of file
diff --git
a/components-starter/camel-opa-starter/src/main/java/org/apache/camel/component/opa/springboot/OpaComponentConfiguration.java
b/components-starter/camel-opa-starter/src/main/java/org/apache/camel/component/opa/springboot/OpaComponentConfiguration.java
new file mode 100644
index 00000000000..0ec8fdf00ed
--- /dev/null
+++
b/components-starter/camel-opa-starter/src/main/java/org/apache/camel/component/opa/springboot/OpaComponentConfiguration.java
@@ -0,0 +1,188 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.component.opa.springboot;
+
+import com.styra.opa.OPAClient;
+import org.apache.camel.component.opa.OpaConfiguration;
+import org.apache.camel.spring.boot.ComponentConfigurationPropertiesCommon;
+import org.springframework.boot.context.properties.ConfigurationProperties;
+
+/**
+ * Evaluate Open Policy Agent (Rego) policies against an Exchange and record
the
+ * allow/deny decision on it.
+ *
+ * Generated by camel-package-maven-plugin - do not edit this file!
+ */
+@ConfigurationProperties(prefix = "camel.component.opa")
+public class OpaComponentConfiguration
+ extends
+ ComponentConfigurationPropertiesCommon {
+
+ /**
+ * Whether to enable auto configuration of the opa component. This is
+ * enabled by default.
+ */
+ private Boolean enabled;
+ /**
+ * The key to read the allow/deny verdict from when the policy returns an
+ * object rather than a plain boolean. For a policy returning {allow: true,
+ * reasons: } the default value of allow is what you want.
+ */
+ private String allowKey = "allow";
+ /**
+ * The component configuration. The option is a
+ * org.apache.camel.component.opa.OpaConfiguration type.
+ */
+ private OpaConfiguration configuration;
+ /**
+ * Whether to send the message body to OPA as part of the input document.
+ * Disabled by default: bodies can be large or streaming, and most
+ * authorization decisions only need headers. When enabled on a streaming
+ * body, enable stream caching so that the body is still readable by the
+ * rest of the route.
+ */
+ private Boolean includeBody = false;
+ /**
+ * Comma-separated list of message header names to send to OPA in the input
+ * document. The default of {code } sends every header. Narrow it when the
+ * policy only needs a few headers, or when the message carries headers
that
+ * should not leave the JVM.
+ */
+ private String includeHeaders = "*";
+ /**
+ * 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 starting the producer may take a little time
+ * and prolong the total processing time of the processing.
+ */
+ private Boolean lazyStartProducer = false;
+ /**
+ * The base URL of the OPA server, without the {code /v1/data} suffix. The
+ * default assumes OPA running as a sidecar on the standard port.
+ */
+ private String serverUrl = "http://localhost:8181";
+ /**
+ * 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 type, which
+ * then gets configured on the component. This can be used for automatic
+ * configuring JDBC data sources, JMS connection factories, AWS Clients,
+ * etc.
+ */
+ private Boolean autowiredEnabled = true;
+ /**
+ * An existing OPAClient to use. When set, serverUrl and bearerToken are
+ * ignored. The option is a com.styra.opa.OPAClient type.
+ */
+ private OPAClient opaClient;
+ /**
+ * Bearer token sent to the OPA server in the Authorization header, for an
+ * OPA instance that has its API authentication enabled.
+ */
+ private String bearerToken;
+ /**
+ * Whether to allow the exchange to proceed when the policy cannot be
+ * evaluated at all, for example because the OPA server is unreachable.
+ * Disabled by default so that an unreachable policy decision point denies
+ * rather than grants access. Do not enable this in production.
+ */
+ private Boolean failOpen = false;
+
+ public String getAllowKey() {
+ return allowKey;
+ }
+
+ public void setAllowKey(String allowKey) {
+ this.allowKey = allowKey;
+ }
+
+ public OpaConfiguration getConfiguration() {
+ return configuration;
+ }
+
+ public void setConfiguration(OpaConfiguration configuration) {
+ this.configuration = configuration;
+ }
+
+ public Boolean getIncludeBody() {
+ return includeBody;
+ }
+
+ public void setIncludeBody(Boolean includeBody) {
+ this.includeBody = includeBody;
+ }
+
+ public String getIncludeHeaders() {
+ return includeHeaders;
+ }
+
+ public void setIncludeHeaders(String includeHeaders) {
+ this.includeHeaders = includeHeaders;
+ }
+
+ public Boolean getLazyStartProducer() {
+ return lazyStartProducer;
+ }
+
+ public void setLazyStartProducer(Boolean lazyStartProducer) {
+ this.lazyStartProducer = lazyStartProducer;
+ }
+
+ public String getServerUrl() {
+ return serverUrl;
+ }
+
+ public void setServerUrl(String serverUrl) {
+ this.serverUrl = serverUrl;
+ }
+
+ public Boolean getAutowiredEnabled() {
+ return autowiredEnabled;
+ }
+
+ public void setAutowiredEnabled(Boolean autowiredEnabled) {
+ this.autowiredEnabled = autowiredEnabled;
+ }
+
+ public OPAClient getOpaClient() {
+ return opaClient;
+ }
+
+ public void setOpaClient(OPAClient opaClient) {
+ this.opaClient = opaClient;
+ }
+
+ public String getBearerToken() {
+ return bearerToken;
+ }
+
+ public void setBearerToken(String bearerToken) {
+ this.bearerToken = bearerToken;
+ }
+
+ public Boolean getFailOpen() {
+ return failOpen;
+ }
+
+ public void setFailOpen(Boolean failOpen) {
+ this.failOpen = failOpen;
+ }
+}
\ No newline at end of file
diff --git
a/components-starter/camel-opa-starter/src/main/java/org/apache/camel/component/opa/springboot/OpaComponentConverter.java
b/components-starter/camel-opa-starter/src/main/java/org/apache/camel/component/opa/springboot/OpaComponentConverter.java
new file mode 100644
index 00000000000..0563bb98ca6
--- /dev/null
+++
b/components-starter/camel-opa-starter/src/main/java/org/apache/camel/component/opa/springboot/OpaComponentConverter.java
@@ -0,0 +1,54 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.component.opa.springboot;
+
+import java.util.LinkedHashSet;
+import java.util.Set;
+import org.apache.camel.spring.boot.util.BeanReferenceHelper;
+import org.springframework.beans.factory.annotation.Autowired;
+import
org.springframework.boot.context.properties.ConfigurationPropertiesBinding;
+import org.springframework.context.ApplicationContext;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.core.convert.TypeDescriptor;
+import org.springframework.core.convert.converter.GenericConverter;
+import org.springframework.stereotype.Component;
+
+/**
+ * Generated by camel-package-maven-plugin - do not edit this file!
+ */
+@Configuration(proxyBeanMethods = false)
+@ConfigurationPropertiesBinding
+@Component
+public class OpaComponentConverter implements GenericConverter {
+
+ @Autowired
+ private ApplicationContext applicationContext;
+
+ public Set<ConvertiblePair> getConvertibleTypes() {
+ Set<ConvertiblePair> answer = new LinkedHashSet<>();
+ answer.add(new ConvertiblePair(String.class,
org.apache.camel.component.opa.OpaConfiguration.class));
+ answer.add(new ConvertiblePair(String.class,
com.styra.opa.OPAClient.class));
+ return answer;
+ }
+
+ public Object convert(
+ Object source,
+ TypeDescriptor sourceType,
+ TypeDescriptor targetType) {
+ return BeanReferenceHelper.resolveBeanReference(applicationContext,
source, targetType, "camel.component.opa");
+ }
+}
\ No newline at end of file
diff --git
a/components-starter/camel-opa-starter/src/main/resources/META-INF/LICENSE.txt
b/components-starter/camel-opa-starter/src/main/resources/META-INF/LICENSE.txt
new file mode 100644
index 00000000000..6b0b1270ff0
--- /dev/null
+++
b/components-starter/camel-opa-starter/src/main/resources/META-INF/LICENSE.txt
@@ -0,0 +1,203 @@
+
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright [yyyy] [name of copyright owner]
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
diff --git
a/components-starter/camel-opa-starter/src/main/resources/META-INF/NOTICE.txt
b/components-starter/camel-opa-starter/src/main/resources/META-INF/NOTICE.txt
new file mode 100644
index 00000000000..2e215bf2e6b
--- /dev/null
+++
b/components-starter/camel-opa-starter/src/main/resources/META-INF/NOTICE.txt
@@ -0,0 +1,11 @@
+ =========================================================================
+ == NOTICE file corresponding to the section 4 d of ==
+ == the Apache License, Version 2.0, ==
+ == in this case for the Apache Camel distribution. ==
+ =========================================================================
+
+ This product includes software developed by
+ The Apache Software Foundation (http://www.apache.org/).
+
+ Please read the different LICENSE files present in the licenses directory of
+ this distribution.
diff --git
a/components-starter/camel-opa-starter/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports
b/components-starter/camel-opa-starter/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports
new file mode 100644
index 00000000000..3eade6c6b89
--- /dev/null
+++
b/components-starter/camel-opa-starter/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports
@@ -0,0 +1,18 @@
+## ---------------------------------------------------------------------------
+## Licensed to the Apache Software Foundation (ASF) under one or more
+## contributor license agreements. See the NOTICE file distributed with
+## this work for additional information regarding copyright ownership.
+## The ASF licenses this file to You under the Apache License, Version 2.0
+## (the "License"); you may not use this file except in compliance with
+## the License. You may obtain a copy of the License at
+##
+## http://www.apache.org/licenses/LICENSE-2.0
+##
+## Unless required by applicable law or agreed to in writing, software
+## distributed under the License is distributed on an "AS IS" BASIS,
+## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+## See the License for the specific language governing permissions and
+## limitations under the License.
+## ---------------------------------------------------------------------------
+org.apache.camel.component.opa.springboot.OpaComponentConverter
+org.apache.camel.component.opa.springboot.OpaComponentAutoConfiguration
diff --git a/components-starter/pom.xml b/components-starter/pom.xml
index 58a41353154..fbcfc75fbd4 100644
--- a/components-starter/pom.xml
+++ b/components-starter/pom.xml
@@ -394,6 +394,7 @@
<module>camel-olingo2-starter</module>
<module>camel-olingo4-starter</module>
<module>camel-once-starter</module>
+ <module>camel-opa-starter</module>
<module>camel-openai-starter</module>
<module>camel-openapi-java-starter</module>
<module>camel-openapi-validator-starter</module>
diff --git a/docs/spring-boot/modules/ROOT/nav.adoc
b/docs/spring-boot/modules/ROOT/nav.adoc
index ae2c5149381..442e36d4369 100644
--- a/docs/spring-boot/modules/ROOT/nav.adoc
+++ b/docs/spring-boot/modules/ROOT/nav.adoc
@@ -293,6 +293,7 @@
** xref:starters/olingo2.adoc[Olingo2]
** xref:starters/olingo4.adoc[Olingo4]
** xref:starters/once.adoc[Once]
+** xref:starters/opa.adoc[OPA]
** xref:starters/openai.adoc[OpenAI]
** xref:starters/openapi-java.adoc[Openapi Java]
** xref:starters/openapi-validator.adoc[Openapi Validator]
diff --git a/docs/spring-boot/modules/ROOT/pages/starters/opa.adoc
b/docs/spring-boot/modules/ROOT/pages/starters/opa.adoc
new file mode 100644
index 00000000000..a25660f70d7
--- /dev/null
+++ b/docs/spring-boot/modules/ROOT/pages/starters/opa.adoc
@@ -0,0 +1,42 @@
+// Do not edit directly!
+// This file was generated by camel-spring-boot-generator-maven-plugin
+= OPA
+:artifactid: camel-opa-starter
+
+Evaluate Open Policy Agent (Rego) policies against an Exchange and record the
allow/deny decision on it.
+
+== What's inside
+
+* xref:{csb-camel-components}::opa-component.adoc[OPA component], URI syntax:
`opa:policyPath`
+
+Please refer to the above links for usage and configuration details.
+
+== Maven coordinates
+
+[source,xml]
+----
+<dependency>
+ <groupId>org.apache.camel.springboot</groupId>
+ <artifactId>camel-opa-starter</artifactId>
+</dependency>
+----
+
+== Spring Boot Auto-Configuration
+
+The starter supports 11 options, which are listed below.
+
+[width="100%",cols="2,5,^1,2",options="header"]
+|===
+| Name | Description | Default | Type
+| camel.component.opa.allow-key | The key to read the allow/deny verdict from
when the policy returns an object rather than a plain boolean. For a policy
returning \{allow: true, reasons: } the default value of allow is what you
want. | allow | String
+| camel.component.opa.autowired-enabled | 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 type, which then gets configured on the component. This can be used
for automatic configuring JDBC data sources, JMS connection factories, AWS
Clients, etc. | true | Boolean
+| camel.component.opa.bearer-token | Bearer token sent to the OPA server in
the Authorization header, for an OPA instance that has its API authentication
enabled. | | String
+| camel.component.opa.configuration | The component configuration. The option
is a org.apache.camel.component.opa.OpaConfiguration type. | | OpaConfiguration
+| camel.component.opa.enabled | Whether to enable auto configuration of the
opa component. This is enabled by default. | | Boolean
+| camel.component.opa.fail-open | Whether to allow the exchange to proceed
when the policy cannot be evaluated at all, for example because the OPA server
is unreachable. Disabled by default so that an unreachable policy decision
point denies rather than grants access. Do not enable this in production. |
false | Boolean
+| camel.component.opa.include-body | Whether to send the message body to OPA
as part of the input document. Disabled by default: bodies can be large or
streaming, and most authorization decisions only need headers. When enabled on
a streaming body, enable stream caching so that the body is still readable by
the rest of the route. | false | Boolean
+| camel.component.opa.include-headers | Comma-separated list of message header
names to send to OPA in the input document. The default of \{code } sends every
header. Narrow it when the policy only needs a few headers, or when the message
carries headers that should not leave the JVM. | * | String
+| camel.component.opa.lazy-start-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 cre [...]
+| camel.component.opa.opa-client | An existing OPAClient to use. When set,
serverUrl and bearerToken are ignored. The option is a com.styra.opa.OPAClient
type. | | OPAClient
+| camel.component.opa.server-url | The base URL of the OPA server, without the
\{code /v1/data} suffix. The default assumes OPA running as a sidecar on the
standard port. | http://localhost:8181 | String
+|===
diff --git a/tooling/camel-spring-boot-bom/pom.xml
b/tooling/camel-spring-boot-bom/pom.xml
index 3459f73d3f8..fee11dc2a06 100644
--- a/tooling/camel-spring-boot-bom/pom.xml
+++ b/tooling/camel-spring-boot-bom/pom.xml
@@ -1508,6 +1508,11 @@
<artifactId>camel-once-starter</artifactId>
<version>4.23.0-SNAPSHOT</version>
</dependency>
+ <dependency>
+ <groupId>org.apache.camel.springboot</groupId>
+ <artifactId>camel-opa-starter</artifactId>
+ <version>4.23.0-SNAPSHOT</version>
+ </dependency>
<dependency>
<groupId>org.apache.camel.springboot</groupId>
<artifactId>camel-openai-starter</artifactId>
diff --git a/tooling/camel-spring-boot-dependencies/pom.xml
b/tooling/camel-spring-boot-dependencies/pom.xml
index a50e47df3da..f8af3fb1b53 100644
--- a/tooling/camel-spring-boot-dependencies/pom.xml
+++ b/tooling/camel-spring-boot-dependencies/pom.xml
@@ -1822,6 +1822,11 @@
<artifactId>camel-once-starter</artifactId>
<version>${project.version}</version>
</dependency>
+ <dependency>
+ <groupId>org.apache.camel.springboot</groupId>
+ <artifactId>camel-opa-starter</artifactId>
+ <version>${project.version}</version>
+ </dependency>
<dependency>
<groupId>org.apache.camel.springboot</groupId>
<artifactId>camel-openai-starter</artifactId>