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 2021/02/22 13:51:25 UTC
[camel] 01/04: CAMEL-16115 - Remove Camel-AWS-* components - AWS-KMS
This is an automated email from the ASF dual-hosted git repository.
acosentino pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git
commit e27631519778f2428c2130b8f52e44a921a57f36
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Mon Feb 22 14:35:15 2021 +0100
CAMEL-16115 - Remove Camel-AWS-* components - AWS-KMS
---
bom/camel-bom/pom.xml | 5 -
components/camel-aws-kms/pom.xml | 72 -----
.../component/aws/kms/KMSComponentConfigurer.java | 113 -------
.../component/aws/kms/KMSEndpointConfigurer.java | 97 ------
.../component/aws/kms/KMSEndpointUriFactory.java | 74 -----
.../services/org/apache/camel/component.properties | 7 -
.../services/org/apache/camel/component/aws-kms | 2 -
.../org/apache/camel/configurer/aws-kms-component | 2 -
.../org/apache/camel/configurer/aws-kms-endpoint | 2 -
.../org/apache/camel/urifactory/aws-kms-endpoint | 2 -
.../apache/camel/component/aws/kms/aws-kms.json | 52 ----
.../src/main/docs/aws-kms-component.adoc | 175 -----------
.../camel/component/aws/kms/KMSComponent.java | 82 -----
.../aws/kms/KMSComponentVerifierExtension.java | 91 ------
.../camel/component/aws/kms/KMSConfiguration.java | 165 ----------
.../camel/component/aws/kms/KMSConstants.java | 28 --
.../camel/component/aws/kms/KMSEndpoint.java | 123 --------
.../camel/component/aws/kms/KMSOperations.java | 27 --
.../camel/component/aws/kms/KMSProducer.java | 232 --------------
.../component/aws/kms/AmazonKMSClientMock.java | 345 ---------------------
.../aws/kms/KMSComponentClientRegistryTest.java | 72 -----
.../aws/kms/KMSComponentConfigurationTest.java | 69 -----
.../aws/kms/KMSComponentVerifierExtensionTest.java | 76 -----
.../component/aws/kms/KMSProducerSpringTest.java | 149 ---------
.../camel/component/aws/kms/KMSProducerTest.java | 175 -----------
.../src/test/resources/log4j2.properties | 28 --
.../aws/kms/KMSComponentSpringTest-context.xml | 60 ----
components/pom.xml | 1 -
core/camel-allcomponents/pom.xml | 4 -
parent/pom.xml | 5 -
30 files changed, 2335 deletions(-)
diff --git a/bom/camel-bom/pom.xml b/bom/camel-bom/pom.xml
index 16d7642..b0e35c8 100644
--- a/bom/camel-bom/pom.xml
+++ b/bom/camel-bom/pom.xml
@@ -173,11 +173,6 @@
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
- <artifactId>camel-aws-kms</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.camel</groupId>
<artifactId>camel-aws-s3</artifactId>
<version>${project.version}</version>
</dependency>
diff --git a/components/camel-aws-kms/pom.xml b/components/camel-aws-kms/pom.xml
deleted file mode 100644
index ad43c2c..0000000
--- a/components/camel-aws-kms/pom.xml
+++ /dev/null
@@ -1,72 +0,0 @@
-<?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.9.0-SNAPSHOT</version>
- </parent>
-
- <artifactId>camel-aws-kms</artifactId>
- <packaging>jar</packaging>
-
- <name>Camel :: AWS KMS (deprecated)</name>
- <description>A Camel Amazon KMS Web Service Component</description>
-
- <properties>
- <deprecatedSince>3.8.0</deprecatedSince>
- </properties>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.camel</groupId>
- <artifactId>camel-support</artifactId>
- </dependency>
- <dependency>
- <groupId>com.amazonaws</groupId>
- <artifactId>aws-java-sdk-kms</artifactId>
- <version>${aws-java-sdk-version}</version>
- </dependency>
-
- <!-- for testing -->
- <dependency>
- <groupId>org.junit.jupiter</groupId>
- <artifactId>junit-jupiter</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.camel</groupId>
- <artifactId>camel-test-spring-junit5</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.camel</groupId>
- <artifactId>camel-core-catalog</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.logging.log4j</groupId>
- <artifactId>log4j-slf4j-impl</artifactId>
- <scope>test</scope>
- </dependency>
- </dependencies>
-</project>
diff --git a/components/camel-aws-kms/src/generated/java/org/apache/camel/component/aws/kms/KMSComponentConfigurer.java b/components/camel-aws-kms/src/generated/java/org/apache/camel/component/aws/kms/KMSComponentConfigurer.java
deleted file mode 100644
index 430c37d..0000000
--- a/components/camel-aws-kms/src/generated/java/org/apache/camel/component/aws/kms/KMSComponentConfigurer.java
+++ /dev/null
@@ -1,113 +0,0 @@
-/* Generated by camel build tools - do NOT edit this file! */
-package org.apache.camel.component.aws.kms;
-
-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 KMSComponentConfigurer extends PropertyConfigurerSupport implements GeneratedPropertyConfigurer, PropertyConfigurerGetter {
-
- private org.apache.camel.component.aws.kms.KMSConfiguration getOrCreateConfiguration(KMSComponent target) {
- if (target.getConfiguration() == null) {
- target.setConfiguration(new org.apache.camel.component.aws.kms.KMSConfiguration());
- }
- return target.getConfiguration();
- }
-
- @Override
- public boolean configure(CamelContext camelContext, Object obj, String name, Object value, boolean ignoreCase) {
- KMSComponent target = (KMSComponent) obj;
- switch (ignoreCase ? name.toLowerCase() : name) {
- case "accesskey":
- case "accessKey": getOrCreateConfiguration(target).setAccessKey(property(camelContext, java.lang.String.class, value)); return true;
- case "autodiscoverclient":
- case "autoDiscoverClient": getOrCreateConfiguration(target).setAutoDiscoverClient(property(camelContext, boolean.class, value)); return true;
- case "autowiredenabled":
- case "autowiredEnabled": target.setAutowiredEnabled(property(camelContext, boolean.class, value)); return true;
- case "configuration": target.setConfiguration(property(camelContext, org.apache.camel.component.aws.kms.KMSConfiguration.class, value)); return true;
- case "kmsclient":
- case "kmsClient": getOrCreateConfiguration(target).setKmsClient(property(camelContext, com.amazonaws.services.kms.AWSKMS.class, value)); return true;
- case "lazystartproducer":
- case "lazyStartProducer": target.setLazyStartProducer(property(camelContext, boolean.class, value)); return true;
- case "operation": getOrCreateConfiguration(target).setOperation(property(camelContext, org.apache.camel.component.aws.kms.KMSOperations.class, value)); return true;
- case "proxyhost":
- case "proxyHost": getOrCreateConfiguration(target).setProxyHost(property(camelContext, java.lang.String.class, value)); return true;
- case "proxyport":
- case "proxyPort": getOrCreateConfiguration(target).setProxyPort(property(camelContext, java.lang.Integer.class, value)); return true;
- case "proxyprotocol":
- case "proxyProtocol": getOrCreateConfiguration(target).setProxyProtocol(property(camelContext, com.amazonaws.Protocol.class, value)); return true;
- case "region": getOrCreateConfiguration(target).setRegion(property(camelContext, java.lang.String.class, value)); return true;
- case "secretkey":
- case "secretKey": getOrCreateConfiguration(target).setSecretKey(property(camelContext, java.lang.String.class, value)); return true;
- default: return false;
- }
- }
-
- @Override
- public Class<?> getOptionType(String name, boolean ignoreCase) {
- switch (ignoreCase ? name.toLowerCase() : name) {
- case "accesskey":
- case "accessKey": return java.lang.String.class;
- case "autodiscoverclient":
- case "autoDiscoverClient": return boolean.class;
- case "autowiredenabled":
- case "autowiredEnabled": return boolean.class;
- case "configuration": return org.apache.camel.component.aws.kms.KMSConfiguration.class;
- case "kmsclient":
- case "kmsClient": return com.amazonaws.services.kms.AWSKMS.class;
- case "lazystartproducer":
- case "lazyStartProducer": return boolean.class;
- case "operation": return org.apache.camel.component.aws.kms.KMSOperations.class;
- case "proxyhost":
- case "proxyHost": return java.lang.String.class;
- case "proxyport":
- case "proxyPort": return java.lang.Integer.class;
- case "proxyprotocol":
- case "proxyProtocol": return com.amazonaws.Protocol.class;
- case "region": return java.lang.String.class;
- case "secretkey":
- case "secretKey": return java.lang.String.class;
- default: return null;
- }
- }
-
- @Override
- public Object getOptionValue(Object obj, String name, boolean ignoreCase) {
- KMSComponent target = (KMSComponent) obj;
- switch (ignoreCase ? name.toLowerCase() : name) {
- case "accesskey":
- case "accessKey": return getOrCreateConfiguration(target).getAccessKey();
- case "autodiscoverclient":
- case "autoDiscoverClient": return getOrCreateConfiguration(target).isAutoDiscoverClient();
- case "autowiredenabled":
- case "autowiredEnabled": return target.isAutowiredEnabled();
- case "configuration": return target.getConfiguration();
- case "kmsclient":
- case "kmsClient": return getOrCreateConfiguration(target).getKmsClient();
- case "lazystartproducer":
- case "lazyStartProducer": return target.isLazyStartProducer();
- case "operation": return getOrCreateConfiguration(target).getOperation();
- case "proxyhost":
- case "proxyHost": return getOrCreateConfiguration(target).getProxyHost();
- case "proxyport":
- case "proxyPort": return getOrCreateConfiguration(target).getProxyPort();
- case "proxyprotocol":
- case "proxyProtocol": return getOrCreateConfiguration(target).getProxyProtocol();
- case "region": return getOrCreateConfiguration(target).getRegion();
- case "secretkey":
- case "secretKey": return getOrCreateConfiguration(target).getSecretKey();
- default: return null;
- }
- }
-}
-
diff --git a/components/camel-aws-kms/src/generated/java/org/apache/camel/component/aws/kms/KMSEndpointConfigurer.java b/components/camel-aws-kms/src/generated/java/org/apache/camel/component/aws/kms/KMSEndpointConfigurer.java
deleted file mode 100644
index 617fd46..0000000
--- a/components/camel-aws-kms/src/generated/java/org/apache/camel/component/aws/kms/KMSEndpointConfigurer.java
+++ /dev/null
@@ -1,97 +0,0 @@
-/* Generated by camel build tools - do NOT edit this file! */
-package org.apache.camel.component.aws.kms;
-
-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 KMSEndpointConfigurer extends PropertyConfigurerSupport implements GeneratedPropertyConfigurer, PropertyConfigurerGetter {
-
- @Override
- public boolean configure(CamelContext camelContext, Object obj, String name, Object value, boolean ignoreCase) {
- KMSEndpoint target = (KMSEndpoint) obj;
- switch (ignoreCase ? name.toLowerCase() : name) {
- case "accesskey":
- case "accessKey": target.getConfiguration().setAccessKey(property(camelContext, java.lang.String.class, value)); return true;
- case "autodiscoverclient":
- case "autoDiscoverClient": target.getConfiguration().setAutoDiscoverClient(property(camelContext, boolean.class, value)); return true;
- case "kmsclient":
- case "kmsClient": target.getConfiguration().setKmsClient(property(camelContext, com.amazonaws.services.kms.AWSKMS.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.aws.kms.KMSOperations.class, value)); return true;
- case "proxyhost":
- case "proxyHost": target.getConfiguration().setProxyHost(property(camelContext, java.lang.String.class, value)); return true;
- case "proxyport":
- case "proxyPort": target.getConfiguration().setProxyPort(property(camelContext, java.lang.Integer.class, value)); return true;
- case "proxyprotocol":
- case "proxyProtocol": target.getConfiguration().setProxyProtocol(property(camelContext, com.amazonaws.Protocol.class, value)); return true;
- case "region": target.getConfiguration().setRegion(property(camelContext, java.lang.String.class, value)); return true;
- case "secretkey":
- case "secretKey": target.getConfiguration().setSecretKey(property(camelContext, java.lang.String.class, value)); return true;
- default: return false;
- }
- }
-
- @Override
- public Class<?> getOptionType(String name, boolean ignoreCase) {
- switch (ignoreCase ? name.toLowerCase() : name) {
- case "accesskey":
- case "accessKey": return java.lang.String.class;
- case "autodiscoverclient":
- case "autoDiscoverClient": return boolean.class;
- case "kmsclient":
- case "kmsClient": return com.amazonaws.services.kms.AWSKMS.class;
- case "lazystartproducer":
- case "lazyStartProducer": return boolean.class;
- case "operation": return org.apache.camel.component.aws.kms.KMSOperations.class;
- case "proxyhost":
- case "proxyHost": return java.lang.String.class;
- case "proxyport":
- case "proxyPort": return java.lang.Integer.class;
- case "proxyprotocol":
- case "proxyProtocol": return com.amazonaws.Protocol.class;
- case "region": return java.lang.String.class;
- case "secretkey":
- case "secretKey": return java.lang.String.class;
- default: return null;
- }
- }
-
- @Override
- public Object getOptionValue(Object obj, String name, boolean ignoreCase) {
- KMSEndpoint target = (KMSEndpoint) obj;
- switch (ignoreCase ? name.toLowerCase() : name) {
- case "accesskey":
- case "accessKey": return target.getConfiguration().getAccessKey();
- case "autodiscoverclient":
- case "autoDiscoverClient": return target.getConfiguration().isAutoDiscoverClient();
- case "kmsclient":
- case "kmsClient": return target.getConfiguration().getKmsClient();
- case "lazystartproducer":
- case "lazyStartProducer": return target.isLazyStartProducer();
- case "operation": return target.getConfiguration().getOperation();
- case "proxyhost":
- case "proxyHost": return target.getConfiguration().getProxyHost();
- case "proxyport":
- case "proxyPort": return target.getConfiguration().getProxyPort();
- case "proxyprotocol":
- case "proxyProtocol": return target.getConfiguration().getProxyProtocol();
- case "region": return target.getConfiguration().getRegion();
- case "secretkey":
- case "secretKey": return target.getConfiguration().getSecretKey();
- default: return null;
- }
- }
-}
-
diff --git a/components/camel-aws-kms/src/generated/java/org/apache/camel/component/aws/kms/KMSEndpointUriFactory.java b/components/camel-aws-kms/src/generated/java/org/apache/camel/component/aws/kms/KMSEndpointUriFactory.java
deleted file mode 100644
index dce8843..0000000
--- a/components/camel-aws-kms/src/generated/java/org/apache/camel/component/aws/kms/KMSEndpointUriFactory.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/* Generated by camel build tools - do NOT edit this file! */
-package org.apache.camel.component.aws.kms;
-
-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 KMSEndpointUriFactory extends org.apache.camel.support.component.EndpointUriFactorySupport implements EndpointUriFactory {
-
- private static final String BASE = ":label";
-
- private static final Set<String> PROPERTY_NAMES;
- private static final Set<String> SECRET_PROPERTY_NAMES;
- static {
- Set<String> props = new HashSet<>(11);
- props.add("autoDiscoverClient");
- props.add("proxyPort");
- props.add("kmsClient");
- props.add("lazyStartProducer");
- props.add("proxyProtocol");
- props.add("secretKey");
- props.add("accessKey");
- props.add("label");
- props.add("region");
- props.add("operation");
- props.add("proxyHost");
- PROPERTY_NAMES = Collections.unmodifiableSet(props);
- Set<String> secretProps = new HashSet<>(2);
- secretProps.add("secretKey");
- secretProps.add("accessKey");
- SECRET_PROPERTY_NAMES = Collections.unmodifiableSet(secretProps);
- }
-
- @Override
- public boolean isEnabled(String scheme) {
- return "aws-kms".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, "label", null, true, 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 boolean isLenientProperties() {
- return false;
- }
-}
-
diff --git a/components/camel-aws-kms/src/generated/resources/META-INF/services/org/apache/camel/component.properties b/components/camel-aws-kms/src/generated/resources/META-INF/services/org/apache/camel/component.properties
deleted file mode 100644
index 71f4276..0000000
--- a/components/camel-aws-kms/src/generated/resources/META-INF/services/org/apache/camel/component.properties
+++ /dev/null
@@ -1,7 +0,0 @@
-# Generated by camel build tools - do NOT edit this file!
-components=aws-kms
-groupId=org.apache.camel
-artifactId=camel-aws-kms
-version=3.9.0-SNAPSHOT
-projectName=Camel :: AWS KMS (deprecated)
-projectDescription=A Camel Amazon KMS Web Service Component
diff --git a/components/camel-aws-kms/src/generated/resources/META-INF/services/org/apache/camel/component/aws-kms b/components/camel-aws-kms/src/generated/resources/META-INF/services/org/apache/camel/component/aws-kms
deleted file mode 100644
index e25a667..0000000
--- a/components/camel-aws-kms/src/generated/resources/META-INF/services/org/apache/camel/component/aws-kms
+++ /dev/null
@@ -1,2 +0,0 @@
-# Generated by camel build tools - do NOT edit this file!
-class=org.apache.camel.component.aws.kms.KMSComponent
diff --git a/components/camel-aws-kms/src/generated/resources/META-INF/services/org/apache/camel/configurer/aws-kms-component b/components/camel-aws-kms/src/generated/resources/META-INF/services/org/apache/camel/configurer/aws-kms-component
deleted file mode 100644
index 6653107..0000000
--- a/components/camel-aws-kms/src/generated/resources/META-INF/services/org/apache/camel/configurer/aws-kms-component
+++ /dev/null
@@ -1,2 +0,0 @@
-# Generated by camel build tools - do NOT edit this file!
-class=org.apache.camel.component.aws.kms.KMSComponentConfigurer
diff --git a/components/camel-aws-kms/src/generated/resources/META-INF/services/org/apache/camel/configurer/aws-kms-endpoint b/components/camel-aws-kms/src/generated/resources/META-INF/services/org/apache/camel/configurer/aws-kms-endpoint
deleted file mode 100644
index fefbfad..0000000
--- a/components/camel-aws-kms/src/generated/resources/META-INF/services/org/apache/camel/configurer/aws-kms-endpoint
+++ /dev/null
@@ -1,2 +0,0 @@
-# Generated by camel build tools - do NOT edit this file!
-class=org.apache.camel.component.aws.kms.KMSEndpointConfigurer
diff --git a/components/camel-aws-kms/src/generated/resources/META-INF/services/org/apache/camel/urifactory/aws-kms-endpoint b/components/camel-aws-kms/src/generated/resources/META-INF/services/org/apache/camel/urifactory/aws-kms-endpoint
deleted file mode 100644
index a8def84..0000000
--- a/components/camel-aws-kms/src/generated/resources/META-INF/services/org/apache/camel/urifactory/aws-kms-endpoint
+++ /dev/null
@@ -1,2 +0,0 @@
-# Generated by camel build tools - do NOT edit this file!
-class=org.apache.camel.component.aws.kms.KMSEndpointUriFactory
diff --git a/components/camel-aws-kms/src/generated/resources/org/apache/camel/component/aws/kms/aws-kms.json b/components/camel-aws-kms/src/generated/resources/org/apache/camel/component/aws/kms/aws-kms.json
deleted file mode 100644
index c4efd40..0000000
--- a/components/camel-aws-kms/src/generated/resources/org/apache/camel/component/aws/kms/aws-kms.json
+++ /dev/null
@@ -1,52 +0,0 @@
-{
- "component": {
- "kind": "component",
- "name": "aws-kms",
- "title": "AWS Key Management Service (KMS)",
- "description": "Manage keys stored in AWS KMS instances.",
- "deprecated": true,
- "deprecatedSince": "3.8.0",
- "firstVersion": "2.21.0",
- "label": "cloud,messaging",
- "javaType": "org.apache.camel.component.aws.kms.KMSComponent",
- "supportLevel": "Stable",
- "groupId": "org.apache.camel",
- "artifactId": "camel-aws-kms",
- "version": "3.9.0-SNAPSHOT",
- "scheme": "aws-kms",
- "extendsScheme": "",
- "syntax": "aws-kms:label",
- "async": false,
- "api": false,
- "consumerOnly": false,
- "producerOnly": true,
- "lenientProperties": false
- },
- "componentProperties": {
- "autoDiscoverClient": { "kind": "property", "displayName": "Auto Discover Client", "group": "common", "label": "common", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "configurationClass": "org.apache.camel.component.aws.kms.KMSConfiguration", "configurationField": "configuration", "description": "Setting the autoDiscoverClient mechanism, if true, the component will look for a client instan [...]
- "accessKey": { "kind": "property", "displayName": "Access Key", "group": "producer", "label": "producer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": true, "configurationClass": "org.apache.camel.component.aws.kms.KMSConfiguration", "configurationField": "configuration", "description": "Amazon AWS Access Key" },
- "configuration": { "kind": "property", "displayName": "Configuration", "group": "producer", "label": "", "required": false, "type": "object", "javaType": "org.apache.camel.component.aws.kms.KMSConfiguration", "deprecated": false, "autowired": false, "secret": false, "description": "The Component configuration" },
- "kmsClient": { "kind": "property", "displayName": "Kms Client", "group": "producer", "label": "producer", "required": false, "type": "object", "javaType": "com.amazonaws.services.kms.AWSKMS", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.aws.kms.KMSConfiguration", "configurationField": "configuration", "description": "To use a existing configured AWS KMS as client" },
- "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 [...]
- "operation": { "kind": "property", "displayName": "Operation", "group": "producer", "label": "producer", "required": true, "type": "object", "javaType": "org.apache.camel.component.aws.kms.KMSOperations", "enum": [ "listKeys", "createKey", "disableKey", "scheduleKeyDeletion", "describeKey", "enableKey" ], "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.aws.kms.KMSConfiguration", "configurationField": " [...]
- "proxyHost": { "kind": "property", "displayName": "Proxy Host", "group": "producer", "label": "producer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.aws.kms.KMSConfiguration", "configurationField": "configuration", "description": "To define a proxy host when instantiating the KMS client" },
- "proxyPort": { "kind": "property", "displayName": "Proxy Port", "group": "producer", "label": "producer", "required": false, "type": "integer", "javaType": "java.lang.Integer", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.aws.kms.KMSConfiguration", "configurationField": "configuration", "description": "To define a proxy port when instantiating the KMS client" },
- "proxyProtocol": { "kind": "property", "displayName": "Proxy Protocol", "group": "producer", "label": "", "required": false, "type": "object", "javaType": "com.amazonaws.Protocol", "enum": [ "HTTP", "HTTPS" ], "deprecated": false, "autowired": false, "secret": false, "defaultValue": "HTTPS", "configurationClass": "org.apache.camel.component.aws.kms.KMSConfiguration", "configurationField": "configuration", "description": "To define a proxy protocol when instantiating the KMS client" },
- "region": { "kind": "property", "displayName": "Region", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.aws.kms.KMSConfiguration", "configurationField": "configuration", "description": "The region in which KMS client needs to work. When using this parameter, the configuration will expect the capitalized name of the region [...]
- "secretKey": { "kind": "property", "displayName": "Secret Key", "group": "producer", "label": "producer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": true, "configurationClass": "org.apache.camel.component.aws.kms.KMSConfiguration", "configurationField": "configuration", "description": "Amazon AWS Secret Key" },
- "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 [...]
- },
- "properties": {
- "label": { "kind": "path", "displayName": "Label", "group": "producer", "label": "", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.aws.kms.KMSConfiguration", "configurationField": "configuration", "description": "Logical name" },
- "autoDiscoverClient": { "kind": "parameter", "displayName": "Auto Discover Client", "group": "common", "label": "common", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "configurationClass": "org.apache.camel.component.aws.kms.KMSConfiguration", "configurationField": "configuration", "description": "Setting the autoDiscoverClient mechanism, if true, the component will look for a client insta [...]
- "accessKey": { "kind": "parameter", "displayName": "Access Key", "group": "producer", "label": "producer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": true, "configurationClass": "org.apache.camel.component.aws.kms.KMSConfiguration", "configurationField": "configuration", "description": "Amazon AWS Access Key" },
- "kmsClient": { "kind": "parameter", "displayName": "Kms Client", "group": "producer", "label": "producer", "required": false, "type": "object", "javaType": "com.amazonaws.services.kms.AWSKMS", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.aws.kms.KMSConfiguration", "configurationField": "configuration", "description": "To use a existing configured AWS KMS as client" },
- "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": true, "type": "object", "javaType": "org.apache.camel.component.aws.kms.KMSOperations", "enum": [ "listKeys", "createKey", "disableKey", "scheduleKeyDeletion", "describeKey", "enableKey" ], "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.aws.kms.KMSConfiguration", "configurationField": [...]
- "proxyHost": { "kind": "parameter", "displayName": "Proxy Host", "group": "producer", "label": "producer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.aws.kms.KMSConfiguration", "configurationField": "configuration", "description": "To define a proxy host when instantiating the KMS client" },
- "proxyPort": { "kind": "parameter", "displayName": "Proxy Port", "group": "producer", "label": "producer", "required": false, "type": "integer", "javaType": "java.lang.Integer", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.aws.kms.KMSConfiguration", "configurationField": "configuration", "description": "To define a proxy port when instantiating the KMS client" },
- "proxyProtocol": { "kind": "parameter", "displayName": "Proxy Protocol", "group": "producer", "label": "", "required": false, "type": "object", "javaType": "com.amazonaws.Protocol", "enum": [ "HTTP", "HTTPS" ], "deprecated": false, "autowired": false, "secret": false, "defaultValue": "HTTPS", "configurationClass": "org.apache.camel.component.aws.kms.KMSConfiguration", "configurationField": "configuration", "description": "To define a proxy protocol when instantiating the KMS client" },
- "region": { "kind": "parameter", "displayName": "Region", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.aws.kms.KMSConfiguration", "configurationField": "configuration", "description": "The region in which KMS client needs to work. When using this parameter, the configuration will expect the capitalized name of the region [...]
- "secretKey": { "kind": "parameter", "displayName": "Secret Key", "group": "producer", "label": "producer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": true, "configurationClass": "org.apache.camel.component.aws.kms.KMSConfiguration", "configurationField": "configuration", "description": "Amazon AWS Secret Key" }
- }
-}
diff --git a/components/camel-aws-kms/src/main/docs/aws-kms-component.adoc b/components/camel-aws-kms/src/main/docs/aws-kms-component.adoc
deleted file mode 100644
index 09aa3ea..0000000
--- a/components/camel-aws-kms/src/main/docs/aws-kms-component.adoc
+++ /dev/null
@@ -1,175 +0,0 @@
-[[aws-kms-component]]
-= AWS Key Management Service (KMS) Component (deprecated)
-:docTitle: AWS Key Management Service (KMS)
-:artifactId: camel-aws-kms
-:description: Manage keys stored in AWS KMS instances.
-:since: 2.21
-:supportLevel: Stable-deprecated
-:deprecated: *deprecated*
-:component-header: Only producer is supported
-include::{cq-version}@camel-quarkus:ROOT:partial$reference/components/aws-kms.adoc[opts=optional]
-//Manually maintained attributes
-:group: AWS
-
-*Since Camel {since}*
-
-*{component-header}*
-
-The KMS component supports the ability to work with keys stored in
-https://aws.amazon.com/kms/[AWS KMS] instances.
-
-Prerequisites
-
-You must have a valid Amazon Web Services developer account, and be
-signed up to use Amazon KMS. More information is available at
-https://aws.amazon.com/kms/[Amazon KMS].
-
-== URI Format
-
-[source,java]
--------------------------
-aws-kms://label[?options]
--------------------------
-
-You can append query options to the URI in the following format,
-?options=value&option2=value&...
-
-== URI Options
-
-
-// component options: START
-The AWS Key Management Service (KMS) component supports 12 options, which are listed below.
-
-
-
-[width="100%",cols="2,5,^1,2",options="header"]
-|===
-| Name | Description | Default | Type
-| *autoDiscoverClient* (common) | Setting the autoDiscoverClient mechanism, if true, the component will look for a client instance in the registry automatically otherwise it will skip that checking. | true | boolean
-| *accessKey* (producer) | Amazon AWS Access Key | | String
-| *configuration* (producer) | The Component configuration | | KMSConfiguration
-| *kmsClient* (producer) | To use a existing configured AWS KMS as client | | AWSKMS
-| *lazyStartProducer* (producer) | Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel's routing error handlers. Beware that when the first message is processed then creating and [...]
-| *operation* (producer) | *Required* The operation to perform. There are 6 enums and the value can be one of: listKeys, createKey, disableKey, scheduleKeyDeletion, describeKey, enableKey | | KMSOperations
-| *proxyHost* (producer) | To define a proxy host when instantiating the KMS client | | String
-| *proxyPort* (producer) | To define a proxy port when instantiating the KMS client | | Integer
-| *proxyProtocol* (producer) | To define a proxy protocol when instantiating the KMS client. There are 2 enums and the value can be one of: HTTP, HTTPS | HTTPS | Protocol
-| *region* (producer) | The region in which KMS client needs to work. When using this parameter, the configuration will expect the capitalized name of the region (for example AP_EAST_1) You'll need to use the name Regions.EU_WEST_1.name() | | String
-| *secretKey* (producer) | Amazon AWS Secret Key | | String
-| *autowiredEnabled* (advanced) | Whether autowiring is enabled. This is used for automatic autowiring options (the option must be marked as autowired) by looking up in the registry to find if there is a single instance of matching type, which then gets configured on the component. This can be used for automatic configuring JDBC data sources, JMS connection factories, AWS Clients, etc. | true | boolean
-|===
-// component options: END
-
-
-
-
-// endpoint options: START
-The AWS Key Management Service (KMS) endpoint is configured using URI syntax:
-
-----
-aws-kms:label
-----
-
-with the following path and query parameters:
-
-=== Path Parameters (1 parameters):
-
-
-[width="100%",cols="2,5,^1,2",options="header"]
-|===
-| Name | Description | Default | Type
-| *label* | *Required* Logical name | | String
-|===
-
-
-=== Query Parameters (10 parameters):
-
-
-[width="100%",cols="2,5,^1,2",options="header"]
-|===
-| Name | Description | Default | Type
-| *autoDiscoverClient* (common) | Setting the autoDiscoverClient mechanism, if true, the component will look for a client instance in the registry automatically otherwise it will skip that checking. | true | boolean
-| *accessKey* (producer) | Amazon AWS Access Key | | String
-| *kmsClient* (producer) | To use a existing configured AWS KMS as client | | AWSKMS
-| *lazyStartProducer* (producer) | Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel's routing error handlers. Beware that when the first message is processed then creating and [...]
-| *operation* (producer) | *Required* The operation to perform. There are 6 enums and the value can be one of: listKeys, createKey, disableKey, scheduleKeyDeletion, describeKey, enableKey | | KMSOperations
-| *proxyHost* (producer) | To define a proxy host when instantiating the KMS client | | String
-| *proxyPort* (producer) | To define a proxy port when instantiating the KMS client | | Integer
-| *proxyProtocol* (producer) | To define a proxy protocol when instantiating the KMS client. There are 2 enums and the value can be one of: HTTP, HTTPS | HTTPS | Protocol
-| *region* (producer) | The region in which KMS client needs to work. When using this parameter, the configuration will expect the capitalized name of the region (for example AP_EAST_1) You'll need to use the name Regions.EU_WEST_1.name() | | String
-| *secretKey* (producer) | Amazon AWS Secret Key | | String
-|===
-// endpoint options: END
-
-
-
-
-Required KMS component options
-
-You have to provide the amazonKmsClient in the
-Registry or your accessKey and secretKey to access
-the https://aws.amazon.com/kms/[Amazon KMS] service.
-
-== Usage
-
-=== Message headers evaluated by the KMS producer
-
-[width="100%",cols="10%,10%,80%",options="header",]
-|=======================================================================
-|Header |Type |Description
-
-|`CamelAwsKMSLimit` |`Integer` |The limit number of keys to return while performing a listKeys operation
-
-|`CamelAwsKMSOperation` |`String` |The operation we want to perform
-
-|`CamelAwsKMSDescription` |`String` |A key description to use while performing a createKey operation
-
-|`CamelAwsKMSKeyId` |`String` |The key Id
-|=======================================================================
-
-=== KMS Producer operations
-
-Camel-AWS KMS component provides the following operation on the producer side:
-
-- listKeys
-- createKey
-- disableKey
-- scheduleKeyDeletion
-- describeKey
-- enableKey
-
-== Producer Examples
-
-- listKeys: this operation will list the available keys in KMS
-
-[source,java]
---------------------------------------------------------------------------------
-from("direct:listKeys")
- .to("aws-kms://test?kmsClient=#amazonKmsClient&operation=listKeys")
---------------------------------------------------------------------------------
-
-== Automatic detection of AWSKMS client in registry
-
-The component is capable of detecting the presence of an AWSKMS bean into the registry.
-If it's the only instance of that type it will be used as client and you won't have to define it as uri parameter.
-This may be really useful for smarter configuration of the endpoint.
-
-Dependencies
-
-Maven users will need to add the following dependency to their pom.xml.
-
-*pom.xml*
-
-[source,xml]
----------------------------------------
-<dependency>
- <groupId>org.apache.camel</groupId>
- <artifactId>camel-aws-kms</artifactId>
- <version>${camel-version}</version>
-</dependency>
----------------------------------------
-
-where `$\{camel-version}` must be replaced by the actual version of Camel.
-
-
-include::camel-spring-boot::page$aws-kms-starter.adoc[]
diff --git a/components/camel-aws-kms/src/main/java/org/apache/camel/component/aws/kms/KMSComponent.java b/components/camel-aws-kms/src/main/java/org/apache/camel/component/aws/kms/KMSComponent.java
deleted file mode 100644
index c51439f..0000000
--- a/components/camel-aws-kms/src/main/java/org/apache/camel/component/aws/kms/KMSComponent.java
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
- * 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.aws.kms;
-
-import java.util.Map;
-import java.util.Set;
-
-import com.amazonaws.services.kms.AWSKMS;
-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;
-
-/**
- * For working with Amazon KMS.
- */
-@Component("aws-kms")
-public class KMSComponent extends DefaultComponent {
-
- @Metadata
- private KMSConfiguration configuration = new KMSConfiguration();
-
- public KMSComponent() {
- this(null);
- }
-
- public KMSComponent(CamelContext context) {
- super(context);
-
- registerExtension(new KMSComponentVerifierExtension());
- }
-
- @Override
- protected Endpoint createEndpoint(String uri, String remaining, Map<String, Object> parameters) throws Exception {
- KMSConfiguration configuration = this.configuration != null ? this.configuration.copy() : new KMSConfiguration();
-
- KMSEndpoint endpoint = new KMSEndpoint(uri, this, configuration);
- setProperties(endpoint, parameters);
- if (endpoint.getConfiguration().isAutoDiscoverClient()) {
- checkAndSetRegistryClient(configuration);
- }
- if (configuration.getKmsClient() == null
- && (configuration.getAccessKey() == null || configuration.getSecretKey() == null)) {
- throw new IllegalArgumentException("Amazon kms client or accessKey and secretKey must be specified");
- }
-
- return endpoint;
- }
-
- public KMSConfiguration getConfiguration() {
- return configuration;
- }
-
- /**
- * The Component configuration
- */
- public void setConfiguration(KMSConfiguration configuration) {
- this.configuration = configuration;
- }
-
- private void checkAndSetRegistryClient(KMSConfiguration configuration) {
- Set<AWSKMS> clients = getCamelContext().getRegistry().findByType(AWSKMS.class);
- if (clients.size() == 1) {
- configuration.setKmsClient(clients.stream().findFirst().get());
- }
- }
-}
diff --git a/components/camel-aws-kms/src/main/java/org/apache/camel/component/aws/kms/KMSComponentVerifierExtension.java b/components/camel-aws-kms/src/main/java/org/apache/camel/component/aws/kms/KMSComponentVerifierExtension.java
deleted file mode 100644
index 67bc3a5..0000000
--- a/components/camel-aws-kms/src/main/java/org/apache/camel/component/aws/kms/KMSComponentVerifierExtension.java
+++ /dev/null
@@ -1,91 +0,0 @@
-/*
- * 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.aws.kms;
-
-import java.util.Map;
-
-import com.amazonaws.SdkClientException;
-import com.amazonaws.auth.AWSCredentials;
-import com.amazonaws.auth.AWSCredentialsProvider;
-import com.amazonaws.auth.AWSStaticCredentialsProvider;
-import com.amazonaws.auth.BasicAWSCredentials;
-import com.amazonaws.regions.Regions;
-import com.amazonaws.services.kms.AWSKMS;
-import com.amazonaws.services.kms.AWSKMSClientBuilder;
-import org.apache.camel.component.extension.verifier.DefaultComponentVerifierExtension;
-import org.apache.camel.component.extension.verifier.ResultBuilder;
-import org.apache.camel.component.extension.verifier.ResultErrorBuilder;
-import org.apache.camel.component.extension.verifier.ResultErrorHelper;
-
-public class KMSComponentVerifierExtension extends DefaultComponentVerifierExtension {
-
- public KMSComponentVerifierExtension() {
- this("aws-kms");
- }
-
- public KMSComponentVerifierExtension(String scheme) {
- super(scheme);
- }
-
- // *********************************
- // Parameters validation
- // *********************************
-
- @Override
- protected Result verifyParameters(Map<String, Object> parameters) {
-
- ResultBuilder builder = ResultBuilder.withStatusAndScope(Result.Status.OK, Scope.PARAMETERS)
- .error(ResultErrorHelper.requiresOption("accessKey", parameters))
- .error(ResultErrorHelper.requiresOption("secretKey", parameters))
- .error(ResultErrorHelper.requiresOption("region", parameters));
-
- // Validate using the catalog
-
- super.verifyParametersAgainstCatalog(builder, parameters);
-
- return builder.build();
- }
-
- // *********************************
- // Connectivity validation
- // *********************************
-
- @Override
- protected Result verifyConnectivity(Map<String, Object> parameters) {
- ResultBuilder builder = ResultBuilder.withStatusAndScope(Result.Status.OK, Scope.CONNECTIVITY);
-
- try {
- KMSConfiguration configuration = setProperties(new KMSConfiguration(), parameters);
- AWSCredentials credentials = new BasicAWSCredentials(configuration.getAccessKey(), configuration.getSecretKey());
- AWSCredentialsProvider credentialsProvider = new AWSStaticCredentialsProvider(credentials);
- AWSKMS client = AWSKMSClientBuilder.standard().withCredentials(credentialsProvider)
- .withRegion(Regions.valueOf(configuration.getRegion())).build();
- client.listKeys();
- } catch (SdkClientException e) {
- ResultErrorBuilder errorBuilder
- = ResultErrorBuilder.withCodeAndDescription(VerificationError.StandardCode.AUTHENTICATION, e.getMessage())
- .detail("aws_kms_exception_message", e.getMessage())
- .detail(VerificationError.ExceptionAttribute.EXCEPTION_CLASS, e.getClass().getName())
- .detail(VerificationError.ExceptionAttribute.EXCEPTION_INSTANCE, e);
-
- builder.error(errorBuilder.build());
- } catch (Exception e) {
- builder.error(ResultErrorBuilder.withException(e).build());
- }
- return builder.build();
- }
-}
diff --git a/components/camel-aws-kms/src/main/java/org/apache/camel/component/aws/kms/KMSConfiguration.java b/components/camel-aws-kms/src/main/java/org/apache/camel/component/aws/kms/KMSConfiguration.java
deleted file mode 100644
index 5250333..0000000
--- a/components/camel-aws-kms/src/main/java/org/apache/camel/component/aws/kms/KMSConfiguration.java
+++ /dev/null
@@ -1,165 +0,0 @@
-/*
- * 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.aws.kms;
-
-import com.amazonaws.Protocol;
-import com.amazonaws.services.kms.AWSKMS;
-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;
-
-@UriParams
-public class KMSConfiguration implements Cloneable {
-
- @UriPath(description = "Logical name")
- @Metadata(required = true)
- private String label;
- @UriParam(label = "producer")
- private AWSKMS kmsClient;
- @UriParam(label = "producer", secret = true)
- private String accessKey;
- @UriParam(label = "producer", secret = true)
- private String secretKey;
- @UriParam(label = "producer")
- @Metadata(required = true)
- private KMSOperations operation;
- @UriParam(enums = "HTTP,HTTPS", defaultValue = "HTTPS")
- private Protocol proxyProtocol = Protocol.HTTPS;
- @UriParam(label = "producer")
- private String proxyHost;
- @UriParam(label = "producer")
- private Integer proxyPort;
- @UriParam
- private String region;
- @UriParam(label = "common", defaultValue = "true")
- private boolean autoDiscoverClient = true;
-
- public AWSKMS getKmsClient() {
- return kmsClient;
- }
-
- /**
- * To use a existing configured AWS KMS as client
- */
- public void setKmsClient(AWSKMS kmsClient) {
- this.kmsClient = kmsClient;
- }
-
- public String getAccessKey() {
- return accessKey;
- }
-
- /**
- * Amazon AWS Access Key
- */
- public void setAccessKey(String accessKey) {
- this.accessKey = accessKey;
- }
-
- public String getSecretKey() {
- return secretKey;
- }
-
- /**
- * Amazon AWS Secret Key
- */
- public void setSecretKey(String secretKey) {
- this.secretKey = secretKey;
- }
-
- public KMSOperations getOperation() {
- return operation;
- }
-
- /**
- * The operation to perform
- */
- public void setOperation(KMSOperations operation) {
- this.operation = operation;
- }
-
- public Protocol getProxyProtocol() {
- return proxyProtocol;
- }
-
- /**
- * To define a proxy protocol when instantiating the KMS client
- */
- public void setProxyProtocol(Protocol proxyProtocol) {
- this.proxyProtocol = proxyProtocol;
- }
-
- public String getProxyHost() {
- return proxyHost;
- }
-
- /**
- * To define a proxy host when instantiating the KMS client
- */
- public void setProxyHost(String proxyHost) {
- this.proxyHost = proxyHost;
- }
-
- public Integer getProxyPort() {
- return proxyPort;
- }
-
- /**
- * To define a proxy port when instantiating the KMS client
- */
- public void setProxyPort(Integer proxyPort) {
- this.proxyPort = proxyPort;
- }
-
- public String getRegion() {
- return region;
- }
-
- /**
- * The region in which KMS client needs to work. When using this parameter, the configuration will expect the
- * capitalized name of the region (for example AP_EAST_1) You'll need to use the name Regions.EU_WEST_1.name()
- */
- public void setRegion(String region) {
- this.region = region;
- }
-
- public boolean isAutoDiscoverClient() {
- return autoDiscoverClient;
- }
-
- /**
- * Setting the autoDiscoverClient mechanism, if true, the component will look for a client instance in the registry
- * automatically otherwise it will skip that checking.
- */
- public void setAutoDiscoverClient(boolean autoDiscoverClient) {
- this.autoDiscoverClient = autoDiscoverClient;
- }
-
- // *************************************************
- //
- // *************************************************
-
- public KMSConfiguration copy() {
- try {
- return (KMSConfiguration) super.clone();
- } catch (CloneNotSupportedException e) {
- throw new RuntimeCamelException(e);
- }
- }
-}
diff --git a/components/camel-aws-kms/src/main/java/org/apache/camel/component/aws/kms/KMSConstants.java b/components/camel-aws-kms/src/main/java/org/apache/camel/component/aws/kms/KMSConstants.java
deleted file mode 100644
index fb69fc0..0000000
--- a/components/camel-aws-kms/src/main/java/org/apache/camel/component/aws/kms/KMSConstants.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * 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.aws.kms;
-
-/**
- * Constants used in Camel AWS KMS module
- */
-public interface KMSConstants {
- String OPERATION = "CamelAwsKMSOperation";
- String LIMIT = "CamelAwsKMSLimit";
- String DESCRIPTION = "CamelAwsKMSDescription";
- String KEY_ID = "CamelAwsKMSKeyId";
- String PENDING_WINDOW_IN_DAYS = "CamelAwsKMSPendingWindowInDays";
-}
diff --git a/components/camel-aws-kms/src/main/java/org/apache/camel/component/aws/kms/KMSEndpoint.java b/components/camel-aws-kms/src/main/java/org/apache/camel/component/aws/kms/KMSEndpoint.java
deleted file mode 100644
index 1f5f0c1..0000000
--- a/components/camel-aws-kms/src/main/java/org/apache/camel/component/aws/kms/KMSEndpoint.java
+++ /dev/null
@@ -1,123 +0,0 @@
-/*
- * 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.aws.kms;
-
-import com.amazonaws.ClientConfiguration;
-import com.amazonaws.auth.AWSCredentials;
-import com.amazonaws.auth.AWSCredentialsProvider;
-import com.amazonaws.auth.AWSStaticCredentialsProvider;
-import com.amazonaws.auth.BasicAWSCredentials;
-import com.amazonaws.regions.Regions;
-import com.amazonaws.services.kms.AWSKMS;
-import com.amazonaws.services.kms.AWSKMSClientBuilder;
-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.ScheduledPollEndpoint;
-import org.apache.camel.util.ObjectHelper;
-
-/**
- * Manage keys stored in AWS KMS instances.
- */
-@UriEndpoint(firstVersion = "2.21.0", scheme = "aws-kms", title = "AWS Key Management Service (KMS)", syntax = "aws-kms:label",
- producerOnly = true, category = { Category.CLOUD, Category.MESSAGING })
-public class KMSEndpoint extends ScheduledPollEndpoint {
-
- private AWSKMS kmsClient;
-
- @UriParam
- private KMSConfiguration configuration;
-
- public KMSEndpoint(String uri, Component component, KMSConfiguration configuration) {
- super(uri, component);
- this.configuration = configuration;
- }
-
- @Override
- public Consumer createConsumer(Processor processor) throws Exception {
- throw new UnsupportedOperationException("You cannot receive messages from this endpoint");
- }
-
- @Override
- public Producer createProducer() throws Exception {
- return new KMSProducer(this);
- }
-
- @Override
- public void doStart() throws Exception {
- super.doStart();
-
- kmsClient = configuration.getKmsClient() != null ? configuration.getKmsClient() : createKMSClient();
- }
-
- @Override
- public void doStop() throws Exception {
- if (ObjectHelper.isEmpty(configuration.getKmsClient())) {
- if (kmsClient != null) {
- kmsClient.shutdown();
- }
- }
- super.doStop();
- }
-
- public KMSConfiguration getConfiguration() {
- return configuration;
- }
-
- public AWSKMS getKmsClient() {
- return kmsClient;
- }
-
- AWSKMS createKMSClient() {
- AWSKMS client = null;
- ClientConfiguration clientConfiguration = null;
- AWSKMSClientBuilder clientBuilder = null;
- boolean isClientConfigFound = false;
- if (ObjectHelper.isNotEmpty(configuration.getProxyHost()) && ObjectHelper.isNotEmpty(configuration.getProxyPort())) {
- clientConfiguration = new ClientConfiguration();
- clientConfiguration.setProxyProtocol(configuration.getProxyProtocol());
- clientConfiguration.setProxyHost(configuration.getProxyHost());
- clientConfiguration.setProxyPort(configuration.getProxyPort());
- isClientConfigFound = true;
- }
- if (configuration.getAccessKey() != null && configuration.getSecretKey() != null) {
- AWSCredentials credentials = new BasicAWSCredentials(configuration.getAccessKey(), configuration.getSecretKey());
- AWSCredentialsProvider credentialsProvider = new AWSStaticCredentialsProvider(credentials);
- if (isClientConfigFound) {
- clientBuilder = AWSKMSClientBuilder.standard().withClientConfiguration(clientConfiguration)
- .withCredentials(credentialsProvider);
- } else {
- clientBuilder = AWSKMSClientBuilder.standard().withCredentials(credentialsProvider);
- }
- } else {
- if (isClientConfigFound) {
- clientBuilder = AWSKMSClientBuilder.standard();
- } else {
- clientBuilder = AWSKMSClientBuilder.standard().withClientConfiguration(clientConfiguration);
- }
- }
- if (ObjectHelper.isNotEmpty(configuration.getRegion())) {
- clientBuilder = clientBuilder.withRegion(Regions.valueOf(configuration.getRegion()));
- }
- client = clientBuilder.build();
- return client;
- }
-}
diff --git a/components/camel-aws-kms/src/main/java/org/apache/camel/component/aws/kms/KMSOperations.java b/components/camel-aws-kms/src/main/java/org/apache/camel/component/aws/kms/KMSOperations.java
deleted file mode 100644
index 461ef9c..0000000
--- a/components/camel-aws-kms/src/main/java/org/apache/camel/component/aws/kms/KMSOperations.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * 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.aws.kms;
-
-public enum KMSOperations {
-
- listKeys,
- createKey,
- disableKey,
- scheduleKeyDeletion,
- describeKey,
- enableKey
-}
diff --git a/components/camel-aws-kms/src/main/java/org/apache/camel/component/aws/kms/KMSProducer.java b/components/camel-aws-kms/src/main/java/org/apache/camel/component/aws/kms/KMSProducer.java
deleted file mode 100644
index 888041f..0000000
--- a/components/camel-aws-kms/src/main/java/org/apache/camel/component/aws/kms/KMSProducer.java
+++ /dev/null
@@ -1,232 +0,0 @@
-/*
- * 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.aws.kms;
-
-import com.amazonaws.AmazonServiceException;
-import com.amazonaws.services.kms.AWSKMS;
-import com.amazonaws.services.kms.model.CreateKeyRequest;
-import com.amazonaws.services.kms.model.CreateKeyResult;
-import com.amazonaws.services.kms.model.DescribeKeyRequest;
-import com.amazonaws.services.kms.model.DescribeKeyResult;
-import com.amazonaws.services.kms.model.DisableKeyRequest;
-import com.amazonaws.services.kms.model.DisableKeyResult;
-import com.amazonaws.services.kms.model.EnableKeyRequest;
-import com.amazonaws.services.kms.model.EnableKeyResult;
-import com.amazonaws.services.kms.model.ListKeysRequest;
-import com.amazonaws.services.kms.model.ListKeysResult;
-import com.amazonaws.services.kms.model.ScheduleKeyDeletionRequest;
-import com.amazonaws.services.kms.model.ScheduleKeyDeletionResult;
-import org.apache.camel.Endpoint;
-import org.apache.camel.Exchange;
-import org.apache.camel.Message;
-import org.apache.camel.support.DefaultProducer;
-import org.apache.camel.util.ObjectHelper;
-import org.apache.camel.util.URISupport;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * A Producer which sends messages to the Amazon KMS Service <a href="http://aws.amazon.com/kms/">AWS KMS</a>
- */
-public class KMSProducer extends DefaultProducer {
-
- private static final Logger LOG = LoggerFactory.getLogger(KMSProducer.class);
-
- private transient String kmsProducerToString;
-
- public KMSProducer(Endpoint endpoint) {
- super(endpoint);
- }
-
- @Override
- public void process(Exchange exchange) throws Exception {
- switch (determineOperation(exchange)) {
- case listKeys:
- listKeys(getEndpoint().getKmsClient(), exchange);
- break;
- case createKey:
- createKey(getEndpoint().getKmsClient(), exchange);
- break;
- case disableKey:
- disableKey(getEndpoint().getKmsClient(), exchange);
- break;
- case enableKey:
- enableKey(getEndpoint().getKmsClient(), exchange);
- break;
- case scheduleKeyDeletion:
- scheduleKeyDeletion(getEndpoint().getKmsClient(), exchange);
- break;
- case describeKey:
- describeKey(getEndpoint().getKmsClient(), exchange);
- break;
- default:
- throw new IllegalArgumentException("Unsupported operation");
- }
- }
-
- private KMSOperations determineOperation(Exchange exchange) {
- KMSOperations operation = exchange.getIn().getHeader(KMSConstants.OPERATION, KMSOperations.class);
- if (operation == null) {
- operation = getConfiguration().getOperation();
- }
-
- if (ObjectHelper.isEmpty(operation)) {
- throw new IllegalArgumentException("Operation must be specified");
- }
- return operation;
- }
-
- protected KMSConfiguration getConfiguration() {
- return getEndpoint().getConfiguration();
- }
-
- @Override
- public String toString() {
- if (kmsProducerToString == null) {
- kmsProducerToString = "KMSProducer[" + URISupport.sanitizeUri(getEndpoint().getEndpointUri()) + "]";
- }
- return kmsProducerToString;
- }
-
- @Override
- public KMSEndpoint getEndpoint() {
- return (KMSEndpoint) super.getEndpoint();
- }
-
- private void listKeys(AWSKMS kmsClient, Exchange exchange) {
- ListKeysRequest request = new ListKeysRequest();
- if (ObjectHelper.isNotEmpty(exchange.getIn().getHeader(KMSConstants.LIMIT))) {
- int limit = exchange.getIn().getHeader(KMSConstants.LIMIT, Integer.class);
- request.withLimit(limit);
- }
- ListKeysResult result;
- try {
- result = kmsClient.listKeys(request);
- } catch (AmazonServiceException ase) {
- LOG.trace("List Keys command returned the error code {}", ase.getErrorCode());
- throw ase;
- }
- Message message = getMessageForResponse(exchange);
- message.setBody(result);
- }
-
- private void createKey(AWSKMS kmsClient, Exchange exchange) {
- CreateKeyRequest request = new CreateKeyRequest();
- if (ObjectHelper.isNotEmpty(exchange.getIn().getHeader(KMSConstants.DESCRIPTION))) {
- String description = exchange.getIn().getHeader(KMSConstants.DESCRIPTION, String.class);
- request.withDescription(description);
- }
- CreateKeyResult result;
- try {
- result = kmsClient.createKey(request);
- } catch (AmazonServiceException ase) {
- LOG.trace("Create Key command returned the error code {}", ase.getErrorCode());
- throw ase;
- }
- Message message = getMessageForResponse(exchange);
- message.setBody(result);
- }
-
- private void disableKey(AWSKMS kmsClient, Exchange exchange) {
- DisableKeyRequest request = new DisableKeyRequest();
- if (ObjectHelper.isNotEmpty(exchange.getIn().getHeader(KMSConstants.KEY_ID))) {
- String keyId = exchange.getIn().getHeader(KMSConstants.KEY_ID, String.class);
- request.withKeyId(keyId);
- } else {
- throw new IllegalArgumentException("Key Id must be specified");
- }
- DisableKeyResult result;
- try {
- result = kmsClient.disableKey(request);
- } catch (AmazonServiceException ase) {
- LOG.trace("Disable Key command returned the error code {}", ase.getErrorCode());
- throw ase;
- }
- Message message = getMessageForResponse(exchange);
- message.setBody(result);
- }
-
- private void scheduleKeyDeletion(AWSKMS kmsClient, Exchange exchange) {
- ScheduleKeyDeletionRequest request = new ScheduleKeyDeletionRequest();
- if (ObjectHelper.isNotEmpty(exchange.getIn().getHeader(KMSConstants.KEY_ID))) {
- String keyId = exchange.getIn().getHeader(KMSConstants.KEY_ID, String.class);
- request.withKeyId(keyId);
- } else {
- throw new IllegalArgumentException("Key Id must be specified");
- }
- if (ObjectHelper.isNotEmpty(exchange.getIn().getHeader(KMSConstants.PENDING_WINDOW_IN_DAYS))) {
- int pendingWindows = exchange.getIn().getHeader(KMSConstants.PENDING_WINDOW_IN_DAYS, Integer.class);
- request.withPendingWindowInDays(pendingWindows);
- }
- ScheduleKeyDeletionResult result;
- try {
- result = kmsClient.scheduleKeyDeletion(request);
- } catch (AmazonServiceException ase) {
- LOG.trace("Schedule Key Deletion command returned the error code {}", ase.getErrorCode());
- throw ase;
- }
- Message message = getMessageForResponse(exchange);
- message.setBody(result);
- }
-
- private void describeKey(AWSKMS kmsClient, Exchange exchange) {
- DescribeKeyRequest request = new DescribeKeyRequest();
- if (ObjectHelper.isNotEmpty(exchange.getIn().getHeader(KMSConstants.KEY_ID))) {
- String keyId = exchange.getIn().getHeader(KMSConstants.KEY_ID, String.class);
- request.withKeyId(keyId);
- } else {
- throw new IllegalArgumentException("Key Id must be specified");
- }
- DescribeKeyResult result;
- try {
- result = kmsClient.describeKey(request);
- } catch (AmazonServiceException ase) {
- LOG.trace("Describe Key command returned the error code {}", ase.getErrorCode());
- throw ase;
- }
- Message message = getMessageForResponse(exchange);
- message.setBody(result);
- }
-
- private void enableKey(AWSKMS kmsClient, Exchange exchange) {
- EnableKeyRequest request = new EnableKeyRequest();
- if (ObjectHelper.isNotEmpty(exchange.getIn().getHeader(KMSConstants.KEY_ID))) {
- String keyId = exchange.getIn().getHeader(KMSConstants.KEY_ID, String.class);
- request.withKeyId(keyId);
- } else {
- throw new IllegalArgumentException("Key Id must be specified");
- }
- EnableKeyResult result;
- try {
- result = kmsClient.enableKey(request);
- } catch (AmazonServiceException ase) {
- LOG.trace("Enable Key command returned the error code {}", ase.getErrorCode());
- throw ase;
- }
- Message message = getMessageForResponse(exchange);
- message.setBody(result);
- }
-
- public static Message getMessageForResponse(final Exchange exchange) {
- if (exchange.getPattern().isOutCapable()) {
- Message out = exchange.getOut();
- out.copyFrom(exchange.getIn());
- return out;
- }
- return exchange.getIn();
- }
-}
diff --git a/components/camel-aws-kms/src/test/java/org/apache/camel/component/aws/kms/AmazonKMSClientMock.java b/components/camel-aws-kms/src/test/java/org/apache/camel/component/aws/kms/AmazonKMSClientMock.java
deleted file mode 100644
index be77a66..0000000
--- a/components/camel-aws-kms/src/test/java/org/apache/camel/component/aws/kms/AmazonKMSClientMock.java
+++ /dev/null
@@ -1,345 +0,0 @@
-/*
- * 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.aws.kms;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import com.amazonaws.AmazonWebServiceRequest;
-import com.amazonaws.ResponseMetadata;
-import com.amazonaws.regions.Region;
-import com.amazonaws.services.kms.AbstractAWSKMS;
-import com.amazonaws.services.kms.model.CancelKeyDeletionRequest;
-import com.amazonaws.services.kms.model.CancelKeyDeletionResult;
-import com.amazonaws.services.kms.model.CreateAliasRequest;
-import com.amazonaws.services.kms.model.CreateAliasResult;
-import com.amazonaws.services.kms.model.CreateGrantRequest;
-import com.amazonaws.services.kms.model.CreateGrantResult;
-import com.amazonaws.services.kms.model.CreateKeyRequest;
-import com.amazonaws.services.kms.model.CreateKeyResult;
-import com.amazonaws.services.kms.model.DecryptRequest;
-import com.amazonaws.services.kms.model.DecryptResult;
-import com.amazonaws.services.kms.model.DeleteAliasRequest;
-import com.amazonaws.services.kms.model.DeleteAliasResult;
-import com.amazonaws.services.kms.model.DeleteImportedKeyMaterialRequest;
-import com.amazonaws.services.kms.model.DeleteImportedKeyMaterialResult;
-import com.amazonaws.services.kms.model.DescribeKeyRequest;
-import com.amazonaws.services.kms.model.DescribeKeyResult;
-import com.amazonaws.services.kms.model.DisableKeyRequest;
-import com.amazonaws.services.kms.model.DisableKeyResult;
-import com.amazonaws.services.kms.model.DisableKeyRotationRequest;
-import com.amazonaws.services.kms.model.DisableKeyRotationResult;
-import com.amazonaws.services.kms.model.EnableKeyRequest;
-import com.amazonaws.services.kms.model.EnableKeyResult;
-import com.amazonaws.services.kms.model.EnableKeyRotationRequest;
-import com.amazonaws.services.kms.model.EnableKeyRotationResult;
-import com.amazonaws.services.kms.model.EncryptRequest;
-import com.amazonaws.services.kms.model.EncryptResult;
-import com.amazonaws.services.kms.model.GenerateDataKeyRequest;
-import com.amazonaws.services.kms.model.GenerateDataKeyResult;
-import com.amazonaws.services.kms.model.GenerateDataKeyWithoutPlaintextRequest;
-import com.amazonaws.services.kms.model.GenerateDataKeyWithoutPlaintextResult;
-import com.amazonaws.services.kms.model.GenerateRandomRequest;
-import com.amazonaws.services.kms.model.GenerateRandomResult;
-import com.amazonaws.services.kms.model.GetKeyPolicyRequest;
-import com.amazonaws.services.kms.model.GetKeyPolicyResult;
-import com.amazonaws.services.kms.model.GetKeyRotationStatusRequest;
-import com.amazonaws.services.kms.model.GetKeyRotationStatusResult;
-import com.amazonaws.services.kms.model.GetParametersForImportRequest;
-import com.amazonaws.services.kms.model.GetParametersForImportResult;
-import com.amazonaws.services.kms.model.ImportKeyMaterialRequest;
-import com.amazonaws.services.kms.model.ImportKeyMaterialResult;
-import com.amazonaws.services.kms.model.KeyListEntry;
-import com.amazonaws.services.kms.model.KeyMetadata;
-import com.amazonaws.services.kms.model.ListAliasesRequest;
-import com.amazonaws.services.kms.model.ListAliasesResult;
-import com.amazonaws.services.kms.model.ListGrantsRequest;
-import com.amazonaws.services.kms.model.ListGrantsResult;
-import com.amazonaws.services.kms.model.ListKeyPoliciesRequest;
-import com.amazonaws.services.kms.model.ListKeyPoliciesResult;
-import com.amazonaws.services.kms.model.ListKeysRequest;
-import com.amazonaws.services.kms.model.ListKeysResult;
-import com.amazonaws.services.kms.model.ListResourceTagsRequest;
-import com.amazonaws.services.kms.model.ListResourceTagsResult;
-import com.amazonaws.services.kms.model.ListRetirableGrantsRequest;
-import com.amazonaws.services.kms.model.ListRetirableGrantsResult;
-import com.amazonaws.services.kms.model.PutKeyPolicyRequest;
-import com.amazonaws.services.kms.model.PutKeyPolicyResult;
-import com.amazonaws.services.kms.model.ReEncryptRequest;
-import com.amazonaws.services.kms.model.ReEncryptResult;
-import com.amazonaws.services.kms.model.RetireGrantRequest;
-import com.amazonaws.services.kms.model.RetireGrantResult;
-import com.amazonaws.services.kms.model.RevokeGrantRequest;
-import com.amazonaws.services.kms.model.RevokeGrantResult;
-import com.amazonaws.services.kms.model.ScheduleKeyDeletionRequest;
-import com.amazonaws.services.kms.model.ScheduleKeyDeletionResult;
-import com.amazonaws.services.kms.model.TagResourceRequest;
-import com.amazonaws.services.kms.model.TagResourceResult;
-import com.amazonaws.services.kms.model.UntagResourceRequest;
-import com.amazonaws.services.kms.model.UntagResourceResult;
-import com.amazonaws.services.kms.model.UpdateAliasRequest;
-import com.amazonaws.services.kms.model.UpdateAliasResult;
-import com.amazonaws.services.kms.model.UpdateKeyDescriptionRequest;
-import com.amazonaws.services.kms.model.UpdateKeyDescriptionResult;
-
-public class AmazonKMSClientMock extends AbstractAWSKMS {
-
- public AmazonKMSClientMock() {
- }
-
- @Override
- public void setEndpoint(String endpoint) {
- }
-
- @Override
- public void setRegion(Region region) {
- }
-
- @Override
- public CancelKeyDeletionResult cancelKeyDeletion(CancelKeyDeletionRequest cancelKeyDeletionRequest) {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public CreateAliasResult createAlias(CreateAliasRequest createAliasRequest) {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public CreateGrantResult createGrant(CreateGrantRequest createGrantRequest) {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public CreateKeyResult createKey(CreateKeyRequest createKeyRequest) {
- CreateKeyResult res = new CreateKeyResult();
- KeyMetadata metadata = new KeyMetadata();
- metadata.setKeyId("test");
- metadata.setEnabled(true);
- res.setKeyMetadata(metadata);
- return res;
- }
-
- @Override
- public CreateKeyResult createKey() {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public DecryptResult decrypt(DecryptRequest decryptRequest) {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public DeleteAliasResult deleteAlias(DeleteAliasRequest deleteAliasRequest) {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public DeleteImportedKeyMaterialResult deleteImportedKeyMaterial(
- DeleteImportedKeyMaterialRequest deleteImportedKeyMaterialRequest) {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public DescribeKeyResult describeKey(DescribeKeyRequest describeKeyRequest) {
- DescribeKeyResult res = new DescribeKeyResult();
- KeyMetadata metadata = new KeyMetadata();
- metadata.setEnabled(false);
- metadata.setDescription("MyCamelKey");
- metadata.setKeyId("test");
- res.setKeyMetadata(metadata);
- return res;
- }
-
- @Override
- public DisableKeyResult disableKey(DisableKeyRequest disableKeyRequest) {
- DisableKeyResult res = new DisableKeyResult();
- return res;
- }
-
- @Override
- public DisableKeyRotationResult disableKeyRotation(DisableKeyRotationRequest disableKeyRotationRequest) {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public EnableKeyResult enableKey(EnableKeyRequest enableKeyRequest) {
- EnableKeyResult res = new EnableKeyResult();
- return res;
- }
-
- @Override
- public EnableKeyRotationResult enableKeyRotation(EnableKeyRotationRequest enableKeyRotationRequest) {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public EncryptResult encrypt(EncryptRequest encryptRequest) {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public GenerateDataKeyResult generateDataKey(GenerateDataKeyRequest generateDataKeyRequest) {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public GenerateDataKeyWithoutPlaintextResult generateDataKeyWithoutPlaintext(
- GenerateDataKeyWithoutPlaintextRequest generateDataKeyWithoutPlaintextRequest) {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public GenerateRandomResult generateRandom(GenerateRandomRequest generateRandomRequest) {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public GenerateRandomResult generateRandom() {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public GetKeyPolicyResult getKeyPolicy(GetKeyPolicyRequest getKeyPolicyRequest) {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public GetKeyRotationStatusResult getKeyRotationStatus(GetKeyRotationStatusRequest getKeyRotationStatusRequest) {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public GetParametersForImportResult getParametersForImport(GetParametersForImportRequest getParametersForImportRequest) {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public ImportKeyMaterialResult importKeyMaterial(ImportKeyMaterialRequest importKeyMaterialRequest) {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public ListAliasesResult listAliases(ListAliasesRequest listAliasesRequest) {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public ListAliasesResult listAliases() {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public ListGrantsResult listGrants(ListGrantsRequest listGrantsRequest) {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public ListKeyPoliciesResult listKeyPolicies(ListKeyPoliciesRequest listKeyPoliciesRequest) {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public ListKeysResult listKeys(ListKeysRequest listKeysRequest) {
- ListKeysResult result = new ListKeysResult();
- List<KeyListEntry> keyList = new ArrayList<>();
- KeyListEntry kle = new KeyListEntry();
- kle.withKeyId("keyId");
- keyList.add(kle);
- result.setKeys(keyList);
- return result;
- }
-
- @Override
- public ListKeysResult listKeys() {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public ListResourceTagsResult listResourceTags(ListResourceTagsRequest listResourceTagsRequest) {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public ListRetirableGrantsResult listRetirableGrants(ListRetirableGrantsRequest listRetirableGrantsRequest) {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public PutKeyPolicyResult putKeyPolicy(PutKeyPolicyRequest putKeyPolicyRequest) {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public ReEncryptResult reEncrypt(ReEncryptRequest reEncryptRequest) {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public RetireGrantResult retireGrant(RetireGrantRequest retireGrantRequest) {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public RetireGrantResult retireGrant() {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public RevokeGrantResult revokeGrant(RevokeGrantRequest revokeGrantRequest) {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public ScheduleKeyDeletionResult scheduleKeyDeletion(ScheduleKeyDeletionRequest scheduleKeyDeletionRequest) {
- ScheduleKeyDeletionResult result = new ScheduleKeyDeletionResult();
- result.withKeyId("test");
- return result;
- }
-
- @Override
- public TagResourceResult tagResource(TagResourceRequest tagResourceRequest) {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public UntagResourceResult untagResource(UntagResourceRequest untagResourceRequest) {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public UpdateAliasResult updateAlias(UpdateAliasRequest updateAliasRequest) {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public UpdateKeyDescriptionResult updateKeyDescription(UpdateKeyDescriptionRequest updateKeyDescriptionRequest) {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public void shutdown() {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public ResponseMetadata getCachedResponseMetadata(AmazonWebServiceRequest request) {
- throw new UnsupportedOperationException();
- }
-
-}
diff --git a/components/camel-aws-kms/src/test/java/org/apache/camel/component/aws/kms/KMSComponentClientRegistryTest.java b/components/camel-aws-kms/src/test/java/org/apache/camel/component/aws/kms/KMSComponentClientRegistryTest.java
deleted file mode 100644
index 7f25297..0000000
--- a/components/camel-aws-kms/src/test/java/org/apache/camel/component/aws/kms/KMSComponentClientRegistryTest.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * 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.aws.kms;
-
-import org.apache.camel.test.junit5.CamelTestSupport;
-import org.junit.jupiter.api.Test;
-
-import static org.junit.jupiter.api.Assertions.assertNotNull;
-import static org.junit.jupiter.api.Assertions.assertNotSame;
-import static org.junit.jupiter.api.Assertions.assertSame;
-import static org.junit.jupiter.api.Assertions.assertThrows;
-
-public class KMSComponentClientRegistryTest extends CamelTestSupport {
-
- @Test
- public void createEndpointWithMinimalKMSClientConfiguration() throws Exception {
-
- AmazonKMSClientMock clientMock = new AmazonKMSClientMock();
- context.getRegistry().bind("amazonKmsClient", clientMock);
- KMSComponent component = context.getComponent("aws-kms", KMSComponent.class);
- KMSEndpoint endpoint = (KMSEndpoint) component.createEndpoint("aws-kms://TestDomain");
-
- assertNotNull(endpoint.getConfiguration().getKmsClient());
- }
-
- @Test
- public void createEndpointWithMinimalKMSClientMisconfiguration() throws Exception {
-
- KMSComponent component = context.getComponent("aws-kms", KMSComponent.class);
- assertThrows(IllegalArgumentException.class,
- () -> component.createEndpoint("aws-kms://TestDomain"));
- }
-
- @Test
- public void createEndpointWithAutoDiscoverClientFalse() throws Exception {
-
- AmazonKMSClientMock clientMock = new AmazonKMSClientMock();
- context.getRegistry().bind("amazonKmsClient", clientMock);
- KMSComponent component = context.getComponent("aws-kms", KMSComponent.class);
- KMSEndpoint endpoint = (KMSEndpoint) component
- .createEndpoint("aws-kms://TestDomain?accessKey=xxx&secretKey=yyy®ion=eu-west-1&autoDiscoverClient=false");
-
- assertNotSame(clientMock, endpoint.getConfiguration().getKmsClient());
- }
-
- @Test
- public void createEndpointWithAutoDiscoverClientTrue() throws Exception {
-
- AmazonKMSClientMock clientMock = new AmazonKMSClientMock();
- context.getRegistry().bind("amazonKmsClient", clientMock);
- KMSComponent component = context.getComponent("aws-kms", KMSComponent.class);
- KMSEndpoint endpoint
- = (KMSEndpoint) component.createEndpoint("aws-kms://TestDomain?accessKey=xxx&secretKey=yyy®ion=eu-west-1");
-
- assertNotNull(endpoint.getConfiguration().getKmsClient());
- assertSame(clientMock, endpoint.getConfiguration().getKmsClient());
- }
-}
diff --git a/components/camel-aws-kms/src/test/java/org/apache/camel/component/aws/kms/KMSComponentConfigurationTest.java b/components/camel-aws-kms/src/test/java/org/apache/camel/component/aws/kms/KMSComponentConfigurationTest.java
deleted file mode 100644
index ce80fce..0000000
--- a/components/camel-aws-kms/src/test/java/org/apache/camel/component/aws/kms/KMSComponentConfigurationTest.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * 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.aws.kms;
-
-import com.amazonaws.Protocol;
-import com.amazonaws.regions.Regions;
-import org.apache.camel.test.junit5.CamelTestSupport;
-import org.junit.jupiter.api.Test;
-
-import static org.junit.jupiter.api.Assertions.assertEquals;
-
-public class KMSComponentConfigurationTest extends CamelTestSupport {
-
- @Test
- public void createEndpointWithComponentElements() throws Exception {
- KMSComponent component = context.getComponent("aws-kms", KMSComponent.class);
- component.getConfiguration().setAccessKey("XXX");
- component.getConfiguration().setSecretKey("YYY");
- KMSEndpoint endpoint = (KMSEndpoint) component.createEndpoint("aws-kms://label");
-
- assertEquals("XXX", endpoint.getConfiguration().getAccessKey());
- assertEquals("YYY", endpoint.getConfiguration().getSecretKey());
- }
-
- @Test
- public void createEndpointWithComponentAndEndpointElements() throws Exception {
- KMSComponent component = context.getComponent("aws-kms", KMSComponent.class);
- component.getConfiguration().setAccessKey("XXX");
- component.getConfiguration().setSecretKey("YYY");
- component.getConfiguration().setRegion(Regions.US_WEST_1.toString());
- KMSEndpoint endpoint
- = (KMSEndpoint) component.createEndpoint("aws-kms://label?accessKey=xxxxxx&secretKey=yyyyy®ion=US_EAST_1");
-
- assertEquals("xxxxxx", endpoint.getConfiguration().getAccessKey());
- assertEquals("yyyyy", endpoint.getConfiguration().getSecretKey());
- assertEquals("US_EAST_1", endpoint.getConfiguration().getRegion());
- }
-
- @Test
- public void createEndpointWithComponentEndpointElementsAndProxy() throws Exception {
- KMSComponent component = context.getComponent("aws-kms", KMSComponent.class);
- component.getConfiguration().setAccessKey("XXX");
- component.getConfiguration().setSecretKey("YYY");
- component.getConfiguration().setRegion(Regions.US_WEST_1.toString());
- KMSEndpoint endpoint = (KMSEndpoint) component.createEndpoint(
- "aws-kms://label?accessKey=xxxxxx&secretKey=yyyyy®ion=US_EAST_1&proxyHost=localhost&proxyPort=9000&proxyProtocol=HTTP");
-
- assertEquals("xxxxxx", endpoint.getConfiguration().getAccessKey());
- assertEquals("yyyyy", endpoint.getConfiguration().getSecretKey());
- assertEquals("US_EAST_1", endpoint.getConfiguration().getRegion());
- assertEquals(Protocol.HTTP, endpoint.getConfiguration().getProxyProtocol());
- assertEquals("localhost", endpoint.getConfiguration().getProxyHost());
- assertEquals(Integer.valueOf(9000), endpoint.getConfiguration().getProxyPort());
- }
-}
diff --git a/components/camel-aws-kms/src/test/java/org/apache/camel/component/aws/kms/KMSComponentVerifierExtensionTest.java b/components/camel-aws-kms/src/test/java/org/apache/camel/component/aws/kms/KMSComponentVerifierExtensionTest.java
deleted file mode 100644
index b54ef36..0000000
--- a/components/camel-aws-kms/src/test/java/org/apache/camel/component/aws/kms/KMSComponentVerifierExtensionTest.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * 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.aws.kms;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import org.apache.camel.Component;
-import org.apache.camel.component.extension.ComponentVerifierExtension;
-import org.apache.camel.test.junit5.CamelTestSupport;
-import org.junit.jupiter.api.Test;
-
-import static org.junit.jupiter.api.Assertions.assertEquals;
-
-public class KMSComponentVerifierExtensionTest extends CamelTestSupport {
-
- // *************************************************
- // Tests (parameters)
- // *************************************************
- @Override
- public boolean isUseRouteBuilder() {
- return false;
- }
-
- @Test
- public void testParameters() throws Exception {
- Component component = context().getComponent("aws-kms");
-
- ComponentVerifierExtension verifier
- = component.getExtension(ComponentVerifierExtension.class).orElseThrow(IllegalStateException::new);
-
- Map<String, Object> parameters = new HashMap<>();
- parameters.put("secretKey", "l");
- parameters.put("accessKey", "k");
- parameters.put("region", "l");
- parameters.put("label", "test");
- parameters.put("operation", KMSOperations.listKeys);
-
- ComponentVerifierExtension.Result result = verifier.verify(ComponentVerifierExtension.Scope.PARAMETERS, parameters);
-
- assertEquals(ComponentVerifierExtension.Result.Status.OK, result.getStatus());
- }
-
- @Test
- public void testConnectivity() throws Exception {
- Component component = context().getComponent("aws-kms");
- ComponentVerifierExtension verifier
- = component.getExtension(ComponentVerifierExtension.class).orElseThrow(IllegalStateException::new);
-
- Map<String, Object> parameters = new HashMap<>();
- parameters.put("secretKey", "l");
- parameters.put("accessKey", "k");
- parameters.put("region", "US_EAST_1");
- parameters.put("label", "test");
- parameters.put("operation", KMSOperations.listKeys);
-
- ComponentVerifierExtension.Result result = verifier.verify(ComponentVerifierExtension.Scope.CONNECTIVITY, parameters);
-
- assertEquals(ComponentVerifierExtension.Result.Status.ERROR, result.getStatus());
- }
-
-}
diff --git a/components/camel-aws-kms/src/test/java/org/apache/camel/component/aws/kms/KMSProducerSpringTest.java b/components/camel-aws-kms/src/test/java/org/apache/camel/component/aws/kms/KMSProducerSpringTest.java
deleted file mode 100644
index 870e4ce..0000000
--- a/components/camel-aws-kms/src/test/java/org/apache/camel/component/aws/kms/KMSProducerSpringTest.java
+++ /dev/null
@@ -1,149 +0,0 @@
-/*
- * 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.aws.kms;
-
-import com.amazonaws.services.kms.model.CreateKeyResult;
-import com.amazonaws.services.kms.model.DescribeKeyResult;
-import com.amazonaws.services.kms.model.ListKeysResult;
-import com.amazonaws.services.kms.model.ScheduleKeyDeletionResult;
-import org.apache.camel.EndpointInject;
-import org.apache.camel.Exchange;
-import org.apache.camel.Processor;
-import org.apache.camel.component.mock.MockEndpoint;
-import org.apache.camel.test.spring.junit5.CamelSpringTestSupport;
-import org.junit.jupiter.api.Test;
-import org.springframework.context.support.ClassPathXmlApplicationContext;
-
-import static org.junit.jupiter.api.Assertions.assertEquals;
-import static org.junit.jupiter.api.Assertions.assertFalse;
-
-public class KMSProducerSpringTest extends CamelSpringTestSupport {
-
- @EndpointInject("mock:result")
- private MockEndpoint mock;
-
- @Test
- public void kmsListBrokersTest() throws Exception {
-
- mock.expectedMessageCount(1);
- Exchange exchange = template.request("direct:listKeys", new Processor() {
- @Override
- public void process(Exchange exchange) throws Exception {
- exchange.getIn().setHeader(KMSConstants.OPERATION, KMSOperations.listKeys);
- }
- });
-
- assertMockEndpointsSatisfied();
-
- ListKeysResult resultGet = (ListKeysResult) exchange.getIn().getBody();
- assertEquals(1, resultGet.getKeys().size());
- assertEquals("keyId", resultGet.getKeys().get(0).getKeyId());
- }
-
- @Test
- public void kmsCreateKeyTest() throws Exception {
-
- mock.expectedMessageCount(1);
- Exchange exchange = template.request("direct:createKey", new Processor() {
- @Override
- public void process(Exchange exchange) throws Exception {
- exchange.getIn().setHeader(KMSConstants.OPERATION, KMSOperations.createKey);
- }
- });
-
- assertMockEndpointsSatisfied();
-
- CreateKeyResult resultGet = (CreateKeyResult) exchange.getIn().getBody();
- assertEquals("test", resultGet.getKeyMetadata().getKeyId());
- assertEquals(true, resultGet.getKeyMetadata().isEnabled());
- }
-
- @Test
- public void kmsDisableKeyTest() throws Exception {
-
- mock.expectedMessageCount(1);
- template.request("direct:disableKey", new Processor() {
- @Override
- public void process(Exchange exchange) throws Exception {
- exchange.getIn().setHeader(KMSConstants.OPERATION, KMSOperations.disableKey);
- exchange.getIn().setHeader(KMSConstants.KEY_ID, "test");
- }
- });
-
- assertMockEndpointsSatisfied();
-
- }
-
- @Test
- public void kmsEnableKeyTest() throws Exception {
-
- mock.expectedMessageCount(1);
- template.request("direct:enableKey", new Processor() {
- @Override
- public void process(Exchange exchange) throws Exception {
- exchange.getIn().setHeader(KMSConstants.OPERATION, KMSOperations.enableKey);
- exchange.getIn().setHeader(KMSConstants.KEY_ID, "test");
- }
- });
-
- assertMockEndpointsSatisfied();
-
- }
-
- @Test
- public void kmsScheduleKeyDeletionTest() throws Exception {
-
- mock.expectedMessageCount(1);
- Exchange exchange = template.request("direct:scheduleDelete", new Processor() {
- @Override
- public void process(Exchange exchange) throws Exception {
- exchange.getIn().setHeader(KMSConstants.OPERATION, KMSOperations.scheduleKeyDeletion);
- exchange.getIn().setHeader(KMSConstants.KEY_ID, "test");
- }
- });
-
- assertMockEndpointsSatisfied();
-
- ScheduleKeyDeletionResult resultGet = (ScheduleKeyDeletionResult) exchange.getIn().getBody();
- assertEquals("test", resultGet.getKeyId());
- }
-
- @Test
- public void kmsDescribeKeyTest() throws Exception {
-
- mock.expectedMessageCount(1);
- Exchange exchange = template.request("direct:describeKey", new Processor() {
- @Override
- public void process(Exchange exchange) throws Exception {
- exchange.getIn().setHeader(KMSConstants.OPERATION, KMSOperations.describeKey);
- exchange.getIn().setHeader(KMSConstants.KEY_ID, "test");
- }
- });
-
- assertMockEndpointsSatisfied();
-
- DescribeKeyResult resultGet = exchange.getIn().getBody(DescribeKeyResult.class);
- assertEquals("test", resultGet.getKeyMetadata().getKeyId());
- assertEquals("MyCamelKey", resultGet.getKeyMetadata().getDescription());
- assertFalse(resultGet.getKeyMetadata().isEnabled());
- }
-
- @Override
- protected ClassPathXmlApplicationContext createApplicationContext() {
- return new ClassPathXmlApplicationContext("org/apache/camel/component/aws/kms/KMSComponentSpringTest-context.xml");
- }
-}
diff --git a/components/camel-aws-kms/src/test/java/org/apache/camel/component/aws/kms/KMSProducerTest.java b/components/camel-aws-kms/src/test/java/org/apache/camel/component/aws/kms/KMSProducerTest.java
deleted file mode 100644
index a451f5d..0000000
--- a/components/camel-aws-kms/src/test/java/org/apache/camel/component/aws/kms/KMSProducerTest.java
+++ /dev/null
@@ -1,175 +0,0 @@
-/*
- * 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.aws.kms;
-
-import com.amazonaws.services.kms.model.CreateKeyResult;
-import com.amazonaws.services.kms.model.DescribeKeyResult;
-import com.amazonaws.services.kms.model.ListKeysResult;
-import com.amazonaws.services.kms.model.ScheduleKeyDeletionResult;
-import org.apache.camel.BindToRegistry;
-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.Test;
-
-import static org.junit.jupiter.api.Assertions.assertEquals;
-import static org.junit.jupiter.api.Assertions.assertFalse;
-
-public class KMSProducerTest extends CamelTestSupport {
-
- @BindToRegistry("amazonKmsClient")
- AmazonKMSClientMock clientMock = new AmazonKMSClientMock();
-
- @EndpointInject("mock:result")
- private MockEndpoint mock;
-
- @Test
- public void kmsListKeysTest() throws Exception {
-
- mock.expectedMessageCount(1);
- Exchange exchange = template.request("direct:listKeys", new Processor() {
- @Override
- public void process(Exchange exchange) throws Exception {
- exchange.getIn().setHeader(KMSConstants.OPERATION, KMSOperations.listKeys);
- }
- });
-
- assertMockEndpointsSatisfied();
-
- ListKeysResult resultGet = (ListKeysResult) exchange.getIn().getBody();
- assertEquals(1, resultGet.getKeys().size());
- assertEquals("keyId", resultGet.getKeys().get(0).getKeyId());
- }
-
- @Test
- public void kmsCreateKeyTest() throws Exception {
-
- mock.expectedMessageCount(1);
- Exchange exchange = template.request("direct:createKey", new Processor() {
- @Override
- public void process(Exchange exchange) throws Exception {
- exchange.getIn().setHeader(KMSConstants.OPERATION, KMSOperations.createKey);
- }
- });
-
- assertMockEndpointsSatisfied();
-
- CreateKeyResult resultGet = (CreateKeyResult) exchange.getIn().getBody();
- assertEquals("test", resultGet.getKeyMetadata().getKeyId());
- assertEquals(true, resultGet.getKeyMetadata().isEnabled());
- }
-
- @Test
- public void kmsDisableKeyTest() throws Exception {
-
- mock.expectedMessageCount(1);
- template.request("direct:disableKey", new Processor() {
- @Override
- public void process(Exchange exchange) throws Exception {
- exchange.getIn().setHeader(KMSConstants.OPERATION, KMSOperations.disableKey);
- exchange.getIn().setHeader(KMSConstants.KEY_ID, "test");
- }
- });
-
- assertMockEndpointsSatisfied();
-
- }
-
- @Test
- public void kmsEnableKeyTest() throws Exception {
-
- mock.expectedMessageCount(1);
- template.request("direct:enableKey", new Processor() {
- @Override
- public void process(Exchange exchange) throws Exception {
- exchange.getIn().setHeader(KMSConstants.OPERATION, KMSOperations.enableKey);
- exchange.getIn().setHeader(KMSConstants.KEY_ID, "test");
- }
- });
-
- assertMockEndpointsSatisfied();
-
- }
-
- @Test
- public void kmsScheduleKeyDeletionTest() throws Exception {
-
- mock.expectedMessageCount(1);
- Exchange exchange = template.request("direct:scheduleDelete", new Processor() {
- @Override
- public void process(Exchange exchange) throws Exception {
- exchange.getIn().setHeader(KMSConstants.OPERATION, KMSOperations.scheduleKeyDeletion);
- exchange.getIn().setHeader(KMSConstants.KEY_ID, "test");
- }
- });
-
- assertMockEndpointsSatisfied();
-
- ScheduleKeyDeletionResult resultGet = (ScheduleKeyDeletionResult) exchange.getIn().getBody();
- assertEquals("test", resultGet.getKeyId());
- }
-
- @Test
- public void kmsDescribeKeyTest() throws Exception {
-
- mock.expectedMessageCount(1);
- Exchange exchange = template.request("direct:describeKey", new Processor() {
- @Override
- public void process(Exchange exchange) throws Exception {
- exchange.getIn().setHeader(KMSConstants.OPERATION, KMSOperations.describeKey);
- exchange.getIn().setHeader(KMSConstants.KEY_ID, "test");
- }
- });
-
- assertMockEndpointsSatisfied();
-
- DescribeKeyResult resultGet = exchange.getIn().getBody(DescribeKeyResult.class);
- assertEquals("test", resultGet.getKeyMetadata().getKeyId());
- assertEquals("MyCamelKey", resultGet.getKeyMetadata().getDescription());
- assertFalse(resultGet.getKeyMetadata().isEnabled());
- }
-
- @Override
- protected RouteBuilder createRouteBuilder() throws Exception {
- return new RouteBuilder() {
- @Override
- public void configure() throws Exception {
- from("direct:listKeys")
- .to("aws-kms://test?kmsClient=#amazonKmsClient&operation=listKeys")
- .to("mock:result");
- from("direct:createKey")
- .to("aws-kms://test?kmsClient=#amazonKmsClient&operation=createKey")
- .to("mock:result");
- from("direct:disableKey")
- .to("aws-kms://test?kmsClient=#amazonKmsClient&operation=disableKey")
- .to("mock:result");
- from("direct:enableKey")
- .to("aws-kms://test?kmsClient=#amazonKmsClient&operation=enableKey")
- .to("mock:result");
- from("direct:scheduleDelete")
- .to("aws-kms://test?kmsClient=#amazonKmsClient&operation=scheduleKeyDeletion")
- .to("mock:result");
- from("direct:describeKey")
- .to("aws-kms://test?kmsClient=#amazonKmsClient&operation=describeKey")
- .to("mock:result");
- }
- };
- }
-}
diff --git a/components/camel-aws-kms/src/test/resources/log4j2.properties b/components/camel-aws-kms/src/test/resources/log4j2.properties
deleted file mode 100644
index 986f470..0000000
--- a/components/camel-aws-kms/src/test/resources/log4j2.properties
+++ /dev/null
@@ -1,28 +0,0 @@
-## ---------------------------------------------------------------------------
-## 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-aws-kms-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/components/camel-aws-kms/src/test/resources/org/apache/camel/component/aws/kms/KMSComponentSpringTest-context.xml b/components/camel-aws-kms/src/test/resources/org/apache/camel/component/aws/kms/KMSComponentSpringTest-context.xml
deleted file mode 100644
index 42eccfd..0000000
--- a/components/camel-aws-kms/src/test/resources/org/apache/camel/component/aws/kms/KMSComponentSpringTest-context.xml
+++ /dev/null
@@ -1,60 +0,0 @@
-<?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.
-
--->
-<beans xmlns="http://www.springframework.org/schema/beans"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="
- http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
- http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd">
-
- <camelContext id="camel" xmlns="http://camel.apache.org/schema/spring">
- <route>
- <from uri="direct:listKeys"/>
- <to uri="aws-kms://Test?kmsClient=#amazonKmsClient&operation=listKeys"/>
- <to uri="mock:result"/>
- </route>
- <route>
- <from uri="direct:createKey"/>
- <to uri="aws-kms://Test?kmsClient=#amazonKmsClient&operation=createKey"/>
- <to uri="mock:result"/>
- </route>
- <route>
- <from uri="direct:disableKey"/>
- <to uri="aws-kms://Test?kmsClient=#amazonKmsClient&operation=disableKey"/>
- <to uri="mock:result"/>
- </route>
- <route>
- <from uri="direct:enableKey"/>
- <to uri="aws-kms://Test?kmsClient=#amazonKmsClient&operation=enableKey"/>
- <to uri="mock:result"/>
- </route>
- <route>
- <from uri="direct:scheduleDelete"/>
- <to uri="aws-kms://Test?kmsClient=#amazonKmsClient&operation=scheduleKeyDeletion"/>
- <to uri="mock:result"/>
- </route>
- <route>
- <from uri="direct:describeKey"/>
- <to uri="aws-kms://Test?kmsClient=#amazonKmsClient&operation=describeKey"/>
- <to uri="mock:result"/>
- </route>
- </camelContext>
-
- <bean id="amazonKmsClient" class="org.apache.camel.component.aws.kms.AmazonKMSClientMock"/>
-</beans>
\ No newline at end of file
diff --git a/components/pom.xml b/components/pom.xml
index 95f29e4..3fd27cf 100644
--- a/components/pom.xml
+++ b/components/pom.xml
@@ -114,7 +114,6 @@
<module>camel-aws-eks</module>
<module>camel-aws-iam</module>
<module>camel-aws-kinesis</module>
- <module>camel-aws-kms</module>
<module>camel-aws-s3</module>
<module>camel-aws-swf</module>
<module>camel-aws2-athena</module>
diff --git a/core/camel-allcomponents/pom.xml b/core/camel-allcomponents/pom.xml
index 42623ac..926478a 100644
--- a/core/camel-allcomponents/pom.xml
+++ b/core/camel-allcomponents/pom.xml
@@ -139,10 +139,6 @@
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
- <artifactId>camel-aws-kms</artifactId>
- </dependency>
- <dependency>
- <groupId>org.apache.camel</groupId>
<artifactId>camel-aws-s3</artifactId>
</dependency>
<dependency>
diff --git a/parent/pom.xml b/parent/pom.xml
index 1c07b21..08f94c3 100644
--- a/parent/pom.xml
+++ b/parent/pom.xml
@@ -894,11 +894,6 @@
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
- <artifactId>camel-aws-kms</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.camel</groupId>
<artifactId>camel-aws-s3</artifactId>
<version>${project.version}</version>
</dependency>