Skip to content

API, Core: Add table metadata keys for encryption #12927

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 8 commits into from
May 6, 2025

Conversation

rdblue
Copy link
Contributor

@rdblue rdblue commented Apr 28, 2025

This implements the spec changes from #12162.

It adds the encryption-keys list to TableMetadata that stores an EncryptedKey. The TableMetadata.Builder is updated with addEncryptionKey and removeEncryptionKey methods, along with corresponding REST protocol metadata updates. This also adds key-id to snapshot metadata.

*
* @return a string key ID
*/
default String keyId() {
Copy link
Contributor

Choose a reason for hiding this comment

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

would it make sense to name this encryptionKeyId as keyId might not be immediately obvious that it relates to encryption when browsing/reading the code

Copy link
Member

@RussellSpitzer RussellSpitzer Apr 30, 2025

Choose a reason for hiding this comment

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

didn't we call this encryptingKeyId in the spec proposal?

NVM we have this one as key-id

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't think that this is unclear and needs to be longer, but I'm open to making it encryptionKeyId if others think that it is.

Copy link
Member

Choose a reason for hiding this comment

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

I don't want to change it unless we change it in the spec as well

@@ -201,6 +201,14 @@ public static ByteBuffer getByteBufferOrNull(String property, JsonNode node) {
BaseEncoding.base16().decode(pNode.textValue().toUpperCase(Locale.ROOT)));
}

public static Map<String, String> getStringMapOrNull(String property, JsonNode node) {
Copy link
Contributor

Choose a reason for hiding this comment

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

would be good to test these new methods in TestJsonUtil

@rdblue rdblue force-pushed the encryption-add-table-metadata-keys branch from e09c590 to cc162e8 Compare May 5, 2025 21:39
@rdblue
Copy link
Contributor Author

rdblue commented May 5, 2025

Updated for review comments and to add tests that I didn't add in the initial push.

Copy link
Contributor

@nastra nastra left a comment

Choose a reason for hiding this comment

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

changes LGTM, I think we're only missing some tests for the new changes added in JsonUtil

@rdblue rdblue merged commit 92d89dc into apache:main May 6, 2025
43 checks passed
@rdblue
Copy link
Contributor Author

rdblue commented May 6, 2025

Thanks for reviewing, @nastra and @RussellSpitzer!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants