Skip to content

chore: add integration test and unit test #2139

Merged
rishav-karanjit merged 67 commits intoddbec-with-sdk-v2from
JCEKSKeyStore
Mar 19, 2026
Merged

chore: add integration test and unit test #2139
rishav-karanjit merged 67 commits intoddbec-with-sdk-v2from
JCEKSKeyStore

Conversation

@rishav-karanjit
Copy link
Member

Issue #, if available:

Description of changes:

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

This reverts commit 24a064f.
Add optional Map<String, String> materialDescription field with
@JsonProperty("material_description") to the Scenario inner class
in both sdkv1 and sdkv2 ScenarioManifest. This allows test scenarios
to specify a custom material description (e.g. AES/128) that gets
passed through to the KMS materials provider constructor.

Existing scenarios without this field will deserialize as null thanks
to @JsonIgnoreProperties(ignoreUnknown = true) on Scenario.
Add materialDescription parameter to createProvider() and use the
3-arg DirectKmsMaterialsProvider constructor when a non-empty
materialDescription is present. This enables scenarios that specify
a custom encryption algorithm (e.g. AES/128) via the scenario manifest.

Metastore provider calls pass null since metastores don't use custom
material descriptions. Main provider calls pass scenario.materialDescription.
…olisticIT

Add materialDescription parameter to createProvider() and use the
3-arg DirectKmsMaterialProvider constructor when a non-empty
materialDescription is present. All 8 call sites updated: metastore
provider calls pass null, main provider calls pass
scenario.materialDescription.

Mirrors the equivalent change in sdkv2 HolisticIT.
Add a new v1 scenario that uses the awskms provider with
material_description {"amzn-ddb-env-alg": "AES/128"} to test
encryption with a 128-bit content encryption key instead of the
default 256-bit. Points to a new ciphertext vector file
aws-kms-aes128-1.json (to be generated separately).
Add generateKmsAes128Vector() to sdkv2 HolisticIT as a disabled
(@test(enabled = false)) one-off test. When temporarily enabled, it:
1. Creates a DirectKmsMaterialsProvider with {amzn-ddb-env-alg: AES/128}
2. Encrypts standard test data (all 4 record types + HashKeyOnly + KeysOnly)
3. Prints the DynamoDB tables as JSON in the test vector format

To generate the vector file:
  1. Set enabled = true
  2. Run the test and capture stdout
  3. Save as ciphertext/java/aws-kms-aes128-1.json
  4. Set enabled = false again
Add aws-kms-aes128-1.json containing 13 TableName items (4 standard
record types + 9 KeysOnly) and 3 HashKeyOnly items, all encrypted
using DirectKmsMaterialsProvider with {amzn-ddb-env-alg: AES/128}.

Update the generator test to also write HashKeyOnly and KeysOnly
items (which generateStandardData does not produce), then disable
the generator (@test(enabled = false)) now that the vector is committed.
This reverts commit a374774.
When a scenario specifies material_description, verify that each
value (e.g. AES/128) appears in the *amzn-ddb-map-desc* blob of
every encrypted record in the ciphertext vector file. This proves
the ciphertext was actually encrypted with the claimed algorithm,
not just that the SDK can decrypt it.

Also restores scenarios.json to AES/128 (was temporarily changed
to AES/256 for manual verification).
This reverts commit f660950.
@github-actions
Copy link

Changes to the release files or the check-files action requires 2 approvals from CODEOWNERS

@github-actions
Copy link

Detected changes to the release files or to the check-files action

@github-actions
Copy link

Changes to the release files or the check-files action requires 2 approvals from CODEOWNERS

@github-actions
Copy link

Detected changes to the release files or to the check-files action

@github-actions
Copy link

Changes to the release files or the check-files action requires 2 approvals from CODEOWNERS

@github-actions
Copy link

Detected changes to the release files or to the check-files action

@github-actions
Copy link

Changes to the release files or the check-files action requires 2 approvals from CODEOWNERS

@github-actions
Copy link

Detected changes to the release files or to the check-files action

@github-actions
Copy link

Changes to the release files or the check-files action requires 2 approvals from CODEOWNERS

@rishav-karanjit rishav-karanjit changed the title JCKES Keystore chore: add integration test and unit test Mar 18, 2026
@rishav-karanjit rishav-karanjit marked this pull request as ready for review March 18, 2026 23:17
@rishav-karanjit rishav-karanjit requested a review from a team as a code owner March 18, 2026 23:17
Base automatically changed from directKMSmaterial to ddbec-with-sdk-v2 March 19, 2026 17:12
@github-actions
Copy link

Detected changes to the release files or to the check-files action

@github-actions
Copy link

Changes to the release files or the check-files action requires 2 approvals from CODEOWNERS

@github-actions
Copy link

Detected changes to the release files or to the check-files action

@github-actions
Copy link

Changes to the release files or the check-files action requires 2 approvals from CODEOWNERS

@rishav-karanjit rishav-karanjit merged commit 3cb8a96 into ddbec-with-sdk-v2 Mar 19, 2026
35 of 45 checks passed
@rishav-karanjit rishav-karanjit deleted the JCEKSKeyStore branch March 19, 2026 21:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants