You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ac...@apache.org on 2022/06/08 12:54:57 UTC

[camel] branch main updated (7931726e0eb -> 0ed6c56517b)

This is an automated email from the ASF dual-hosted git repository.

acosentino pushed a change to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git


    from 7931726e0eb CAMEL-18174: allow intermittent mode in the resume API
     new e9a8a5729ac CAMEL-17689 - Create a Camel Hashicorp Vault Component
     new 047bd2ae110 CAMEL-17689 - Create a Camel Hashicorp Vault Component
     new dd36972da23 CAMEL-17689 - Create a Camel Hashicorp Vault Component
     new 2cd2d1c372b CAMEL-17689 - Create a Camel Hashicorp Vault Component - Added to kit
     new 0ed6c56517b CAMEL-17689 - Create a Camel Hashicorp Vault Component - First iteration regen

The 5 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 bom/camel-bom/pom.xml                              |   5 +
 catalog/camel-allcomponents/pom.xml                |   4 +
 .../org/apache/camel/catalog/components.properties |   1 +
 .../camel/catalog/components/hashicorp-vault.json  |  42 +++
 components/camel-hashicorp-vault/pom.xml           |  84 ++++++
 .../vault/HashicorpVaultComponentConfigurer.java   |  55 ++++
 .../vault/HashicorpVaultEndpointConfigurer.java    |  81 ++++++
 .../vault/HashicorpVaultEndpointUriFactory.java    |  78 ++++++
 .../services/org/apache/camel/component.properties |   7 +
 .../org/apache/camel/component/hashicorp-vault     |   2 +
 .../camel/configurer/hashicorp-vault-component     |   2 +
 .../camel/configurer/hashicorp-vault-endpoint      |   2 +
 .../camel/urifactory/hashicorp-vault-endpoint      |   2 +
 .../component/hashicorp/vault/hashicorp-vault.json |  42 +++
 .../src/main/docs/hashicorp-vault-component.adoc   |  44 ++++
 .../hashicorp/vault/HashicorpVaultComponent.java   |  71 ++++++
 .../vault/HashicorpVaultConfiguration.java         | 146 +++++++++++
 .../hashicorp/vault/HashicorpVaultConstants.java   |  31 +++
 .../hashicorp/vault/HashicorpVaultEndpoint.java    | 103 ++++++++
 .../hashicorp/vault/HashicorpVaultOperation.java   |  21 ++
 .../hashicorp/vault/HashicorpVaultProducer.java    |  84 ++++++
 .../HashicorpProducerCreateSecretIT.java           |  47 ++++
 .../HashicorpProducerCreateSecretPOJOIT.java       |  63 +++++
 .../src/test/resources/log4j2.properties           |  27 ++
 components/pom.xml                                 |   1 +
 .../org/apache/camel/main/components.properties    |   1 +
 .../ROOT/examples/json/hashicorp-vault.json        |   1 +
 docs/components/modules/ROOT/nav.adoc              |   1 +
 .../ROOT/pages/hashicorp-vault-component.adoc      |   1 +
 .../component/ComponentsBuilderFactory.java        |  13 +
 .../dsl/HashicorpVaultComponentBuilderFactory.java | 121 +++++++++
 .../src/generated/resources/metadata.json          |  22 ++
 .../builder/endpoint/EndpointBuilderFactory.java   |   1 +
 .../camel/builder/endpoint/EndpointBuilders.java   |   1 +
 .../builder/endpoint/StaticEndpointBuilders.java   |  43 ++++
 .../dsl/HashicorpVaultEndpointBuilderFactory.java  | 284 +++++++++++++++++++++
 parent/pom.xml                                     |   5 +
 37 files changed, 1539 insertions(+)
 create mode 100644 catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/hashicorp-vault.json
 create mode 100644 components/camel-hashicorp-vault/pom.xml
 create mode 100644 components/camel-hashicorp-vault/src/generated/java/org/apache/camel/component/hashicorp/vault/HashicorpVaultComponentConfigurer.java
 create mode 100644 components/camel-hashicorp-vault/src/generated/java/org/apache/camel/component/hashicorp/vault/HashicorpVaultEndpointConfigurer.java
 create mode 100644 components/camel-hashicorp-vault/src/generated/java/org/apache/camel/component/hashicorp/vault/HashicorpVaultEndpointUriFactory.java
 create mode 100644 components/camel-hashicorp-vault/src/generated/resources/META-INF/services/org/apache/camel/component.properties
 create mode 100644 components/camel-hashicorp-vault/src/generated/resources/META-INF/services/org/apache/camel/component/hashicorp-vault
 create mode 100644 components/camel-hashicorp-vault/src/generated/resources/META-INF/services/org/apache/camel/configurer/hashicorp-vault-component
 create mode 100644 components/camel-hashicorp-vault/src/generated/resources/META-INF/services/org/apache/camel/configurer/hashicorp-vault-endpoint
 create mode 100644 components/camel-hashicorp-vault/src/generated/resources/META-INF/services/org/apache/camel/urifactory/hashicorp-vault-endpoint
 create mode 100644 components/camel-hashicorp-vault/src/generated/resources/org/apache/camel/component/hashicorp/vault/hashicorp-vault.json
 create mode 100644 components/camel-hashicorp-vault/src/main/docs/hashicorp-vault-component.adoc
 create mode 100644 components/camel-hashicorp-vault/src/main/java/org/apache/camel/component/hashicorp/vault/HashicorpVaultComponent.java
 create mode 100644 components/camel-hashicorp-vault/src/main/java/org/apache/camel/component/hashicorp/vault/HashicorpVaultConfiguration.java
 create mode 100644 components/camel-hashicorp-vault/src/main/java/org/apache/camel/component/hashicorp/vault/HashicorpVaultConstants.java
 create mode 100644 components/camel-hashicorp-vault/src/main/java/org/apache/camel/component/hashicorp/vault/HashicorpVaultEndpoint.java
 create mode 100644 components/camel-hashicorp-vault/src/main/java/org/apache/camel/component/hashicorp/vault/HashicorpVaultOperation.java
 create mode 100644 components/camel-hashicorp-vault/src/main/java/org/apache/camel/component/hashicorp/vault/HashicorpVaultProducer.java
 create mode 100644 components/camel-hashicorp-vault/src/test/java/org/apache/camel/component/hashicorp/vault/integration/operations/HashicorpProducerCreateSecretIT.java
 create mode 100644 components/camel-hashicorp-vault/src/test/java/org/apache/camel/component/hashicorp/vault/integration/operations/HashicorpProducerCreateSecretPOJOIT.java
 create mode 100644 components/camel-hashicorp-vault/src/test/resources/log4j2.properties
 create mode 120000 docs/components/modules/ROOT/examples/json/hashicorp-vault.json
 create mode 120000 docs/components/modules/ROOT/pages/hashicorp-vault-component.adoc
 create mode 100644 dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/HashicorpVaultComponentBuilderFactory.java
 create mode 100644 dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/HashicorpVaultEndpointBuilderFactory.java


[camel] 01/05: CAMEL-17689 - Create a Camel Hashicorp Vault Component

Posted by ac...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

acosentino pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git

commit e9a8a5729ac5a43d12d53702c486625222814275
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Wed Jun 8 13:58:35 2022 +0200

    CAMEL-17689 - Create a Camel Hashicorp Vault Component
---
 catalog/camel-allcomponents/pom.xml                |   4 +
 components/camel-hashicorp-vault/pom.xml           |  84 +++++++++
 .../vault/HashicorpVaultComponentConfigurer.java   |  55 ++++++
 .../vault/HashicorpVaultEndpointConfigurer.java    |  81 ++++++++
 .../vault/HashicorpVaultEndpointUriFactory.java    |  78 ++++++++
 .../services/org/apache/camel/component.properties |   7 +
 .../org/apache/camel/component/hashicorp-vault     |   2 +
 .../camel/configurer/hashicorp-vault-component     |   2 +
 .../camel/configurer/hashicorp-vault-endpoint      |   2 +
 .../camel/urifactory/hashicorp-vault-endpoint      |   2 +
 .../component/hashicorp/vault/hashicorp-vault.json |  42 +++++
 .../src/main/docs/azure-key-vault-component.adoc   | 203 +++++++++++++++++++++
 .../hashicorp/vault/HashicorpVaultComponent.java   |  71 +++++++
 .../vault/HashicorpVaultConfiguration.java         | 146 +++++++++++++++
 .../hashicorp/vault/HashicorpVaultConstants.java   |  31 ++++
 .../hashicorp/vault/HashicorpVaultEndpoint.java    | 103 +++++++++++
 .../hashicorp/vault/HashicorpVaultOperation.java   |  21 +++
 .../hashicorp/vault/HashicorpVaultProducer.java    |  84 +++++++++
 .../HashicorpProducerCreateSecretIT.java           |  47 +++++
 .../HashicorpProducerCreateSecretPOJOIT.java       |  63 +++++++
 .../src/test/resources/log4j2.properties           |  27 +++
 parent/pom.xml                                     |   5 +
 22 files changed, 1160 insertions(+)

diff --git a/catalog/camel-allcomponents/pom.xml b/catalog/camel-allcomponents/pom.xml
index 30c313535d3..4d4952915e5 100644
--- a/catalog/camel-allcomponents/pom.xml
+++ b/catalog/camel-allcomponents/pom.xml
@@ -593,6 +593,10 @@
 			<groupId>org.apache.camel</groupId>
 			<artifactId>camel-guava-eventbus</artifactId>
 		</dependency>
+		<dependency>
+			<groupId>org.apache.camel</groupId>
+			<artifactId>camel-hashicorp-vault</artifactId>
+		</dependency>
 		<dependency>
 			<groupId>org.apache.camel</groupId>
 			<artifactId>camel-hazelcast</artifactId>
