forked from kroxylicious/kroxylicious
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
AWS KMS implementation (kroxylicious#1155)
* AWS KMS implementation and supporting unit and integration tests. Signed-off-by: kwall <[email protected]>
- Loading branch information
Showing
50 changed files
with
3,059 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
Copyright Kroxylicious Authors. | ||
Licensed under the Apache Software License version 2.0, available at http://www.apache.org/licenses/LICENSE-2.0 | ||
--> | ||
|
||
<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/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<parent> | ||
<groupId>io.kroxylicious</groupId> | ||
<artifactId>kroxylicious-parent</artifactId> | ||
<version>0.6.0-SNAPSHOT</version> | ||
<relativePath>../pom.xml</relativePath> | ||
</parent> | ||
|
||
<artifactId>kroxylicious-kms-provider-aws-kms-test-support</artifactId> | ||
|
||
<name>AWS KMS test support</name> | ||
<description>Test support code for modules testing the AWS KMS</description> | ||
|
||
<dependencies> | ||
<!-- project dependencies - runtime and compile --> | ||
<dependency> | ||
<groupId>io.kroxylicious</groupId> | ||
<artifactId>kroxylicious-kms</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>io.kroxylicious</groupId> | ||
<artifactId>kroxylicious-kms-provider-aws-kms</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>io.kroxylicious</groupId> | ||
<artifactId>kroxylicious-kms-test-support</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>io.kroxylicious</groupId> | ||
<artifactId>kroxylicious-api</artifactId> | ||
</dependency> | ||
|
||
<!-- third party dependencies - runtime and compile --> | ||
<dependency> | ||
<groupId>com.fasterxml.jackson.core</groupId> | ||
<artifactId>jackson-core</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>com.fasterxml.jackson.core</groupId> | ||
<artifactId>jackson-databind</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>com.fasterxml.jackson.core</groupId> | ||
<artifactId>jackson-annotations</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.slf4j</groupId> | ||
<artifactId>slf4j-api</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.testcontainers</groupId> | ||
<artifactId>testcontainers</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.testcontainers</groupId> | ||
<artifactId>localstack</artifactId> | ||
</dependency> | ||
<!-- third party dependencies - test --> | ||
<dependency> | ||
<groupId>org.assertj</groupId> | ||
<artifactId>assertj-core</artifactId> | ||
<scope>test</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.junit.jupiter</groupId> | ||
<artifactId>junit-jupiter-api</artifactId> | ||
<scope>test</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>com.github.spotbugs</groupId> | ||
<artifactId>spotbugs-annotations</artifactId> | ||
<scope>compile</scope> | ||
</dependency> | ||
</dependencies> | ||
</project> |
55 changes: 55 additions & 0 deletions
55
...pport/src/main/java/io/kroxylicious/kms/provider/aws/kms/AbstractAwsKmsTestKmsFacade.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
/* | ||
* Copyright Kroxylicious Authors. | ||
* | ||
* Licensed under the Apache Software License version 2.0, available at http://www.apache.org/licenses/LICENSE-2.0 | ||
*/ | ||
|
||
package io.kroxylicious.kms.provider.aws.kms; | ||
|
||
import java.net.URI; | ||
|
||
import io.kroxylicious.kms.provider.aws.kms.config.Config; | ||
import io.kroxylicious.kms.service.TestKmsFacade; | ||
import io.kroxylicious.proxy.config.secret.InlinePassword; | ||
|
||
import edu.umd.cs.findbugs.annotations.NonNull; | ||
|
||
public abstract class AbstractAwsKmsTestKmsFacade implements TestKmsFacade<Config, String, AwsKmsEdek> { | ||
|
||
protected AbstractAwsKmsTestKmsFacade() { | ||
} | ||
|
||
protected abstract void startKms(); | ||
|
||
protected abstract void stopKms(); | ||
|
||
@Override | ||
public final void start() { | ||
startKms(); | ||
} | ||
|
||
@NonNull | ||
protected abstract URI getAwsUrl(); | ||
|
||
@Override | ||
public final Config getKmsServiceConfig() { | ||
return new Config(getAwsUrl(), new InlinePassword(getAccessKey()), new InlinePassword(getSecretKey()), getRegion(), null); | ||
} | ||
|
||
protected abstract String getRegion(); | ||
|
||
protected abstract String getSecretKey(); | ||
|
||
protected abstract String getAccessKey(); | ||
|
||
@Override | ||
public final Class<AwsKmsService> getKmsServiceClass() { | ||
return AwsKmsService.class; | ||
} | ||
|
||
@Override | ||
public final void stop() { | ||
stopKms(); | ||
} | ||
|
||
} |
15 changes: 15 additions & 0 deletions
15
...rc/main/java/io/kroxylicious/kms/provider/aws/kms/AbstractAwsKmsTestKmsFacadeFactory.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
/* | ||
* Copyright Kroxylicious Authors. | ||
* | ||
* Licensed under the Apache Software License version 2.0, available at http://www.apache.org/licenses/LICENSE-2.0 | ||
*/ | ||
|
||
package io.kroxylicious.kms.provider.aws.kms; | ||
|
||
import io.kroxylicious.kms.provider.aws.kms.config.Config; | ||
import io.kroxylicious.kms.service.TestKmsFacadeFactory; | ||
|
||
public abstract class AbstractAwsKmsTestKmsFacadeFactory implements TestKmsFacadeFactory<Config, String, AwsKmsEdek> { | ||
@Override | ||
public abstract AbstractAwsKmsTestKmsFacade build(); | ||
} |
Oops, something went wrong.