Skip to content

chore: add ranged get tests#84

Closed
imabhichow wants to merge 55 commits into
fireegg-test-serversfrom
imabhichow/ranged-get
Closed

chore: add ranged get tests#84
imabhichow wants to merge 55 commits into
fireegg-test-serversfrom
imabhichow/ranged-get

Conversation

@imabhichow

Copy link
Copy Markdown

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.

@imabhichow imabhichow force-pushed the imabhichow/ranged-get branch from f4f0fcc to a58ef9a Compare November 13, 2025 07:17
Base automatically changed from imabhichow/java-test-server-v3 to fireegg-test-servers November 13, 2025 23:14
# Conflicts:
#	test-server/java-tests/src/it/java/software/amazon/encryption/s3/TestUtils.java
#	test-server/java-v3-transition-server/s3ec-staging
#	test-server/java-v3-transition-server/src/main/java/software/amazon/encryption/s3/CreateClientOperationImpl.java
#	test-server/java-v3-transition-server/src/main/java/software/amazon/encryption/s3/GetObjectOperationImpl.java
#	test-server/java-v4-server/s3ec-staging
#	test-server/java-v4-server/src/main/java/software/amazon/encryption/s3/CreateClientOperationImpl.java
#	test-server/java-v4-server/src/main/java/software/amazon/encryption/s3/GetObjectOperationImpl.java
@imabhichow imabhichow marked this pull request as ready for review November 14, 2025 00:24
.enableLegacyUnauthenticatedModes(true)
.enableLegacyWrappingAlgorithms(true)
.build())
.build());

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: we could had formatted it better.

.build());
String S3ECId = clientOutput.getClientId();

TestUtils.DecryptWithRangedGet(client, S3ECId, crossLanguageObjects, EncryptionAlgorithm.ALG_AES_256_GCM_IV12_TAG16_NO_KDF);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How do this work on languages that don't support RangeGets? I don't see any logic here to skip this test. I might be also missing something

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I found it in testutils, its with @MethodSource("software.amazon.encryption.s3.TestUtils#rangedGetTransitionClientsForTest") right?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I found it in testutils, its with @MethodSource("software.amazon.encryption.s3.TestUtils#rangedGetTransitionClientsForTest") right?

Yes

CreateClientOutput clientOutput = client.createClient(CreateClientInput.builder()
.config(S3ECConfig.builder()
.keyMaterial(kmsKeyArn)
.commitmentPolicy(CommitmentPolicy.FORBID_ENCRYPT_ALLOW_DECRYPT)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know its decryption but for these sets of test I want it to fail if its not object with committing alg.

Suggested change
.commitmentPolicy(CommitmentPolicy.FORBID_ENCRYPT_ALLOW_DECRYPT)
.commitmentPolicy(CommitmentPolicy.REQUIRE_ENCRYPT_REQUIRE_DECRYPT)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This and other similar places is imo blocking.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test case is trying to successfully decrypt the object using the transition client. For transition, Changing to non-defaults of transition client is invalid configuration, we only allow FORBID_ENCRYPT_ALLOW_DECRYPT and ALG_AES_256_GCM_IV12_TAG16_NO_KDF during client creation (atleast for java)

I think this test server should've already covered this test case of configuring transition clients with incompatible encryption algorithm and commitment policy.

@imabhichow imabhichow Nov 14, 2025

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've also added test case for improved_configured_with_require_encrypt_require_decrypt_should_fail_to_ranged_get_gcm non-committing objects in GCMTests.java

.config(S3ECConfig.builder()
.keyMaterial(kmsKeyArn)
.commitmentPolicy(CommitmentPolicy.FORBID_ENCRYPT_ALLOW_DECRYPT)
.encryptionAlgorithm(EncryptionAlgorithm.ALG_AES_256_GCM_IV12_TAG16_NO_KDF)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
.encryptionAlgorithm(EncryptionAlgorithm.ALG_AES_256_GCM_IV12_TAG16_NO_KDF)
.encryptionAlgorithm(EncryptionAlgorithm.ALG_AES_256_GCM_HKDF_SHA512_COMMIT_KEY)

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(same as above)

@imabhichow

Copy link
Copy Markdown
Author

Merged Changes in #103.

@imabhichow imabhichow closed this Dec 16, 2025
@imabhichow imabhichow deleted the imabhichow/ranged-get branch December 16, 2025 00:56
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