diff --git a/components/camel-hashicorp-vault/pom.xml b/components/camel-hashicorp-vault/pom.xml
new file mode 100644
index 00000000000..c26f6c23248
--- /dev/null
+++ b/components/camel-hashicorp-vault/pom.xml
@@ -0,0 +1,84 @@
+<?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</groupId>
+        <artifactId>components</artifactId>
+        <version>3.18.0-SNAPSHOT</version>
+    </parent>
+
+    <artifactId>camel-hashicorp-vault</artifactId>
+    <packaging>jar</packaging>
+
+    <name>Camel :: Hashicorp :: Key Vault</name>
+    <description>Camel Azure Hashicorp Component</description>
+
+    <properties>
+    </properties>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.apache.camel</groupId>
+            <artifactId>camel-support</artifactId>
+        </dependency>
+
+        <dependency>
+           <groupId>org.springframework.vault</groupId>
+           <artifactId>spring-vault-core</artifactId>
+           <version>2.3.2</version>
+        </dependency>
+
+        <!-- extras -->
+        <dependency>
+            <groupId>commons-io</groupId>
+            <artifactId>commons-io</artifactId>
+        </dependency>
+
+        <!-- for testing -->
+        <dependency>
+            <groupId>org.apache.camel</groupId>
+            <artifactId>camel-test-junit5</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.logging.log4j</groupId>
+            <artifactId>log4j-slf4j-impl</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.mockito</groupId>
+            <artifactId>mockito-junit-jupiter</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.awaitility</groupId>
+            <artifactId>awaitility</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.commons</groupId>
+            <artifactId>commons-lang3</artifactId>
+            <version>${commons-lang3-version}</version>
+            <scope>test</scope>
+        </dependency>
+    </dependencies>
+</project>
diff --git a/components/camel-hashicorp-vault/src/generated/java/org/apache/camel/component/hashicorp/vault/HashicorpVaultComponentConfigurer.java b/components/camel-hashicorp-vault/src/generated/java/org/apache/camel/component/hashicorp/vault/HashicorpVaultComponentConfigurer.java
new file mode 100644
index 00000000000..3438dbdac6b
--- /dev/null
+++ b/components/camel-hashicorp-vault/src/generated/java/org/apache/camel/component/hashicorp/vault/HashicorpVaultComponentConfigurer.java
@@ -0,0 +1,55 @@
+/* Generated by camel build tools - do NOT edit this file! */
+package org.apache.camel.component.hashicorp.vault;
+
+import java.util.Map;
+
+import org.apache.camel.CamelContext;
+import org.apache.camel.spi.ExtendedPropertyConfigurerGetter;
+import org.apache.camel.spi.PropertyConfigurerGetter;
+import org.apache.camel.spi.ConfigurerStrategy;
+import org.apache.camel.spi.GeneratedPropertyConfigurer;
+import org.apache.camel.util.CaseInsensitiveMap;
+import org.apache.camel.support.component.PropertyConfigurerSupport;
+
+/**
+ * Generated by camel build tools - do NOT edit this file!
+ */
+@SuppressWarnings("unchecked")
+public class HashicorpVaultComponentConfigurer extends PropertyConfigurerSupport implements GeneratedPropertyConfigurer, PropertyConfigurerGetter {
+
+    @Override
+    public boolean configure(CamelContext camelContext, Object obj, String name, Object value, boolean ignoreCase) {
+        HashicorpVaultComponent target = (HashicorpVaultComponent) obj;
+        switch (ignoreCase ? name.toLowerCase() : name) {
+        case "autowiredenabled":
+        case "autowiredEnabled": target.setAutowiredEnabled(property(camelContext, boolean.class, value)); return true;
+        case "lazystartproducer":
+        case "lazyStartProducer": target.setLazyStartProducer(property(camelContext, boolean.class, value)); return true;
+        default: return false;
+        }
+    }
+
+    @Override
+    public Class<?> getOptionType(String name, boolean ignoreCase) {
+        switch (ignoreCase ? name.toLowerCase() : name) {
+        case "autowiredenabled":
+        case "autowiredEnabled": return boolean.class;
+        case "lazystartproducer":
+        case "lazyStartProducer": return boolean.class;
+        default: return null;
+        }
+    }
+
+    @Override
+    public Object getOptionValue(Object obj, String name, boolean ignoreCase) {
+        HashicorpVaultComponent target = (HashicorpVaultComponent) obj;
+        switch (ignoreCase ? name.toLowerCase() : name) {
+        case "autowiredenabled":
+        case "autowiredEnabled": return target.isAutowiredEnabled();
+        case "lazystartproducer":
+        case "lazyStartProducer": return target.isLazyStartProducer();
+        default: return null;
+        }
+    }
+}
+
diff --git a/components/camel-hashicorp-vault/src/generated/java/org/apache/camel/component/hashicorp/vault/HashicorpVaultEndpointConfigurer.java b/components/camel-hashicorp-vault/src/generated/java/org/apache/camel/component/hashicorp/vault/HashicorpVaultEndpointConfigurer.java
new file mode 100644
index 00000000000..b16d1df8ddf
--- /dev/null
+++ b/components/camel-hashicorp-vault/src/generated/java/org/apache/camel/component/hashicorp/vault/HashicorpVaultEndpointConfigurer.java
@@ -0,0 +1,81 @@
+/* Generated by camel build tools - do NOT edit this file! */
+package org.apache.camel.component.hashicorp.vault;
+
+import java.util.Map;
+
+import org.apache.camel.CamelContext;
+import org.apache.camel.spi.ExtendedPropertyConfigurerGetter;
+import org.apache.camel.spi.PropertyConfigurerGetter;
+import org.apache.camel.spi.ConfigurerStrategy;
+import org.apache.camel.spi.GeneratedPropertyConfigurer;
+import org.apache.camel.util.CaseInsensitiveMap;
+import org.apache.camel.support.component.PropertyConfigurerSupport;
+
+/**
+ * Generated by camel build tools - do NOT edit this file!
+ */
+@SuppressWarnings("unchecked")
+public class HashicorpVaultEndpointConfigurer extends PropertyConfigurerSupport implements GeneratedPropertyConfigurer, PropertyConfigurerGetter {
+
+    @Override
+    public boolean configure(CamelContext camelContext, Object obj, String name, Object value, boolean ignoreCase) {
+        HashicorpVaultEndpoint target = (HashicorpVaultEndpoint) obj;
+        switch (ignoreCase ? name.toLowerCase() : name) {
+        case "host": target.getConfiguration().setHost(property(camelContext, java.lang.String.class, value)); return true;
+        case "lazystartproducer":
+        case "lazyStartProducer": target.setLazyStartProducer(property(camelContext, boolean.class, value)); return true;
+        case "operation": target.getConfiguration().setOperation(property(camelContext, org.apache.camel.component.hashicorp.vault.HashicorpVaultOperation.class, value)); return true;
+        case "port": target.getConfiguration().setPort(property(camelContext, java.lang.String.class, value)); return true;
+        case "scheme": target.getConfiguration().setScheme(property(camelContext, java.lang.String.class, value)); return true;
+        case "secretpath":
+        case "secretPath": target.getConfiguration().setSecretPath(property(camelContext, java.lang.String.class, value)); return true;
+        case "token": target.getConfiguration().setToken(property(camelContext, java.lang.String.class, value)); return true;
+        case "vaulttemplate":
+        case "vaultTemplate": target.getConfiguration().setVaultTemplate(property(camelContext, org.springframework.vault.core.VaultTemplate.class, value)); return true;
+        default: return false;
+        }
+    }
+
+    @Override
+    public String[] getAutowiredNames() {
+        return new String[]{"vaultTemplate"};
+    }
+
+    @Override
+    public Class<?> getOptionType(String name, boolean ignoreCase) {
+        switch (ignoreCase ? name.toLowerCase() : name) {
+        case "host": return java.lang.String.class;
+        case "lazystartproducer":
+        case "lazyStartProducer": return boolean.class;
+        case "operation": return org.apache.camel.component.hashicorp.vault.HashicorpVaultOperation.class;
+        case "port": return java.lang.String.class;
+        case "scheme": return java.lang.String.class;
+        case "secretpath":
+        case "secretPath": return java.lang.String.class;
+        case "token": return java.lang.String.class;
+        case "vaulttemplate":
+        case "vaultTemplate": return org.springframework.vault.core.VaultTemplate.class;
+        default: return null;
+        }
+    }
+
+    @Override
+    public Object getOptionValue(Object obj, String name, boolean ignoreCase) {
+        HashicorpVaultEndpoint target = (HashicorpVaultEndpoint) obj;
+        switch (ignoreCase ? name.toLowerCase() : name) {
+        case "host": return target.getConfiguration().getHost();
+        case "lazystartproducer":
+        case "lazyStartProducer": return target.isLazyStartProducer();
+        case "operation": return target.getConfiguration().getOperation();
+        case "port": return target.getConfiguration().getPort();
+        case "scheme": return target.getConfiguration().getScheme();
+        case "secretpath":
+        case "secretPath": return target.getConfiguration().getSecretPath();
+        case "token": return target.getConfiguration().getToken();
+        case "vaulttemplate":
+        case "vaultTemplate": return target.getConfiguration().getVaultTemplate();
+        default: return null;
+        }
+    }
+}
+
diff --git a/components/camel-hashicorp-vault/src/generated/java/org/apache/camel/component/hashicorp/vault/HashicorpVaultEndpointUriFactory.java b/components/camel-hashicorp-vault/src/generated/java/org/apache/camel/component/hashicorp/vault/HashicorpVaultEndpointUriFactory.java
new file mode 100644
index 00000000000..6832e3b9b8a
--- /dev/null
+++ b/components/camel-hashicorp-vault/src/generated/java/org/apache/camel/component/hashicorp/vault/HashicorpVaultEndpointUriFactory.java
@@ -0,0 +1,78 @@
+/* Generated by camel build tools - do NOT edit this file! */
+package org.apache.camel.component.hashicorp.vault;
+
+import java.net.URISyntaxException;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+
+import org.apache.camel.spi.EndpointUriFactory;
+
+/**
+ * Generated by camel build tools - do NOT edit this file!
+ */
+public class HashicorpVaultEndpointUriFactory extends org.apache.camel.support.component.EndpointUriFactorySupport implements EndpointUriFactory {
+
+    private static final String BASE = ":vaultName";
+
+    private static final Set<String> PROPERTY_NAMES;
+    private static final Set<String> SECRET_PROPERTY_NAMES;
+    private static final Set<String> MULTI_VALUE_PREFIXES;
+    static {
+        Set<String> props = new HashSet<>(9);
+        props.add("host");
+        props.add("lazyStartProducer");
+        props.add("operation");
+        props.add("port");
+        props.add("scheme");
+        props.add("secretPath");
+        props.add("secretsEngine");
+        props.add("token");
+        props.add("vaultTemplate");
+        PROPERTY_NAMES = Collections.unmodifiableSet(props);
+        Set<String> secretProps = new HashSet<>(1);
+        secretProps.add("token");
+        SECRET_PROPERTY_NAMES = Collections.unmodifiableSet(secretProps);
+        MULTI_VALUE_PREFIXES = Collections.emptySet();
+    }
+
+    @Override
+    public boolean isEnabled(String scheme) {
+        return "hashicorp-vault".equals(scheme);
+    }
+
+    @Override
+    public String buildUri(String scheme, Map<String, Object> properties, boolean encode) throws URISyntaxException {
+        String syntax = scheme + BASE;
+        String uri = syntax;
+
+        Map<String, Object> copy = new HashMap<>(properties);
+
+        uri = buildPathParameter(syntax, uri, "secretsEngine", null, false, copy);
+        uri = buildQueryParameters(uri, copy, encode);
+        return uri;
+    }
+
+    @Override
+    public Set<String> propertyNames() {
+        return PROPERTY_NAMES;
+    }
+
+    @Override
+    public Set<String> secretPropertyNames() {
+        return SECRET_PROPERTY_NAMES;
+    }
+
+    @Override
+    public Set<String> multiValuePrefixes() {
+        return MULTI_VALUE_PREFIXES;
+    }
+
+    @Override
+    public boolean isLenientProperties() {
+        return false;
+    }
+}
+
diff --git a/components/camel-hashicorp-vault/src/generated/resources/META-INF/services/org/apache/camel/component.properties b/components/camel-hashicorp-vault/src/generated/resources/META-INF/services/org/apache/camel/component.properties
new file mode 100644
index 00000000000..426a6aadccd
--- /dev/null
+++ b/components/camel-hashicorp-vault/src/generated/resources/META-INF/services/org/apache/camel/component.properties
@@ -0,0 +1,7 @@
+# Generated by camel build tools - do NOT edit this file!
+components=hashicorp-vault
+groupId=org.apache.camel
+artifactId=camel-hashicorp-vault
+version=3.18.0-SNAPSHOT
+projectName=Camel :: Hashicorp :: Key Vault
+projectDescription=Camel Azure Hashicorp Component
diff --git a/components/camel-hashicorp-vault/src/generated/resources/META-INF/services/org/apache/camel/component/hashicorp-vault b/components/camel-hashicorp-vault/src/generated/resources/META-INF/services/org/apache/camel/component/hashicorp-vault
new file mode 100644
index 00000000000..a137188931d
--- /dev/null
+++ b/components/camel-hashicorp-vault/src/generated/resources/META-INF/services/org/apache/camel/component/hashicorp-vault
@@ -0,0 +1,2 @@
+# Generated by camel build tools - do NOT edit this file!
+class=org.apache.camel.component.hashicorp.vault.HashicorpVaultComponent
diff --git a/components/camel-hashicorp-vault/src/generated/resources/META-INF/services/org/apache/camel/configurer/hashicorp-vault-component b/components/camel-hashicorp-vault/src/generated/resources/META-INF/services/org/apache/camel/configurer/hashicorp-vault-component
new file mode 100644
index 00000000000..c0252147c60
--- /dev/null
+++ b/components/camel-hashicorp-vault/src/generated/resources/META-INF/services/org/apache/camel/configurer/hashicorp-vault-component
@@ -0,0 +1,2 @@
+# Generated by camel build tools - do NOT edit this file!
+class=org.apache.camel.component.hashicorp.vault.HashicorpVaultComponentConfigurer
diff --git a/components/camel-hashicorp-vault/src/generated/resources/META-INF/services/org/apache/camel/configurer/hashicorp-vault-endpoint b/components/camel-hashicorp-vault/src/generated/resources/META-INF/services/org/apache/camel/configurer/hashicorp-vault-endpoint
new file mode 100644
index 00000000000..7f8e80d30e5
--- /dev/null
+++ b/components/camel-hashicorp-vault/src/generated/resources/META-INF/services/org/apache/camel/configurer/hashicorp-vault-endpoint
@@ -0,0 +1,2 @@
+# Generated by camel build tools - do NOT edit this file!
+class=org.apache.camel.component.hashicorp.vault.HashicorpVaultEndpointConfigurer
diff --git a/components/camel-hashicorp-vault/src/generated/resources/META-INF/services/org/apache/camel/urifactory/hashicorp-vault-endpoint b/components/camel-hashicorp-vault/src/generated/resources/META-INF/services/org/apache/camel/urifactory/hashicorp-vault-endpoint
new file mode 100644
index 00000000000..07bf21e8e12
--- /dev/null
+++ b/components/camel-hashicorp-vault/src/generated/resources/META-INF/services/org/apache/camel/urifactory/hashicorp-vault-endpoint
@@ -0,0 +1,2 @@
+# Generated by camel build tools - do NOT edit this file!
+class=org.apache.camel.component.hashicorp.vault.HashicorpVaultEndpointUriFactory
diff --git a/components/camel-hashicorp-vault/src/generated/resources/org/apache/camel/component/hashicorp/vault/hashicorp-vault.json b/components/camel-hashicorp-vault/src/generated/resources/org/apache/camel/component/hashicorp/vault/hashicorp-vault.json
new file mode 100644
index 00000000000..036ce798670
--- /dev/null
+++ b/components/camel-hashicorp-vault/src/generated/resources/org/apache/camel/component/hashicorp/vault/hashicorp-vault.json
@@ -0,0 +1,42 @@
+{
+  "component": {
+    "kind": "component",
+    "name": "hashicorp-vault",
+    "title": "Hashicorp Vault",
+    "description": "Manage secrets in Hashicorp Vault Service",
+    "deprecated": false,
+    "firstVersion": "3.18.0",
+    "label": "cloud,cloud",
+    "javaType": "org.apache.camel.component.hashicorp.vault.HashicorpVaultComponent",
+    "supportLevel": "Preview",
+    "groupId": "org.apache.camel",
+    "artifactId": "camel-hashicorp-vault",
+    "version": "3.18.0-SNAPSHOT",
+    "scheme": "hashicorp-vault",
+    "extendsScheme": "",
+    "syntax": "hashicorp-vault:vaultName",
+    "async": false,
+    "api": false,
+    "consumerOnly": false,
+    "producerOnly": true,
+    "lenientProperties": false
+  },
+  "componentProperties": {
+    "lazyStartProducer": { "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 during star [...]
+    "autowiredEnabled": { "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 type, which t [...]
+  },
+  "headers": {
+    "CamelHashicorpVaultProducerOperation": { "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "org.apache.camel.component.azure.key.vault.KeyVaultOperationDefinition", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Overrides the desired operation to be used in the producer.", "constantName": "org.apache.camel.component.hashicorp.vault.HashicorpVaultConstants#OPERATION" }
+  },
+  "properties": {
+    "secretsEngine": { "kind": "path", "displayName": "Secrets Engine", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.hashicorp.vault.HashicorpVaultConfiguration", "configurationField": "configuration", "description": "Vault Name to be used" },
+    "host": { "kind": "parameter", "displayName": "Host", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.hashicorp.vault.HashicorpVaultConfiguration", "configurationField": "configuration", "description": "Hashicorp Vault instance host to be used" },
+    "lazyStartProducer": { "kind": "parameter", "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 during sta [...]
+    "operation": { "kind": "parameter", "displayName": "Operation", "group": "producer", "label": "producer", "required": false, "type": "object", "javaType": "org.apache.camel.component.hashicorp.vault.HashicorpVaultOperation", "enum": [ "createSecret" ], "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.hashicorp.vault.HashicorpVaultConfiguration", "configurationField": "configuration", "description": "Operation to be performed" },
+    "port": { "kind": "parameter", "displayName": "Port", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "defaultValue": "8200", "configurationClass": "org.apache.camel.component.hashicorp.vault.HashicorpVaultConfiguration", "configurationField": "configuration", "description": "Hashicorp Vault instance port to be used" },
+    "scheme": { "kind": "parameter", "displayName": "Scheme", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "defaultValue": "https", "configurationClass": "org.apache.camel.component.hashicorp.vault.HashicorpVaultConfiguration", "configurationField": "configuration", "description": "Hashicorp Vault instance scheme to be used" },
+    "secretPath": { "kind": "parameter", "displayName": "Secret Path", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.hashicorp.vault.HashicorpVaultConfiguration", "configurationField": "configuration", "description": "Hashicorp Vault instance secret Path to be used" },
+    "vaultTemplate": { "kind": "parameter", "displayName": "Vault Template", "group": "producer", "label": "", "required": false, "type": "object", "javaType": "org.springframework.vault.core.VaultTemplate", "deprecated": false, "deprecationNote": "", "autowired": true, "secret": false, "configurationClass": "org.apache.camel.component.hashicorp.vault.HashicorpVaultConfiguration", "configurationField": "configuration", "description": "Instance of Vault template" },
+    "token": { "kind": "parameter", "displayName": "Token", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": true, "configurationClass": "org.apache.camel.component.hashicorp.vault.HashicorpVaultConfiguration", "configurationField": "configuration", "description": "Token to be used" }
+  }
+}
diff --git a/components/camel-hashicorp-vault/src/main/docs/azure-key-vault-component.adoc b/components/camel-hashicorp-vault/src/main/docs/azure-key-vault-component.adoc
new file mode 100644
index 00000000000..014141813ff
--- /dev/null
+++ b/components/camel-hashicorp-vault/src/main/docs/azure-key-vault-component.adoc
@@ -0,0 +1,203 @@
+= Azure Key Vault Component
+:doctitle: Azure Key Vault
+:shortname: azure-key-vault
+:artifactid: camel-azure-key-vault
+:description: Manage secrets and keys in Azure Key Vault Service
+:since: 3.17
+:supportlevel: Preview
+:component-header: Only producer is supported
+//Manually maintained attributes
+:group: Azure
+:camel-spring-boot-name: azure-key-vault
+
+*Since Camel {since}*
+
+*{component-header}*
+
+The azure-key-vault component that integrates https://azure.microsoft.com/en-us/services/key-vault/[Azure ServiceBus]. 
+
+Prerequisites
+
+You must have a valid Windows Azure Key Vault account. More information is available at
+https://docs.microsoft.com/azure/[Azure Documentation Portal].
+
+== URI Format
+
+[source,xml]
+------------------------------------------------------------
+<dependency>
+    <groupId>org.apache.camel</groupId>
+    <artifactId>camel-azure-key-vault</artifactId>
+    <version>x.x.x</version>
+    <!-- use the same version as your Camel core version -->
+</dependency>
+------------------------------------------------------------
+
+
+// component-configure options: START
+
+// component-configure options: END
+
+// component options: START
+include::partial$component-configure-options.adoc[]
+include::partial$component-endpoint-options.adoc[]
+// component options: END
+
+// endpoint options: START
+
+// endpoint options: END
+
+
+== Usage
+
+=== Using Azure Key Vault Property Function
+
+To use this function you'll need to provide credentials to Azure Key Vault Service as environment variables:
+
+[source,bash]
+----
+export $CAMEL_VAULT_AZURE_TENANT_ID=tenantId
+export $CAMEL_VAULT_AZURE_CLIENT_ID=clientId
+export $CAMEL_VAULT_AZURE_CLIENT_SECRET=clientSecret
+export $CAMEL_VAULT_AZURE_VAULT_NAME=vaultName
+----
+
+You can also configure the credentials in the `application.properties` file such as:
+
+[source,properties]
+----
+camel.vault.azure.tenantId = accessKey
+camel.vault.azure.clientId = clientId
+camel.vault.azure.clientSecret = clientSecret
+camel.vault.azure.vaultName = vaultName
+----
+
+At this point you'll be able to reference a property in the following way:
+
+[source,xml]
+----
+<camelContext>
+    <route>
+        <from uri="direct:start"/>
+        <to uri="{{azure:route}}"/>
+    </route>
+</camelContext>
+----
+
+Where route will be the name of the secret stored in the Azure Key Vault Service.
+
+You could specify a default value in case the secret is not present on Azure Key Vault Service:
+
+[source,xml]
+----
+<camelContext>
+    <route>
+        <from uri="direct:start"/>
+        <to uri="{{azure:route:default}}"/>
+    </route>
+</camelContext>
+----
+
+In this case if the secret doesn't exist, the property will fallback to "default" as value.
+
+Also you are able to get particular field of the secret, if you have for example a secret named database of this form:
+
+[source,bash]
+----
+{
+  "username": "admin",
+  "password": "password123",
+  "engine": "postgres",
+  "host": "127.0.0.1",
+  "port": "3128",
+  "dbname": "db"
+}
+----
+
+You're able to do get single secret value in your route, like for example:
+
+[source,xml]
+----
+<camelContext>
+    <route>
+        <from uri="direct:start"/>
+        <log message="Username is {{azure:database/username}}"/>
+    </route>
+</camelContext>
+----
+
+Or re-use the property as part of an endpoint.
+
+You could specify a default value in case the particular field of secret is not present on Azure Key Vault:
+
+[source,xml]
+----
+<camelContext>
+    <route>
+        <from uri="direct:start"/>
+        <log message="Username is {{azure:database/username:admin}}"/>
+    </route>
+</camelContext>
+----
+
+In this case if the secret doesn't exist or the secret exists, but the username field is not part of the secret, the property will fallback to "admin" as value.
+
+For the moment we are not considering the rotation function, if any will be applied, but it is in the work to be done.
+
+The only requirement is adding the camel-azure-key-vault jar to your Camel application.
+
+// component headers: START
+include::partial$component-endpoint-headers.adoc[]
+// component headers: END
+
+=== Azure Key Vault Producer operations
+
+Azure Key Vault component provides the following operation on the producer side:
+
+- createSecret
+- getSecret
+- deleteSecret
+- purgeDeletedSecret
+
+== Examples
+
+=== Producer Examples
+
+- createSecret: this operation will create a secret in Azure Key Vault
+
+[source,java]
+--------------------------------------------------------------------------------
+from("direct:createSecret")
+    .setHeader(KeyVaultConstants.SECRET_NAME, "Test")
+    .setBody(constant("Test"))
+    .to("azure-key-vault://test123?clientId=RAW({{clientId}})&clientSecret=RAW({{clientSecret}})&tenantId=RAW({{tenantId}})")
+--------------------------------------------------------------------------------
+
+- getSecret: this operation will get a secret from Azure Key Vault
+
+[source,java]
+--------------------------------------------------------------------------------
+from("direct:getSecret")
+    .setHeader(KeyVaultConstants.SECRET_NAME, "Test")
+    .to("azure-key-vault://test123?clientId=RAW({{clientId}})&clientSecret=RAW({{clientSecret}})&tenantId=RAW({{tenantId}})&operation=getSecret")
+--------------------------------------------------------------------------------
+
+- deleteSecret: this operation will delete a Secret from Azure Key Vault
+
+[source,java]
+--------------------------------------------------------------------------------
+from("direct:deleteSecret")
+    .setHeader(KeyVaultConstants.SECRET_NAME, "Test")
+    .to("azure-key-vault://test123?clientId=RAW({{clientId}})&clientSecret=RAW({{clientSecret}})&tenantId=RAW({{tenantId}})&operation=deleteSecret")
+--------------------------------------------------------------------------------
+
+- purgeDeletedSecret: this operation will purge a deleted Secret from Azure Key Vault
+
+[source,java]
+--------------------------------------------------------------------------------
+from("direct:purgeDeletedSecret")
+    .setHeader(KeyVaultConstants.SECRET_NAME, "Test")
+    .to("azure-key-vault://test123?clientId=RAW({{clientId}})&clientSecret=RAW({{clientSecret}})&tenantId=RAW({{tenantId}})&operation=purgeDeletedSecret")
+--------------------------------------------------------------------------------
+
+include::spring-boot:partial$starter.adoc[]
diff --git a/components/camel-hashicorp-vault/src/main/java/org/apache/camel/component/hashicorp/vault/HashicorpVaultComponent.java b/components/camel-hashicorp-vault/src/main/java/org/apache/camel/component/hashicorp/vault/HashicorpVaultComponent.java
new file mode 100644
index 00000000000..0ecc217e991
--- /dev/null
+++ b/components/camel-hashicorp-vault/src/main/java/org/apache/camel/component/hashicorp/vault/HashicorpVaultComponent.java
@@ -0,0 +1,71 @@
+/*
+ * 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.hashicorp.vault;
+
+import java.util.Map;
+
+import org.apache.camel.CamelContext;
+import org.apache.camel.Endpoint;
+import org.apache.camel.spi.Metadata;
+import org.apache.camel.spi.annotations.Component;
+import org.apache.camel.support.DefaultComponent;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Hashicorp Vault component
+ */
+@Component("hashicorp-vault")
+public class HashicorpVaultComponent extends DefaultComponent {
+
+    private static final Logger LOG = LoggerFactory.getLogger(HashicorpVaultComponent.class);
+
+    @Metadata
+    private HashicorpVaultConfiguration configuration = new HashicorpVaultConfiguration();
+
+    public HashicorpVaultComponent() {
+    }
+
+    public HashicorpVaultComponent(final CamelContext context) {
+        super(context);
+    }
+
+    @Override
+    protected Endpoint createEndpoint(String uri, String remaining, Map<String, Object> parameters) throws Exception {
+
+        if (remaining == null || remaining.trim().length() == 0) {
+            throw new IllegalArgumentException("A vault name must be specified.");
+        }
+
+        final HashicorpVaultConfiguration epConfiguration
+                = this.configuration != null ? this.configuration.copy() : new HashicorpVaultConfiguration();
+
+        // set account or topic name
+        epConfiguration.setSecretsEngine(remaining);
+
+        final HashicorpVaultEndpoint endpoint = new HashicorpVaultEndpoint(uri, this, epConfiguration);
+        setProperties(endpoint, parameters);
+
+        if (epConfiguration.getVaultTemplate() == null
+                && epConfiguration.getToken() == null) {
+            throw new IllegalArgumentException(
+                    "Vault Template or token must be specified");
+        }
+
+        return endpoint;
+    }
+}
diff --git a/components/camel-hashicorp-vault/src/main/java/org/apache/camel/component/hashicorp/vault/HashicorpVaultConfiguration.java b/components/camel-hashicorp-vault/src/main/java/org/apache/camel/component/hashicorp/vault/HashicorpVaultConfiguration.java
new file mode 100644
index 00000000000..404de9c309c
--- /dev/null
+++ b/components/camel-hashicorp-vault/src/main/java/org/apache/camel/component/hashicorp/vault/HashicorpVaultConfiguration.java
@@ -0,0 +1,146 @@
+/*
+ * 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.hashicorp.vault;
+
+import org.apache.camel.RuntimeCamelException;
+import org.apache.camel.spi.Metadata;
+import org.apache.camel.spi.UriParam;
+import org.apache.camel.spi.UriParams;
+import org.apache.camel.spi.UriPath;
+import org.springframework.vault.core.VaultTemplate;
+
+@UriParams
+public class HashicorpVaultConfiguration implements Cloneable {
+
+    @UriPath
+    private String secretsEngine;
+    @UriParam
+    @Metadata(autowired = true)
+    private VaultTemplate vaultTemplate;
+    @UriParam
+    private String host;
+    @UriParam(defaultValue = "8200")
+    private String port = "8200";
+    @UriParam(defaultValue = "https")
+    private String scheme = "https";
+    @UriParam
+    private String secretPath;
+    @UriParam(label = "security", secret = true)
+    private String token;
+    @UriParam(label = "producer")
+    private HashicorpVaultOperation operation = HashicorpVaultOperation.createSecret;
+
+    /**
+     * Instance of Vault template
+     */
+    public VaultTemplate getVaultTemplate() {
+        return vaultTemplate;
+    }
+
+    public void setVaultTemplate(VaultTemplate vaultTemplate) {
+        this.vaultTemplate = vaultTemplate;
+    }
+
+    /**
+     * Vault Name to be used
+     */
+    public String getSecretsEngine() {
+        return secretsEngine;
+    }
+
+    public void setSecretsEngine(String secretsEngine) {
+        this.secretsEngine = secretsEngine;
+    }
+
+    /**
+     * Token to be used
+     */
+    public String getToken() {
+        return token;
+    }
+
+    public void setToken(String token) {
+        this.token = token;
+    }
+
+    /**
+     * Hashicorp Vault instance host to be used
+     */
+    public String getHost() {
+        return host;
+    }
+
+    public void setHost(String host) {
+        this.host = host;
+    }
+
+    /**
+     * Hashicorp Vault instance port to be used
+     */
+    public String getPort() {
+        return port;
+    }
+
+    public void setPort(String port) {
+        this.port = port;
+    }
+
+    /**
+     * Hashicorp Vault instance scheme to be used
+     */
+    public String getScheme() {
+        return scheme;
+    }
+
+    public void setScheme(String scheme) {
+        this.scheme = scheme;
+    }
+
+    /**
+     * Hashicorp Vault instance secret Path to be used
+     */
+    public String getSecretPath() {
+        return secretPath;
+    }
+
+    public void setSecretPath(String secretPath) {
+        this.secretPath = secretPath;
+    }
+
+    /**
+     * Operation to be performed
+     */
+    public HashicorpVaultOperation getOperation() {
+        return operation;
+    }
+
+    public void setOperation(HashicorpVaultOperation operation) {
+        this.operation = operation;
+    }
+
+    // *************************************************
+    //
+    // *************************************************
+
+    public HashicorpVaultConfiguration copy() {
+        try {
+            return (HashicorpVaultConfiguration) super.clone();
+        } catch (CloneNotSupportedException e) {
+            throw new RuntimeCamelException(e);
+        }
+    }
+}
diff --git a/components/camel-hashicorp-vault/src/main/java/org/apache/camel/component/hashicorp/vault/HashicorpVaultConstants.java b/components/camel-hashicorp-vault/src/main/java/org/apache/camel/component/hashicorp/vault/HashicorpVaultConstants.java
new file mode 100644
index 00000000000..a6c7afc2e6b
--- /dev/null
+++ b/components/camel-hashicorp-vault/src/main/java/org/apache/camel/component/hashicorp/vault/HashicorpVaultConstants.java
@@ -0,0 +1,31 @@
+/*
+ * 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.hashicorp.vault;
+
+import org.apache.camel.spi.Metadata;
+
+public final class HashicorpVaultConstants {
+    private static final String HEADER_PREFIX = "CamelHashicorpVault";
+
+    // headers set by the producer only
+    @Metadata(label = "producer", description = "Overrides the desired operation to be used in the producer.",
+              javaType = "org.apache.camel.component.azure.key.vault.KeyVaultOperationDefinition")
+    public static final String OPERATION = HEADER_PREFIX + "ProducerOperation";
+
+    private HashicorpVaultConstants() {
+    }
+}
diff --git a/components/camel-hashicorp-vault/src/main/java/org/apache/camel/component/hashicorp/vault/HashicorpVaultEndpoint.java b/components/camel-hashicorp-vault/src/main/java/org/apache/camel/component/hashicorp/vault/HashicorpVaultEndpoint.java
new file mode 100644
index 00000000000..fcc186a0f30
--- /dev/null
+++ b/components/camel-hashicorp-vault/src/main/java/org/apache/camel/component/hashicorp/vault/HashicorpVaultEndpoint.java
@@ -0,0 +1,103 @@
+/*
+ * 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.hashicorp.vault;
+
+import org.apache.camel.Category;
+import org.apache.camel.Component;
+import org.apache.camel.Consumer;
+import org.apache.camel.Processor;
+import org.apache.camel.Producer;
+import org.apache.camel.spi.UriEndpoint;
+import org.apache.camel.spi.UriParam;
+import org.apache.camel.support.DefaultEndpoint;
+import org.springframework.vault.authentication.TokenAuthentication;
+import org.springframework.vault.client.VaultEndpoint;
+import org.springframework.vault.core.VaultTemplate;
+
+/**
+ * Manage secrets in Hashicorp Vault Service
+ */
+@UriEndpoint(firstVersion = "3.18.0", scheme = "hashicorp-vault", title = "Hashicorp Vault",
+             syntax = "hashicorp-vault:vaultName", category = {
+                     Category.CLOUD, Category.CLOUD },
+             producerOnly = true,
+             headersClass = HashicorpVaultConstants.class)
+public class HashicorpVaultEndpoint extends DefaultEndpoint {
+
+    private VaultTemplate vaultTemplate;
+
+    @UriParam
+    private HashicorpVaultConfiguration configuration;
+
+    public HashicorpVaultEndpoint(final String uri, final Component component, final HashicorpVaultConfiguration configuration) {
+        super(uri, component);
+        this.configuration = configuration;
+    }
+
+    @Override
+    public void doInit() throws Exception {
+        super.doInit();
+        vaultTemplate = configuration.getVaultTemplate() != null
+                ? configuration.getVaultTemplate() : createVaultTemplate();
+    }
+
+    private VaultTemplate createVaultTemplate() {
+        VaultTemplate vaultTemplate;
+
+        VaultEndpoint vaultEndpoint = new VaultEndpoint();
+        vaultEndpoint.setHost(configuration.getHost());
+        vaultEndpoint.setPort(Integer.parseInt(configuration.getPort()));
+        vaultEndpoint.setScheme(configuration.getScheme());
+
+        vaultTemplate = new VaultTemplate(vaultEndpoint,
+                new TokenAuthentication(configuration.getToken()));
+
+        return vaultTemplate;
+    }
+
+    @Override
+    public Producer createProducer() throws Exception {
+        return new HashicorpVaultProducer(this);
+    }
+
+    @Override
+    public Consumer createConsumer(Processor processor) throws Exception {
+        throw new UnsupportedOperationException("Consumer not supported");
+    }
+
+    /**
+     * The component configurations
+     */
+    public HashicorpVaultConfiguration getConfiguration() {
+        return configuration;
+    }
+
+    public void setConfiguration(HashicorpVaultConfiguration configuration) {
+        this.configuration = configuration;
+    }
+
+    /**
+     * The vault template
+     */
+    public VaultTemplate getVaultTemplate() {
+        return vaultTemplate;
+    }
+
+    public void setVaultTemplate(VaultTemplate vaultTemplate) {
+        this.vaultTemplate = vaultTemplate;
+    }
+}
diff --git a/components/camel-hashicorp-vault/src/main/java/org/apache/camel/component/hashicorp/vault/HashicorpVaultOperation.java b/components/camel-hashicorp-vault/src/main/java/org/apache/camel/component/hashicorp/vault/HashicorpVaultOperation.java
new file mode 100644
index 00000000000..70d314382e5
--- /dev/null
+++ b/components/camel-hashicorp-vault/src/main/java/org/apache/camel/component/hashicorp/vault/HashicorpVaultOperation.java
@@ -0,0 +1,21 @@
+/*
+ * 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.hashicorp.vault;
+
+public enum HashicorpVaultOperation {
+    createSecret
+}
diff --git a/components/camel-hashicorp-vault/src/main/java/org/apache/camel/component/hashicorp/vault/HashicorpVaultProducer.java b/components/camel-hashicorp-vault/src/main/java/org/apache/camel/component/hashicorp/vault/HashicorpVaultProducer.java
new file mode 100644
index 00000000000..ca27872fc6c
--- /dev/null
+++ b/components/camel-hashicorp-vault/src/main/java/org/apache/camel/component/hashicorp/vault/HashicorpVaultProducer.java
@@ -0,0 +1,84 @@
+/*
+ * 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.hashicorp.vault;
+
+import org.apache.camel.Endpoint;
+import org.apache.camel.Exchange;
+import org.apache.camel.InvalidPayloadException;
+import org.apache.camel.Message;
+import org.apache.camel.support.DefaultProducer;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.vault.core.VaultKeyValueOperations;
+import org.springframework.vault.core.VaultKeyValueOperationsSupport;
+
+public class HashicorpVaultProducer extends DefaultProducer {
+
+    private static final Logger LOG = LoggerFactory.getLogger(HashicorpVaultProducer.class);
+
+    public HashicorpVaultProducer(final Endpoint endpoint) {
+        super(endpoint);
+    }
+
+    @Override
+    protected void doInit() throws Exception {
+        super.doInit();
+    }
+
+    @Override
+    protected void doStart() throws Exception {
+        super.doStart();
+    }
+
+    @Override
+    public void process(Exchange exchange) throws Exception {
+        HashicorpVaultOperation operation = determineOperation(exchange);
+        switch (operation) {
+            case createSecret:
+                createSecret(exchange);
+                break;
+            default:
+                throw new IllegalArgumentException("Unsupported operation");
+        }
+    }
+
+    private void createSecret(Exchange exchange) throws InvalidPayloadException {
+        VaultKeyValueOperations keyValue = getEndpoint().getVaultTemplate().opsForKeyValue(getEndpoint().getConfiguration().getSecretsEngine(), VaultKeyValueOperationsSupport.KeyValueBackend.versioned());
+        keyValue.put(getEndpoint().getConfiguration().getSecretPath(), exchange.getMessage().getBody());
+    }
+
+    @Override
+    public HashicorpVaultEndpoint getEndpoint() {
+        return (HashicorpVaultEndpoint) super.getEndpoint();
+    }
+
+    public HashicorpVaultConfiguration getConfiguration() {
+        return getEndpoint().getConfiguration();
+    }
+
+    public static Message getMessageForResponse(final Exchange exchange) {
+        return exchange.getMessage();
+    }
+
+    private HashicorpVaultOperation determineOperation(Exchange exchange) {
+        HashicorpVaultOperation operation = exchange.getIn().getHeader(HashicorpVaultConstants.OPERATION, HashicorpVaultOperation.class);
+        if (operation == null) {
+            operation = getConfiguration().getOperation();
+        }
+        return operation;
+    }
+}
diff --git a/components/camel-hashicorp-vault/src/test/java/org/apache/camel/component/hashicorp/vault/integration/operations/HashicorpProducerCreateSecretIT.java b/components/camel-hashicorp-vault/src/test/java/org/apache/camel/component/hashicorp/vault/integration/operations/HashicorpProducerCreateSecretIT.java
new file mode 100644
index 00000000000..cfa5f9e6664
--- /dev/null
+++ b/components/camel-hashicorp-vault/src/test/java/org/apache/camel/component/hashicorp/vault/integration/operations/HashicorpProducerCreateSecretIT.java
@@ -0,0 +1,47 @@
+package org.apache.camel.component.hashicorp.vault.integration.operations;
+
+import org.apache.camel.EndpointInject;
+import org.apache.camel.Exchange;
+import org.apache.camel.Processor;
+import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.component.mock.MockEndpoint;
+import org.apache.camel.test.junit5.CamelTestSupport;
+import org.junit.jupiter.api.Disabled;
+import org.junit.jupiter.api.Test;
+
+import java.util.HashMap;
+
+@Disabled("Disabled until we'll have a Camel-Hashicorp-vault test-infra module")
+public class HashicorpProducerCreateSecretIT extends CamelTestSupport {
+
+    @EndpointInject("mock:result")
+    private MockEndpoint mock;
+
+    @Test
+    public void createSecretTest() {
+
+        mock.expectedMessageCount(1);
+        Exchange exchange = template.request("direct:createSecret", new Processor() {
+            @Override
+            public void process(Exchange exchange) {
+                HashMap map = new HashMap();
+                map.put("integer", "30");
+                exchange.getIn().setBody(map);
+            }
+        });
+
+
+    }
+
+    @Override
+    protected RouteBuilder createRouteBuilder() {
+        return new RouteBuilder() {
+            @Override
+            public void configure() {
+                from("direct:createSecret")
+                        .to("hashicorp-vault://secret?operation=createSecret&token=RAW(token)&host=localhost&scheme=http&secretPath=test")
+                        .to("mock:result");
+            }
+        };
+    }
+}
diff --git a/components/camel-hashicorp-vault/src/test/java/org/apache/camel/component/hashicorp/vault/integration/operations/HashicorpProducerCreateSecretPOJOIT.java b/components/camel-hashicorp-vault/src/test/java/org/apache/camel/component/hashicorp/vault/integration/operations/HashicorpProducerCreateSecretPOJOIT.java
new file mode 100644
index 00000000000..a6ed25304ef
--- /dev/null
+++ b/components/camel-hashicorp-vault/src/test/java/org/apache/camel/component/hashicorp/vault/integration/operations/HashicorpProducerCreateSecretPOJOIT.java
@@ -0,0 +1,63 @@
+package org.apache.camel.component.hashicorp.vault.integration.operations;
+
+import org.apache.camel.EndpointInject;
+import org.apache.camel.Exchange;
+import org.apache.camel.Processor;
+import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.component.mock.MockEndpoint;
+import org.apache.camel.test.junit5.CamelTestSupport;
+import org.junit.jupiter.api.Disabled;
+import org.junit.jupiter.api.Test;
+import org.springframework.vault.support.VaultResponse;
+
+import java.util.HashMap;
+
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+
+@Disabled("Disabled until we'll have a Camel-Hashicorp-vault test-infra module")
+public class HashicorpProducerCreateSecretPOJOIT extends CamelTestSupport {
+
+    @EndpointInject("mock:result")
+    private MockEndpoint mock;
+
+    @Test
+    public void createSecretTest() {
+
+        mock.expectedMessageCount(1);
+        Exchange exchange = template.request("direct:createSecret", new Processor() {
+            @Override
+            public void process(Exchange exchange) {
+                Secrets sec = new Secrets();
+                sec.username = "admin";
+                sec.password = "password";
+                exchange.getIn().setBody(sec);
+            }
+        });
+    }
+
+    @Override
+    protected RouteBuilder createRouteBuilder() {
+        return new RouteBuilder() {
+            @Override
+            public void configure() {
+                from("direct:createSecret")
+                        .to("hashicorp-vault://secret?operation=createSecret&token=RAW(token)&host=localhost&scheme=http&secretPath=test")
+                        .to("mock:result");
+            }
+        };
+    }
+
+    class Secrets {
+
+        String username;
+        String password;
+
+        public String getUsername() {
+            return username;
+        }
+
+        public String getPassword() {
+            return password;
+        }
+    }
+}
diff --git a/components/camel-hashicorp-vault/src/test/resources/log4j2.properties b/components/camel-hashicorp-vault/src/test/resources/log4j2.properties
new file mode 100644
index 00000000000..b4aa74472e1
--- /dev/null
+++ b/components/camel-hashicorp-vault/src/test/resources/log4j2.properties
@@ -0,0 +1,27 @@
+## ---------------------------------------------------------------------------
+## 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.
+## ---------------------------------------------------------------------------
+appender.file.type = File
+appender.file.name = file
+appender.file.fileName = target/camel-hashicorp-vault-test.log
+appender.file.layout.type = PatternLayout
+appender.file.layout.pattern = %d [%-15.15t] %-5p %-30.30c{1} - %m%n
+appender.out.type = Console
+appender.out.name = out
+appender.out.layout.type = PatternLayout
+appender.out.layout.pattern = %d [%-15.15t] %-5p %-30.30c{1} - %m%n
+rootLogger.level = INFO
+rootLogger.appenderRef.file.ref = file
diff --git a/parent/pom.xml b/parent/pom.xml
index 35fa4d4ff2e..54e2ee70b07 100644
--- a/parent/pom.xml
+++ b/parent/pom.xml
@@ -1518,6 +1518,11 @@
 				<artifactId>camel-guava-eventbus</artifactId>
 				<version>${project.version}</version>
 			</dependency>
+			<dependency>
+				<groupId>org.apache.camel</groupId>
+				<artifactId>camel-hashicorp-vault</artifactId>
+				<version>${project.version}</version>
+			</dependency>
 			<dependency>
 				<groupId>org.apache.camel</groupId>
 				<artifactId>camel-hazelcast</artifactId>


[camel] 05/05: CAMEL-17689 - Create a Camel Hashicorp Vault Component - First iteration regen

Posted by ac...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

acosentino pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git

commit 0ed6c56517bd21078c815fc7db23e8050f0472a0
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Wed Jun 8 14:54:07 2022 +0200

    CAMEL-17689 - Create a Camel Hashicorp Vault Component - First iteration regen
---
 catalog/camel-allcomponents/pom.xml                |   4 -
 .../org/apache/camel/catalog/components.properties |   1 +
 .../camel/catalog/components/hashicorp-vault.json  |  42 +++
 .../org/apache/camel/main/components.properties    |   1 +
 .../ROOT/examples/json/hashicorp-vault.json        |   1 +
 docs/components/modules/ROOT/nav.adoc              |   1 +
 .../ROOT/pages/hashicorp-vault-component.adoc      |   1 +
 .../component/ComponentsBuilderFactory.java        |  13 +
 .../dsl/HashicorpVaultComponentBuilderFactory.java | 121 +++++++++
 .../src/generated/resources/metadata.json          |  22 ++
 .../builder/endpoint/EndpointBuilderFactory.java   |   1 +
 .../camel/builder/endpoint/EndpointBuilders.java   |   1 +
 .../builder/endpoint/StaticEndpointBuilders.java   |  43 ++++
 .../dsl/HashicorpVaultEndpointBuilderFactory.java  | 284 +++++++++++++++++++++
 parent/pom.xml                                     |   5 -
 15 files changed, 532 insertions(+), 9 deletions(-)

diff --git a/catalog/camel-allcomponents/pom.xml b/catalog/camel-allcomponents/pom.xml
index cf9348f3c31..4d4952915e5 100644
--- a/catalog/camel-allcomponents/pom.xml
+++ b/catalog/camel-allcomponents/pom.xml
@@ -597,10 +597,6 @@
 			<groupId>org.apache.camel</groupId>
 			<artifactId>camel-hashicorp-vault</artifactId>
 		</dependency>
-		<dependency>
-			<groupId>org.apache.camel</groupId>
-			<artifactId>camel-hashicorp-vault</artifactId>
-		</dependency>
 		<dependency>
 			<groupId>org.apache.camel</groupId>
 			<artifactId>camel-hazelcast</artifactId>
diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components.properties b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components.properties
index e5655177c61..7dd261e6ccb 100644
--- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components.properties
+++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components.properties
@@ -124,6 +124,7 @@ grape
 graphql
 grpc
 guava-eventbus
+hashicorp-vault
 hazelcast-atomicvalue
 hazelcast-instance
 hazelcast-list
diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/hashicorp-vault.json b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/hashicorp-vault.json
new file mode 100644
index 00000000000..036ce798670
--- /dev/null
+++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/hashicorp-vault.json
@@ -0,0 +1,42 @@
+{
+  "component": {
+    "kind": "component",
+    "name": "hashicorp-vault",
+    "title": "Hashicorp Vault",
+    "description": "Manage secrets in Hashicorp Vault Service",
+    "deprecated": false,
+    "firstVersion": "3.18.0",
+    "label": "cloud,cloud",
+    "javaType": "org.apache.camel.component.hashicorp.vault.HashicorpVaultComponent",
+    "supportLevel": "Preview",
+    "groupId": "org.apache.camel",
+    "artifactId": "camel-hashicorp-vault",
+    "version": "3.18.0-SNAPSHOT",
+    "scheme": "hashicorp-vault",
+    "extendsScheme": "",
+    "syntax": "hashicorp-vault:vaultName",
+    "async": false,
+    "api": false,
+    "consumerOnly": false,
+    "producerOnly": true,
+    "lenientProperties": false
+  },
+  "componentProperties": {
+    "lazyStartProducer": { "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 during star [...]
+    "autowiredEnabled": { "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 type, which t [...]
+  },
+  "headers": {
+    "CamelHashicorpVaultProducerOperation": { "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "org.apache.camel.component.azure.key.vault.KeyVaultOperationDefinition", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Overrides the desired operation to be used in the producer.", "constantName": "org.apache.camel.component.hashicorp.vault.HashicorpVaultConstants#OPERATION" }
+  },
+  "properties": {
+    "secretsEngine": { "kind": "path", "displayName": "Secrets Engine", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.hashicorp.vault.HashicorpVaultConfiguration", "configurationField": "configuration", "description": "Vault Name to be used" },
+    "host": { "kind": "parameter", "displayName": "Host", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.hashicorp.vault.HashicorpVaultConfiguration", "configurationField": "configuration", "description": "Hashicorp Vault instance host to be used" },
+    "lazyStartProducer": { "kind": "parameter", "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 during sta [...]
+    "operation": { "kind": "parameter", "displayName": "Operation", "group": "producer", "label": "producer", "required": false, "type": "object", "javaType": "org.apache.camel.component.hashicorp.vault.HashicorpVaultOperation", "enum": [ "createSecret" ], "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.hashicorp.vault.HashicorpVaultConfiguration", "configurationField": "configuration", "description": "Operation to be performed" },
+    "port": { "kind": "parameter", "displayName": "Port", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "defaultValue": "8200", "configurationClass": "org.apache.camel.component.hashicorp.vault.HashicorpVaultConfiguration", "configurationField": "configuration", "description": "Hashicorp Vault instance port to be used" },
+    "scheme": { "kind": "parameter", "displayName": "Scheme", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "defaultValue": "https", "configurationClass": "org.apache.camel.component.hashicorp.vault.HashicorpVaultConfiguration", "configurationField": "configuration", "description": "Hashicorp Vault instance scheme to be used" },
+    "secretPath": { "kind": "parameter", "displayName": "Secret Path", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.hashicorp.vault.HashicorpVaultConfiguration", "configurationField": "configuration", "description": "Hashicorp Vault instance secret Path to be used" },
+    "vaultTemplate": { "kind": "parameter", "displayName": "Vault Template", "group": "producer", "label": "", "required": false, "type": "object", "javaType": "org.springframework.vault.core.VaultTemplate", "deprecated": false, "deprecationNote": "", "autowired": true, "secret": false, "configurationClass": "org.apache.camel.component.hashicorp.vault.HashicorpVaultConfiguration", "configurationField": "configuration", "description": "Instance of Vault template" },
+    "token": { "kind": "parameter", "displayName": "Token", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": true, "configurationClass": "org.apache.camel.component.hashicorp.vault.HashicorpVaultConfiguration", "configurationField": "configuration", "description": "Token to be used" }
+  }
+}
diff --git a/core/camel-main/src/generated/resources/org/apache/camel/main/components.properties b/core/camel-main/src/generated/resources/org/apache/camel/main/components.properties
index e5655177c61..7dd261e6ccb 100644
--- a/core/camel-main/src/generated/resources/org/apache/camel/main/components.properties
+++ b/core/camel-main/src/generated/resources/org/apache/camel/main/components.properties
@@ -124,6 +124,7 @@ grape
 graphql
 grpc
 guava-eventbus
+hashicorp-vault
 hazelcast-atomicvalue
 hazelcast-instance
 hazelcast-list
diff --git a/docs/components/modules/ROOT/examples/json/hashicorp-vault.json b/docs/components/modules/ROOT/examples/json/hashicorp-vault.json
new file mode 120000
index 00000000000..a9b2683da1e
--- /dev/null
+++ b/docs/components/modules/ROOT/examples/json/hashicorp-vault.json
@@ -0,0 +1 @@
+../../../../../../components/camel-hashicorp-vault/src/generated/resources/org/apache/camel/component/hashicorp/vault/hashicorp-vault.json
\ No newline at end of file
diff --git a/docs/components/modules/ROOT/nav.adoc b/docs/components/modules/ROOT/nav.adoc
index 003fb99ba23..b6ad7a420b1 100644
--- a/docs/components/modules/ROOT/nav.adoc
+++ b/docs/components/modules/ROOT/nav.adoc
@@ -45,6 +45,7 @@
 *** xref:azure-storage-blob-component.adoc[Azure Storage Blob Service]
 *** xref:azure-storage-datalake-component.adoc[Azure Storage Datalake Service]
 *** xref:azure-storage-queue-component.adoc[Azure Storage Queue Service]
+*** xref:hashicorp-vault-component.adoc[Hashicorp Vault]
 ** xref:bean-component.adoc[Bean]
 ** xref:bean-validator-component.adoc[Bean Validator]
 ** xref:bonita-component.adoc[Bonita]
diff --git a/docs/components/modules/ROOT/pages/hashicorp-vault-component.adoc b/docs/components/modules/ROOT/pages/hashicorp-vault-component.adoc
new file mode 120000
index 00000000000..d6ac0616ec9
--- /dev/null
+++ b/docs/components/modules/ROOT/pages/hashicorp-vault-component.adoc
@@ -0,0 +1 @@
+../../../../../components/camel-hashicorp-vault/src/main/docs/hashicorp-vault-component.adoc
\ No newline at end of file
diff --git a/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/ComponentsBuilderFactory.java b/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/ComponentsBuilderFactory.java
index a6af1f3cb58..1dffa9002c8 100644
--- a/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/ComponentsBuilderFactory.java
+++ b/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/ComponentsBuilderFactory.java
@@ -1719,6 +1719,19 @@ public interface ComponentsBuilderFactory {
     static org.apache.camel.builder.component.dsl.GuavaEventbusComponentBuilderFactory.GuavaEventbusComponentBuilder guavaEventbus() {
         return org.apache.camel.builder.component.dsl.GuavaEventbusComponentBuilderFactory.guavaEventbus();
     }
+    /**
+     * Hashicorp Vault (camel-hashicorp-vault)
+     * Manage secrets in Hashicorp Vault Service
+     * 
+     * Category: cloud,cloud
+     * Since: 3.18
+     * Maven coordinates: org.apache.camel:camel-hashicorp-vault
+     * 
+     * @return the dsl builder
+     */
+    static org.apache.camel.builder.component.dsl.HashicorpVaultComponentBuilderFactory.HashicorpVaultComponentBuilder hashicorpVault() {
+        return org.apache.camel.builder.component.dsl.HashicorpVaultComponentBuilderFactory.hashicorpVault();
+    }
     /**
      * Hazelcast Atomic Number (camel-hazelcast)
      * Increment, decrement, set, etc. Hazelcast atomic number (a grid wide
diff --git a/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/HashicorpVaultComponentBuilderFactory.java b/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/HashicorpVaultComponentBuilderFactory.java
new file mode 100644
index 00000000000..e0b8c3ebaf4
--- /dev/null
+++ b/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/HashicorpVaultComponentBuilderFactory.java
@@ -0,0 +1,121 @@
+/*
+ * 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.builder.component.dsl;
+
+import javax.annotation.Generated;
+import org.apache.camel.Component;
+import org.apache.camel.builder.component.AbstractComponentBuilder;
+import org.apache.camel.builder.component.ComponentBuilder;
+import org.apache.camel.component.hashicorp.vault.HashicorpVaultComponent;
+
+/**
+ * Manage secrets in Hashicorp Vault Service
+ * 
+ * Generated by camel-package-maven-plugin - do not edit this file!
+ */
+@Generated("org.apache.camel.maven.packaging.ComponentDslMojo")
+public interface HashicorpVaultComponentBuilderFactory {
+
+    /**
+     * Hashicorp Vault (camel-hashicorp-vault)
+     * Manage secrets in Hashicorp Vault Service
+     * 
+     * Category: cloud,cloud
+     * Since: 3.18
+     * Maven coordinates: org.apache.camel:camel-hashicorp-vault
+     * 
+     * @return the dsl builder
+     */
+    static HashicorpVaultComponentBuilder hashicorpVault() {
+        return new HashicorpVaultComponentBuilderImpl();
+    }
+
+    /**
+     * Builder for the Hashicorp Vault component.
+     */
+    interface HashicorpVaultComponentBuilder
+            extends
+                ComponentBuilder<HashicorpVaultComponent> {
+        /**
+         * 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.
+         * 
+         * The option is a: &lt;code&gt;boolean&lt;/code&gt; type.
+         * 
+         * Default: false
+         * Group: producer
+         * 
+         * @param lazyStartProducer the value to set
+         * @return the dsl builder
+         */
+        default HashicorpVaultComponentBuilder lazyStartProducer(
+                boolean lazyStartProducer) {
+            doSetProperty("lazyStartProducer", lazyStartProducer);
+            return this;
+        }
+        /**
+         * 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.
+         * 
+         * The option is a: &lt;code&gt;boolean&lt;/code&gt; type.
+         * 
+         * Default: true
+         * Group: advanced
+         * 
+         * @param autowiredEnabled the value to set
+         * @return the dsl builder
+         */
+        default HashicorpVaultComponentBuilder autowiredEnabled(
+                boolean autowiredEnabled) {
+            doSetProperty("autowiredEnabled", autowiredEnabled);
+            return this;
+        }
+    }
+
+    class HashicorpVaultComponentBuilderImpl
+            extends
+                AbstractComponentBuilder<HashicorpVaultComponent>
+            implements
+                HashicorpVaultComponentBuilder {
+        @Override
+        protected HashicorpVaultComponent buildConcreteComponent() {
+            return new HashicorpVaultComponent();
+        }
+        @Override
+        protected boolean setPropertyOnComponent(
+                Component component,
+                String name,
+                Object value) {
+            switch (name) {
+            case "lazyStartProducer": ((HashicorpVaultComponent) component).setLazyStartProducer((boolean) value); return true;
+            case "autowiredEnabled": ((HashicorpVaultComponent) component).setAutowiredEnabled((boolean) value); return true;
+            default: return false;
+            }
+        }
+    }
+}
\ No newline at end of file
diff --git a/dsl/camel-componentdsl/src/generated/resources/metadata.json b/dsl/camel-componentdsl/src/generated/resources/metadata.json
index edbfee42add..8171223dcea 100644
--- a/dsl/camel-componentdsl/src/generated/resources/metadata.json
+++ b/dsl/camel-componentdsl/src/generated/resources/metadata.json
@@ -2797,6 +2797,28 @@
     "producerOnly": false,
     "lenientProperties": false
   },
+  "HashicorpVaultComponentBuilderFactory": {
+    "kind": "component",
+    "name": "hashicorp-vault",
+    "title": "Hashicorp Vault",
+    "description": "Manage secrets in Hashicorp Vault Service",
+    "deprecated": false,
+    "firstVersion": "3.18.0",
+    "label": "cloud,cloud",
+    "javaType": "org.apache.camel.component.hashicorp.vault.HashicorpVaultComponent",
+    "supportLevel": "Preview",
+    "groupId": "org.apache.camel",
+    "artifactId": "camel-hashicorp-vault",
+    "version": "3.18.0-SNAPSHOT",
+    "scheme": "hashicorp-vault",
+    "extendsScheme": "",
+    "syntax": "hashicorp-vault:vaultName",
+    "async": false,
+    "api": false,
+    "consumerOnly": false,
+    "producerOnly": true,
+    "lenientProperties": false
+  },
   "HazelcastAtomicvalueComponentBuilderFactory": {
     "kind": "component",
     "name": "hazelcast-atomicvalue",
diff --git a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/EndpointBuilderFactory.java b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/EndpointBuilderFactory.java
index e9a12d12b84..a11ab6944aa 100644
--- a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/EndpointBuilderFactory.java
+++ b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/EndpointBuilderFactory.java
@@ -141,6 +141,7 @@ public interface EndpointBuilderFactory
             org.apache.camel.builder.endpoint.dsl.GrpcEndpointBuilderFactory.GrpcBuilders,
             org.apache.camel.builder.endpoint.dsl.GuavaEventBusEndpointBuilderFactory.GuavaEventBusBuilders,
             org.apache.camel.builder.endpoint.dsl.HBaseEndpointBuilderFactory.HBaseBuilders,
+            org.apache.camel.builder.endpoint.dsl.HashicorpVaultEndpointBuilderFactory.HashicorpVaultBuilders,
             org.apache.camel.builder.endpoint.dsl.HazelcastAtomicnumberEndpointBuilderFactory.HazelcastAtomicnumberBuilders,
             org.apache.camel.builder.endpoint.dsl.HazelcastInstanceEndpointBuilderFactory.HazelcastInstanceBuilders,
             org.apache.camel.builder.endpoint.dsl.HazelcastListEndpointBuilderFactory.HazelcastListBuilders,
diff --git a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/EndpointBuilders.java b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/EndpointBuilders.java
index b82aa0bee9d..239649a5e86 100644
--- a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/EndpointBuilders.java
+++ b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/EndpointBuilders.java
@@ -138,6 +138,7 @@ public interface EndpointBuilders
             org.apache.camel.builder.endpoint.dsl.GrpcEndpointBuilderFactory,
             org.apache.camel.builder.endpoint.dsl.GuavaEventBusEndpointBuilderFactory,
             org.apache.camel.builder.endpoint.dsl.HBaseEndpointBuilderFactory,
+            org.apache.camel.builder.endpoint.dsl.HashicorpVaultEndpointBuilderFactory,
             org.apache.camel.builder.endpoint.dsl.HazelcastAtomicnumberEndpointBuilderFactory,
             org.apache.camel.builder.endpoint.dsl.HazelcastInstanceEndpointBuilderFactory,
             org.apache.camel.builder.endpoint.dsl.HazelcastListEndpointBuilderFactory,
diff --git a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/StaticEndpointBuilders.java b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/StaticEndpointBuilders.java
index 4eb6093336d..422e69a9ede 100644
--- a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/StaticEndpointBuilders.java
+++ b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/StaticEndpointBuilders.java
@@ -5856,6 +5856,49 @@ public class StaticEndpointBuilders {
             String path) {
         return org.apache.camel.builder.endpoint.dsl.GuavaEventBusEndpointBuilderFactory.endpointBuilder(componentName, path);
     }
+    /**
+     * Hashicorp Vault (camel-hashicorp-vault)
+     * Manage secrets in Hashicorp Vault Service
+     * 
+     * Category: cloud,cloud
+     * Since: 3.18
+     * Maven coordinates: org.apache.camel:camel-hashicorp-vault
+     * 
+     * Syntax: <code>hashicorp-vault:vaultName</code>
+     * 
+     * Path parameter: secretsEngine
+     * Vault Name to be used
+     * 
+     * @param path vaultName
+     * @return the dsl builder
+     */
+    public static org.apache.camel.builder.endpoint.dsl.HashicorpVaultEndpointBuilderFactory.HashicorpVaultEndpointBuilder hashicorpVault(
+            String path) {
+        return org.apache.camel.builder.endpoint.dsl.HashicorpVaultEndpointBuilderFactory.endpointBuilder("hashicorp-vault", path);
+    }
+    /**
+     * Hashicorp Vault (camel-hashicorp-vault)
+     * Manage secrets in Hashicorp Vault Service
+     * 
+     * Category: cloud,cloud
+     * Since: 3.18
+     * Maven coordinates: org.apache.camel:camel-hashicorp-vault
+     * 
+     * Syntax: <code>hashicorp-vault:vaultName</code>
+     * 
+     * Path parameter: secretsEngine
+     * Vault Name to be used
+     * 
+     * @param componentName to use a custom component name for the endpoint
+     * instead of the default name
+     * @param path vaultName
+     * @return the dsl builder
+     */
+    public static org.apache.camel.builder.endpoint.dsl.HashicorpVaultEndpointBuilderFactory.HashicorpVaultEndpointBuilder hashicorpVault(
+            String componentName,
+            String path) {
+        return org.apache.camel.builder.endpoint.dsl.HashicorpVaultEndpointBuilderFactory.endpointBuilder(componentName, path);
+    }
     /**
      * Hazelcast Atomic Number (camel-hazelcast)
      * Increment, decrement, set, etc. Hazelcast atomic number (a grid wide
diff --git a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/HashicorpVaultEndpointBuilderFactory.java b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/HashicorpVaultEndpointBuilderFactory.java
new file mode 100644
index 00000000000..1726f52fb5a
--- /dev/null
+++ b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/HashicorpVaultEndpointBuilderFactory.java
@@ -0,0 +1,284 @@
+/*
+ * 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.builder.endpoint.dsl;
+
+import java.util.*;
+import java.util.concurrent.*;
+import java.util.function.*;
+import java.util.stream.*;
+import javax.annotation.Generated;
+import org.apache.camel.builder.EndpointConsumerBuilder;
+import org.apache.camel.builder.EndpointProducerBuilder;
+import org.apache.camel.builder.endpoint.AbstractEndpointBuilder;
+
+/**
+ * Manage secrets in Hashicorp Vault Service
+ * 
+ * Generated by camel build tools - do NOT edit this file!
+ */
+@Generated("org.apache.camel.maven.packaging.EndpointDslMojo")
+public interface HashicorpVaultEndpointBuilderFactory {
+
+
+    /**
+     * Builder for endpoint for the Hashicorp Vault component.
+     */
+    public interface HashicorpVaultEndpointBuilder
+            extends
+                EndpointProducerBuilder {
+        /**
+         * Hashicorp Vault instance host to be used.
+         * 
+         * The option is a: &lt;code&gt;java.lang.String&lt;/code&gt; type.
+         * 
+         * Group: producer
+         * 
+         * @param host the value to set
+         * @return the dsl builder
+         */
+        default HashicorpVaultEndpointBuilder host(String host) {
+            doSetProperty("host", host);
+            return this;
+        }
+        /**
+         * 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.
+         * 
+         * The option is a: &lt;code&gt;boolean&lt;/code&gt; type.
+         * 
+         * Default: false
+         * Group: producer
+         * 
+         * @param lazyStartProducer the value to set
+         * @return the dsl builder
+         */
+        default HashicorpVaultEndpointBuilder lazyStartProducer(
+                boolean lazyStartProducer) {
+            doSetProperty("lazyStartProducer", lazyStartProducer);
+            return this;
+        }
+        /**
+         * 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.
+         * 
+         * The option will be converted to a &lt;code&gt;boolean&lt;/code&gt;
+         * type.
+         * 
+         * Default: false
+         * Group: producer
+         * 
+         * @param lazyStartProducer the value to set
+         * @return the dsl builder
+         */
+        default HashicorpVaultEndpointBuilder lazyStartProducer(
+                String lazyStartProducer) {
+            doSetProperty("lazyStartProducer", lazyStartProducer);
+            return this;
+        }
+        /**
+         * Operation to be performed.
+         * 
+         * The option is a:
+         * &lt;code&gt;org.apache.camel.component.hashicorp.vault.HashicorpVaultOperation&lt;/code&gt; type.
+         * 
+         * Group: producer
+         * 
+         * @param operation the value to set
+         * @return the dsl builder
+         */
+        default HashicorpVaultEndpointBuilder operation(
+                org.apache.camel.component.hashicorp.vault.HashicorpVaultOperation operation) {
+            doSetProperty("operation", operation);
+            return this;
+        }
+        /**
+         * Operation to be performed.
+         * 
+         * The option will be converted to a
+         * &lt;code&gt;org.apache.camel.component.hashicorp.vault.HashicorpVaultOperation&lt;/code&gt; type.
+         * 
+         * Group: producer
+         * 
+         * @param operation the value to set
+         * @return the dsl builder
+         */
+        default HashicorpVaultEndpointBuilder operation(String operation) {
+            doSetProperty("operation", operation);
+            return this;
+        }
+        /**
+         * Hashicorp Vault instance port to be used.
+         * 
+         * The option is a: &lt;code&gt;java.lang.String&lt;/code&gt; type.
+         * 
+         * Default: 8200
+         * Group: producer
+         * 
+         * @param port the value to set
+         * @return the dsl builder
+         */
+        default HashicorpVaultEndpointBuilder port(String port) {
+            doSetProperty("port", port);
+            return this;
+        }
+        /**
+         * Hashicorp Vault instance scheme to be used.
+         * 
+         * The option is a: &lt;code&gt;java.lang.String&lt;/code&gt; type.
+         * 
+         * Default: https
+         * Group: producer
+         * 
+         * @param scheme the value to set
+         * @return the dsl builder
+         */
+        default HashicorpVaultEndpointBuilder scheme(String scheme) {
+            doSetProperty("scheme", scheme);
+            return this;
+        }
+        /**
+         * Hashicorp Vault instance secret Path to be used.
+         * 
+         * The option is a: &lt;code&gt;java.lang.String&lt;/code&gt; type.
+         * 
+         * Group: producer
+         * 
+         * @param secretPath the value to set
+         * @return the dsl builder
+         */
+        default HashicorpVaultEndpointBuilder secretPath(String secretPath) {
+            doSetProperty("secretPath", secretPath);
+            return this;
+        }
+        /**
+         * Instance of Vault template.
+         * 
+         * The option is a:
+         * &lt;code&gt;org.springframework.vault.core.VaultTemplate&lt;/code&gt;
+         * type.
+         * 
+         * Group: producer
+         * 
+         * @param vaultTemplate the value to set
+         * @return the dsl builder
+         */
+        default HashicorpVaultEndpointBuilder vaultTemplate(
+                org.springframework.vault.core.VaultTemplate vaultTemplate) {
+            doSetProperty("vaultTemplate", vaultTemplate);
+            return this;
+        }
+        /**
+         * Instance of Vault template.
+         * 
+         * The option will be converted to a
+         * &lt;code&gt;org.springframework.vault.core.VaultTemplate&lt;/code&gt;
+         * type.
+         * 
+         * Group: producer
+         * 
+         * @param vaultTemplate the value to set
+         * @return the dsl builder
+         */
+        default HashicorpVaultEndpointBuilder vaultTemplate(String vaultTemplate) {
+            doSetProperty("vaultTemplate", vaultTemplate);
+            return this;
+        }
+        /**
+         * Token to be used.
+         * 
+         * The option is a: &lt;code&gt;java.lang.String&lt;/code&gt; type.
+         * 
+         * Group: security
+         * 
+         * @param token the value to set
+         * @return the dsl builder
+         */
+        default HashicorpVaultEndpointBuilder token(String token) {
+            doSetProperty("token", token);
+            return this;
+        }
+    }
+
+    public interface HashicorpVaultBuilders {
+        /**
+         * Hashicorp Vault (camel-hashicorp-vault)
+         * Manage secrets in Hashicorp Vault Service
+         * 
+         * Category: cloud,cloud
+         * Since: 3.18
+         * Maven coordinates: org.apache.camel:camel-hashicorp-vault
+         * 
+         * Syntax: <code>hashicorp-vault:vaultName</code>
+         * 
+         * Path parameter: secretsEngine
+         * Vault Name to be used
+         * 
+         * @param path vaultName
+         * @return the dsl builder
+         */
+        default HashicorpVaultEndpointBuilder hashicorpVault(String path) {
+            return HashicorpVaultEndpointBuilderFactory.endpointBuilder("hashicorp-vault", path);
+        }
+        /**
+         * Hashicorp Vault (camel-hashicorp-vault)
+         * Manage secrets in Hashicorp Vault Service
+         * 
+         * Category: cloud,cloud
+         * Since: 3.18
+         * Maven coordinates: org.apache.camel:camel-hashicorp-vault
+         * 
+         * Syntax: <code>hashicorp-vault:vaultName</code>
+         * 
+         * Path parameter: secretsEngine
+         * Vault Name to be used
+         * 
+         * @param componentName to use a custom component name for the endpoint
+         * instead of the default name
+         * @param path vaultName
+         * @return the dsl builder
+         */
+        default HashicorpVaultEndpointBuilder hashicorpVault(
+                String componentName,
+                String path) {
+            return HashicorpVaultEndpointBuilderFactory.endpointBuilder(componentName, path);
+        }
+    }
+    static HashicorpVaultEndpointBuilder endpointBuilder(
+            String componentName,
+            String path) {
+        class HashicorpVaultEndpointBuilderImpl extends AbstractEndpointBuilder implements HashicorpVaultEndpointBuilder {
+            public HashicorpVaultEndpointBuilderImpl(String path) {
+                super(componentName, path);
+            }
+        }
+        return new HashicorpVaultEndpointBuilderImpl(path);
+    }
+}
\ No newline at end of file
diff --git a/parent/pom.xml b/parent/pom.xml
index 497115729d0..54e2ee70b07 100644
--- a/parent/pom.xml
+++ b/parent/pom.xml
@@ -1523,11 +1523,6 @@
 				<artifactId>camel-hashicorp-vault</artifactId>
 				<version>${project.version}</version>
 			</dependency>
-			<dependency>
-				<groupId>org.apache.camel</groupId>
-				<artifactId>camel-hashicorp-vault</artifactId>
-				<version>${project.version}</version>
-			</dependency>
 			<dependency>
 				<groupId>org.apache.camel</groupId>
 				<artifactId>camel-hazelcast</artifactId>


[camel] 02/05: CAMEL-17689 - Create a Camel Hashicorp Vault Component

Posted by ac...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

acosentino pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git

commit 047bd2ae110de27c6bf5afe8ad3810973bb1c7ef
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Wed Jun 8 14:01:09 2022 +0200

    CAMEL-17689 - Create a Camel Hashicorp Vault Component
---
 .../src/main/docs/azure-key-vault-component.adoc   | 203 ---------------------
 .../src/main/docs/hashicorp-vault-component.adoc   |  44 +++++
 2 files changed, 44 insertions(+), 203 deletions(-)

diff --git a/components/camel-hashicorp-vault/src/main/docs/azure-key-vault-component.adoc b/components/camel-hashicorp-vault/src/main/docs/azure-key-vault-component.adoc
deleted file mode 100644
index 014141813ff..00000000000
--- a/components/camel-hashicorp-vault/src/main/docs/azure-key-vault-component.adoc
+++ /dev/null
@@ -1,203 +0,0 @@
-= Azure Key Vault Component
-:doctitle: Azure Key Vault
-:shortname: azure-key-vault
-:artifactid: camel-azure-key-vault
-:description: Manage secrets and keys in Azure Key Vault Service
-:since: 3.17
-:supportlevel: Preview
-:component-header: Only producer is supported
-//Manually maintained attributes
-:group: Azure
-:camel-spring-boot-name: azure-key-vault
-
-*Since Camel {since}*
-
-*{component-header}*
-
-The azure-key-vault component that integrates https://azure.microsoft.com/en-us/services/key-vault/[Azure ServiceBus]. 
-
-Prerequisites
-
-You must have a valid Windows Azure Key Vault account. More information is available at
-https://docs.microsoft.com/azure/[Azure Documentation Portal].
-
-== URI Format
-
-[source,xml]
-------------------------------------------------------------
-<dependency>
-    <groupId>org.apache.camel</groupId>
-    <artifactId>camel-azure-key-vault</artifactId>
-    <version>x.x.x</version>
-    <!-- use the same version as your Camel core version -->
-</dependency>
-------------------------------------------------------------
-
-
-// component-configure options: START
-
-// component-configure options: END
-
-// component options: START
-include::partial$component-configure-options.adoc[]
-include::partial$component-endpoint-options.adoc[]
-// component options: END
-
-// endpoint options: START
-
-// endpoint options: END
-
-
-== Usage
-
-=== Using Azure Key Vault Property Function
-
-To use this function you'll need to provide credentials to Azure Key Vault Service as environment variables:
-
-[source,bash]
-----
-export $CAMEL_VAULT_AZURE_TENANT_ID=tenantId
-export $CAMEL_VAULT_AZURE_CLIENT_ID=clientId
-export $CAMEL_VAULT_AZURE_CLIENT_SECRET=clientSecret
-export $CAMEL_VAULT_AZURE_VAULT_NAME=vaultName
-----
-
-You can also configure the credentials in the `application.properties` file such as:
-
-[source,properties]
-----
-camel.vault.azure.tenantId = accessKey
-camel.vault.azure.clientId = clientId
-camel.vault.azure.clientSecret = clientSecret
-camel.vault.azure.vaultName = vaultName
-----
-
-At this point you'll be able to reference a property in the following way:
-
-[source,xml]
-----
-<camelContext>
-    <route>
-        <from uri="direct:start"/>
-        <to uri="{{azure:route}}"/>
-    </route>
-</camelContext>
-----
-
-Where route will be the name of the secret stored in the Azure Key Vault Service.
-
-You could specify a default value in case the secret is not present on Azure Key Vault Service:
-
-[source,xml]
-----
-<camelContext>
-    <route>
-        <from uri="direct:start"/>
-        <to uri="{{azure:route:default}}"/>
-    </route>
-</camelContext>
-----
-
-In this case if the secret doesn't exist, the property will fallback to "default" as value.
-
-Also you are able to get particular field of the secret, if you have for example a secret named database of this form:
-
-[source,bash]
-----
-{
-  "username": "admin",
-  "password": "password123",
-  "engine": "postgres",
-  "host": "127.0.0.1",
-  "port": "3128",
-  "dbname": "db"
-}
-----
-
-You're able to do get single secret value in your route, like for example:
-
-[source,xml]
-----
-<camelContext>
-    <route>
-        <from uri="direct:start"/>
-        <log message="Username is {{azure:database/username}}"/>
-    </route>
-</camelContext>
-----
-
-Or re-use the property as part of an endpoint.
-
-You could specify a default value in case the particular field of secret is not present on Azure Key Vault:
-
-[source,xml]
-----
-<camelContext>
-    <route>
-        <from uri="direct:start"/>
-        <log message="Username is {{azure:database/username:admin}}"/>
-    </route>
-</camelContext>
-----
-
-In this case if the secret doesn't exist or the secret exists, but the username field is not part of the secret, the property will fallback to "admin" as value.
-
-For the moment we are not considering the rotation function, if any will be applied, but it is in the work to be done.
-
-The only requirement is adding the camel-azure-key-vault jar to your Camel application.
-
-// component headers: START
-include::partial$component-endpoint-headers.adoc[]
-// component headers: END
-
-=== Azure Key Vault Producer operations
-
-Azure Key Vault component provides the following operation on the producer side:
-
-- createSecret
-- getSecret
-- deleteSecret
-- purgeDeletedSecret
-
-== Examples
-
-=== Producer Examples
-
-- createSecret: this operation will create a secret in Azure Key Vault
-
-[source,java]
---------------------------------------------------------------------------------
-from("direct:createSecret")
-    .setHeader(KeyVaultConstants.SECRET_NAME, "Test")
-    .setBody(constant("Test"))
-    .to("azure-key-vault://test123?clientId=RAW({{clientId}})&clientSecret=RAW({{clientSecret}})&tenantId=RAW({{tenantId}})")
---------------------------------------------------------------------------------
-
-- getSecret: this operation will get a secret from Azure Key Vault
-
-[source,java]
---------------------------------------------------------------------------------
-from("direct:getSecret")
-    .setHeader(KeyVaultConstants.SECRET_NAME, "Test")
-    .to("azure-key-vault://test123?clientId=RAW({{clientId}})&clientSecret=RAW({{clientSecret}})&tenantId=RAW({{tenantId}})&operation=getSecret")
---------------------------------------------------------------------------------
-
-- deleteSecret: this operation will delete a Secret from Azure Key Vault
-
-[source,java]
---------------------------------------------------------------------------------
-from("direct:deleteSecret")
-    .setHeader(KeyVaultConstants.SECRET_NAME, "Test")
-    .to("azure-key-vault://test123?clientId=RAW({{clientId}})&clientSecret=RAW({{clientSecret}})&tenantId=RAW({{tenantId}})&operation=deleteSecret")
---------------------------------------------------------------------------------
-
-- purgeDeletedSecret: this operation will purge a deleted Secret from Azure Key Vault
-
-[source,java]
---------------------------------------------------------------------------------
-from("direct:purgeDeletedSecret")
-    .setHeader(KeyVaultConstants.SECRET_NAME, "Test")
-    .to("azure-key-vault://test123?clientId=RAW({{clientId}})&clientSecret=RAW({{clientSecret}})&tenantId=RAW({{tenantId}})&operation=purgeDeletedSecret")
---------------------------------------------------------------------------------
-
-include::spring-boot:partial$starter.adoc[]
diff --git a/components/camel-hashicorp-vault/src/main/docs/hashicorp-vault-component.adoc b/components/camel-hashicorp-vault/src/main/docs/hashicorp-vault-component.adoc
new file mode 100644
index 00000000000..7ab4d036f5a
--- /dev/null
+++ b/components/camel-hashicorp-vault/src/main/docs/hashicorp-vault-component.adoc
@@ -0,0 +1,44 @@
+= Hashicorp Vault Component
+:doctitle: Hashicorp Vault
+:shortname: hashicorp-vault
+:artifactid: camel-hashicorp-vault
+:description: Manage secrets and keys in Azure Key Vault Service
+:since: 3.18
+:supportlevel: Preview
+:component-header: Only producer is supported
+//Manually maintained attributes
+:group: Azure
+:camel-spring-boot-name: hashicorp-vault
+
+*Since Camel {since}*
+
+*{component-header}*
+
+The hashicorp-vault component that integrates https://www.vaultproject.io/[Hashicorp Vault]. 
+
+
+== URI Format
+
+[source,xml]
+------------------------------------------------------------
+<dependency>
+    <groupId>org.apache.camel</groupId>
+    <artifactId>camel-hashicorp-vault</artifactId>
+    <version>x.x.x</version>
+    <!-- use the same version as your Camel core version -->
+</dependency>
+------------------------------------------------------------
+
+
+// component-configure options: START
+
+// component-configure options: END
+
+// component options: START
+include::partial$component-configure-options.adoc[]
+include::partial$component-endpoint-options.adoc[]
+// component options: END
+
+// endpoint options: START
+
+// endpoint options: END


[camel] 03/05: CAMEL-17689 - Create a Camel Hashicorp Vault Component

Posted by ac...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

acosentino pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git

commit dd36972da237ba59afb6bd57ddd0028b0338fb09
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Wed Jun 8 14:01:31 2022 +0200

    CAMEL-17689 - Create a Camel Hashicorp Vault Component
---
 .../camel-hashicorp-vault/src/main/docs/hashicorp-vault-component.adoc  | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/components/camel-hashicorp-vault/src/main/docs/hashicorp-vault-component.adoc b/components/camel-hashicorp-vault/src/main/docs/hashicorp-vault-component.adoc
index 7ab4d036f5a..8f047d4dd48 100644
--- a/components/camel-hashicorp-vault/src/main/docs/hashicorp-vault-component.adoc
+++ b/components/camel-hashicorp-vault/src/main/docs/hashicorp-vault-component.adoc
@@ -2,7 +2,7 @@
 :doctitle: Hashicorp Vault
 :shortname: hashicorp-vault
 :artifactid: camel-hashicorp-vault
-:description: Manage secrets and keys in Azure Key Vault Service
+:description: Manage secrets in Hashicorp Vault Service
 :since: 3.18
 :supportlevel: Preview
 :component-header: Only producer is supported


[camel] 04/05: CAMEL-17689 - Create a Camel Hashicorp Vault Component - Added to kit

Posted by ac...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

acosentino pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git

commit 2cd2d1c372b5a57d83567f1d99356cdda6c48aec
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Wed Jun 8 14:03:29 2022 +0200

    CAMEL-17689 - Create a Camel Hashicorp Vault Component - Added to kit
---
 bom/camel-bom/pom.xml               | 5 +++++
 catalog/camel-allcomponents/pom.xml | 4 ++++
 components/pom.xml                  | 1 +
 parent/pom.xml                      | 5 +++++
 4 files changed, 15 insertions(+)

diff --git a/bom/camel-bom/pom.xml b/bom/camel-bom/pom.xml
index 264d992d07d..33f51b48f56 100644
--- a/bom/camel-bom/pom.xml
+++ b/bom/camel-bom/pom.xml
@@ -922,6 +922,11 @@
         <artifactId>camel-guava-eventbus</artifactId>
         <version>${project.version}</version>
       </dependency>
+      <dependency>
+        <groupId>org.apache.camel</groupId>
+        <artifactId>camel-hashicorp-vault</artifactId>
+        <version>${project.version}</version>
+      </dependency>
       <dependency>
         <groupId>org.apache.camel</groupId>
         <artifactId>camel-hazelcast</artifactId>
diff --git a/catalog/camel-allcomponents/pom.xml b/catalog/camel-allcomponents/pom.xml
index 4d4952915e5..cf9348f3c31 100644
--- a/catalog/camel-allcomponents/pom.xml
+++ b/catalog/camel-allcomponents/pom.xml
@@ -597,6 +597,10 @@
 			<groupId>org.apache.camel</groupId>
 			<artifactId>camel-hashicorp-vault</artifactId>
 		</dependency>
+		<dependency>
+			<groupId>org.apache.camel</groupId>
+			<artifactId>camel-hashicorp-vault</artifactId>
+		</dependency>
 		<dependency>
 			<groupId>org.apache.camel</groupId>
 			<artifactId>camel-hazelcast</artifactId>
diff --git a/components/pom.xml b/components/pom.xml
index bc71814e12f..89155d3bac8 100644
--- a/components/pom.xml
+++ b/components/pom.xml
@@ -160,6 +160,7 @@
         <module>camel-grpc</module>
         <module>camel-gson</module>
         <module>camel-guava-eventbus</module>
+        <module>camel-hashicorp-vault</module>
         <module>camel-hazelcast</module>
         <module>camel-hbase</module>
         <module>camel-hdfs</module>
diff --git a/parent/pom.xml b/parent/pom.xml
index 54e2ee70b07..497115729d0 100644
--- a/parent/pom.xml
+++ b/parent/pom.xml
@@ -1523,6 +1523,11 @@
 				<artifactId>camel-hashicorp-vault</artifactId>
 				<version>${project.version}</version>
 			</dependency>
+			<dependency>
+				<groupId>org.apache.camel</groupId>
+				<artifactId>camel-hashicorp-vault</artifactId>
+				<version>${project.version}</version>
+			</dependency>
 			<dependency>
 				<groupId>org.apache.camel</groupId>
 				<artifactId>camel-hazelcast</artifactId>