-
Notifications
You must be signed in to change notification settings - Fork 362
adding support to use a kms key for s3 buckets data encryption (AWS only) #2802
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
33 commits
Select commit
Hold shift + click to select a range
67fdaca
adding support to use a kms key for s3 buckets
fabio-rizzo-01 5cd4c4d
Update CHANGELOG.md
fabio-rizzo-01 7db0a87
Merge branch 'main' into feature/s3-kms-key
fabio-rizzo-01 cf4ec3e
Update CHANGELOG.md
fabio-rizzo-01 ffbe979
Update CHANGELOG.md
fabio-rizzo-01 5a0f3eb
fixing indentation issue
fabio-rizzo-01 708630c
fixing indentation issue
fabio-rizzo-01 3a10f7d
temporary changes to handle iceberg s3 properties
fabio-rizzo-01 543dabc
Merge remote-tracking branch 'private/feature/s3-kms-key' into featur…
fabio-rizzo-01 351dc07
Merge remote-tracking branch 'private/main-30-06' into feature/s3-kms…
fabio-rizzo-01 b8dad37
Merge remote-tracking branch 'private/main-30-06' into feature/s3-kms…
fabio-rizzo-01 6feb766
Merge remote-tracking branch 'private/main-30-06' into feature/s3-kms…
fabio-rizzo-01 d0907a1
removed s3 key table changes. added new properties for AwsStorageConf…
fabio-rizzo-01 e026c78
Merge remote-tracking branch 'private/main-30-06' into feature/s3-kms…
fabio-rizzo-01 7c33b55
removed s3 key table changes. added new properties for AwsStorageConf…
fabio-rizzo-01 65a84fb
removed s3 key table changes. added new properties for AwsStorageConf…
fabio-rizzo-01 b8bacb9
adding support to use a kms key for s3 buckets (#17)
fabio-rizzo-01 8850df1
fixed merge issue
fabio-rizzo-01 83115fd
Merge branch 'main-30-06' into feature/s3-kms-key
fabio-rizzo-01 b604568
Feature/s3 kms key (#18)
fabio-rizzo-01 d85e4cf
fixed issue that broke integration tests and updated code based on PR…
fabio-rizzo-01 420c509
Merge remote-tracking branch 'private/feature/s3-kms-key' into featur…
fabio-rizzo-01 a7d6413
adding support to use a kms key for s3 buckets (#17)
fabio-rizzo-01 e4c8260
Feature/s3 kms key (#18)
fabio-rizzo-01 ab5cdf0
Merge remote-tracking branch 'private/main-30-06' into main-30-06
fabio-rizzo-01 7192c2f
Merge remote-tracking branch 'private/main-30-06' into feature/s3-kms…
fabio-rizzo-01 4b2dcd3
fixed issue that broke integration tests and updated code based on PR…
fabio-rizzo-01 5da097a
Feature/s3 kms key (#19)
fabio-rizzo-01 8bd5b74
adding support to use a kms key for s3 buckets (#17)
fabio-rizzo-01 8a1fe7e
Feature/s3 kms key (#18)
fabio-rizzo-01 5a60a69
Feature/s3 kms key (#19)
fabio-rizzo-01 2e882bf
Merge remote-tracking branch 'private/main-30-06' into main-30-06
fabio-rizzo-01 2addad4
Merge remote-tracking branch 'private/main-30-06' into feature/s3-kms…
fabio-rizzo-01 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 |
|---|---|---|
|
|
@@ -35,6 +35,7 @@ public class CatalogSerializationTest { | |
| private static final String TEST_LOCATION = "s3://test/"; | ||
| private static final String TEST_CATALOG_NAME = "test-catalog"; | ||
| private static final String TEST_ROLE_ARN = "arn:aws:iam::123456789012:role/test-role"; | ||
| private static final String KMS_KEY = "arn:aws:kms:us-east-1:012345678901:key/allowed-key-1"; | ||
|
|
||
| @BeforeEach | ||
| public void setUp() { | ||
|
|
@@ -70,6 +71,36 @@ public void testJsonFormat() throws JsonProcessingException { | |
| + "\"properties\":{\"default-base-location\":\"s3://test/\"}," | ||
| + "\"storageConfigInfo\":{" | ||
| + "\"roleArn\":\"arn:aws:iam::123456789012:role/test-role\"," | ||
| + "\"allowedKmsKeys\":[]," | ||
| + "\"pathStyleAccess\":false," | ||
| + "\"storageType\":\"S3\"," | ||
| + "\"allowedLocations\":[]" | ||
| + "}}"); | ||
| } | ||
|
|
||
| @Test | ||
| public void testJsonFormatWithKmsProperties() throws JsonProcessingException { | ||
| Catalog catalog = | ||
| new Catalog( | ||
| Catalog.TypeEnum.INTERNAL, | ||
| TEST_CATALOG_NAME, | ||
| new CatalogProperties(TEST_LOCATION), | ||
| AwsStorageConfigInfo.builder(StorageConfigInfo.StorageTypeEnum.S3) | ||
| .setRoleArn(TEST_ROLE_ARN) | ||
| .setCurrentKmsKey(KMS_KEY) | ||
| .build()); | ||
|
|
||
| String json = mapper.writeValueAsString(catalog); | ||
|
|
||
| assertThat(json) | ||
| .isEqualTo( | ||
| "{\"type\":\"INTERNAL\"," | ||
| + "\"name\":\"test-catalog\"," | ||
| + "\"properties\":{\"default-base-location\":\"s3://test/\"}," | ||
| + "\"storageConfigInfo\":{" | ||
| + "\"roleArn\":\"arn:aws:iam::123456789012:role/test-role\"," | ||
| + "\"currentKmsKey\":\"arn:aws:kms:us-east-1:012345678901:key/allowed-key-1\"," | ||
| + "\"allowedKmsKeys\":[]," | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could you make a separate test case for this? This "minimal" config is intended to test that older clients do not get new optional properties. |
||
| + "\"pathStyleAccess\":false," | ||
| + "\"storageType\":\"S3\"," | ||
| + "\"allowedLocations\":[]" | ||
|
|
||
This file contains hidden or 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 hidden or 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 hidden or 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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a bit of a concern, unfortunately. (Sorry, I did not notice it before because of the other test code changes).
This means old clients will see the new allowedKmsKeys and other new properties (after a server upgrade) even if they were not set in their catalogs... IMHO, it's a potential backward compatibility issue.
However, our history shows that the community might be ok with that kind of change.
From my POV, it would be preferable to avoid changes on the wire, if possible... Meaning that defaults on newly added properties should not be visible to old clients... WDYT?
If that is too cumbersome, I'd like some more reviewer to express their opinions whether exposing new properties by default is acceptable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder, why does
allowedKmsKeysshow up in the default config JSON? I believenullvalues are not serialized... Is it notnullby default? Could we make all new entriesnullby default to reduce impact to default data on the wire and handle thosenulls in java code?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The problem is the immutable class that sets them to empty collection by default , this only happens with collections, and I didn't want to touch those setting because they might cause a lot more changes.
IMHO i don't think seeing the empty field returned is a massive issue but I'll leave the judgment to you guys.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did a quick test with an old version of Polaris CLI, and it was able to create a non-KMS catalog without any errors reported.
I'm personally ok with this change.