Skip to content

Commit 035dbe3

Browse files
feat(java)!: add DDBEC with SDK v2 and remove DDBEC with SDK V1 (#2048)
BREAKING CHANGE: The AWS Database Encryption SDK for DynamoDB will NOT support AWS SDK for Java 1.x in the embedded 2.x version (which was known as DynamoDB Encryption Client(DDBEC)). The embedded DDBEC will now use AWS SDK for Java 2.x. These changes are limited to embedded DDBEC and rest of DB-ESDK has no code changes. If consumer of DB-ESDK is using APIs from namespace `com.amazonaws.services.dynamodbv2` through DB-ESDK then they have to migrate to use corresponding API from namespace `com.amazonaws.services.dynamodbv2.datamodeling.sdkv2`. If consumer of DB-ESDK are NOT using namespace `com.amazonaws.services.dynamodbv2` through DB-ESDK then there will not be any breaking change when moving to next major version.
1 parent 987aec6 commit 035dbe3

202 files changed

Lines changed: 10675 additions & 19385 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/ci_examples_java.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,7 @@ jobs:
113113
run: |
114114
# Run simple examples
115115
gradle -p runtimes/java/DynamoDbEncryption test
116+
gradle -p runtimes/java/DDBECwithSDKV2 test
116117
# Run migration examples
117118
gradle -p runtimes/java/Migration/PlaintextToAWSDBE test
118-
gradle -p runtimes/java/Migration/DDBECToAWSDBE test
119+
gradle -p runtimes/java/Migration/DDBECv2ToAWSDBE test

.github/workflows/dafny_interop_examples_java.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,4 +105,4 @@ jobs:
105105
gradle -p runtimes/java/DynamoDbEncryption test
106106
# Run migration examples
107107
gradle -p runtimes/java/Migration/PlaintextToAWSDBE test
108-
gradle -p runtimes/java/Migration/DDBECToAWSDBE test
108+
gradle -p runtimes/java/Migration/DDBECv2ToAWSDBE test

DynamoDbEncryption/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ Within `runtimes/java`:
2424
- `src/main/java` contains all hand written Java code, including externs.
2525
- `src/main/dafny-generated` contains all Dafny to Java transpiled code.
2626
- `src/main/smithy-generated` contains all Smithy to Java generated code.
27+
- `src/main/sdkv2` contains an embedded copy of the DynamoDB Encryption Client (DDBEC), which can be used as a standalone DDBEC or during migration from DDBEC to the DB-ESDK.
2728

2829
#### .NET
2930

DynamoDbEncryption/runtimes/java/build.gradle.kts

Lines changed: 26 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ plugins {
1212
`maven-publish`
1313
`signing`
1414
id("io.github.gradle-nexus.publish-plugin") version "2.0.0"
15+
`jacoco`
1516
}
1617

1718
var props = Properties().apply {
@@ -32,7 +33,7 @@ java {
3233
srcDir("src/main/java")
3334
srcDir("src/main/dafny-generated")
3435
srcDir("src/main/smithy-generated")
35-
srcDir("src/main/sdkv1")
36+
srcDir("src/main/sdkv2")
3637
}
3738
sourceSets["test"].java {
3839
srcDir("src/test")
@@ -90,15 +91,15 @@ dependencies {
9091

9192
testImplementation("org.junit.jupiter:junit-jupiter-api:5.11.4")
9293
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:5.11.4")
93-
94-
// For the DDB-EC v1
95-
implementation("com.amazonaws:aws-java-sdk-dynamodb:1.12.780")
94+
95+
// For the DDB-EC with SDK V2
96+
implementation("io.netty:netty-common:4.2.9.Final")
97+
98+
testImplementation("software.amazon.awssdk:url-connection-client:2.41.17")
9699
// https://mvnrepository.com/artifact/org.testng/testng
97100
testImplementation("org.testng:testng:7.5")
98101
// https://mvnrepository.com/artifact/com.amazonaws/DynamoDBLocal
99102
testImplementation("com.amazonaws:DynamoDBLocal:1.+")
100-
// This is where we gather the SQLLite files to copy over
101-
dynamodb("com.amazonaws:DynamoDBLocal:1.+")
102103
// As of 1.21.0 DynamoDBLocal does not support Apple Silicon
103104
// This checks the dependencies and adds a native library
104105
// to support this architecture.
@@ -221,6 +222,7 @@ tasks.test {
221222
}
222223
}
223224
})
225+
finalizedBy(tasks.jacocoTestCoverageVerification)
224226
}
225227

226228
tasks.register<JavaExec>("runTests") {
@@ -244,6 +246,24 @@ tasks.javadoc {
244246
exclude("src/main/dafny-generated")
245247
}
246248

249+
tasks.jacocoTestCoverageVerification {
250+
classDirectories.setFrom(
251+
fileTree("build/classes/java/main") {
252+
include("**/sdkv2/**")
253+
}
254+
)
255+
sourceDirectories.setFrom(
256+
files("src/main/sdkv2")
257+
)
258+
violationRules {
259+
rule {
260+
limit {
261+
minimum = "0.90".toBigDecimal()
262+
}
263+
}
264+
}
265+
}
266+
247267
nexusPublishing {
248268
// We are using the nexusPublishing plugin since it is recommended by Sonatype Gradle Project configurations
249269
// and it is easy to supply the creds we need to deploy

0 commit comments

Comments
 (0)