amogh-jahagirdar commented on code in PR #13136: URL: https://github.com/apache/iceberg/pull/13136#discussion_r2134377764
########## aws/src/main/java/org/apache/iceberg/aws/AwsKeyManagementClient.java: ########## @@ -0,0 +1,107 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.iceberg.aws; + +import java.nio.ByteBuffer; +import java.util.Map; +import org.apache.iceberg.encryption.KeyManagementClient; +import software.amazon.awssdk.core.SdkBytes; +import software.amazon.awssdk.services.kms.KmsClient; +import software.amazon.awssdk.services.kms.model.DataKeySpec; +import software.amazon.awssdk.services.kms.model.DecryptRequest; +import software.amazon.awssdk.services.kms.model.DecryptResponse; +import software.amazon.awssdk.services.kms.model.EncryptRequest; +import software.amazon.awssdk.services.kms.model.EncryptResponse; +import software.amazon.awssdk.services.kms.model.EncryptionAlgorithmSpec; +import software.amazon.awssdk.services.kms.model.GenerateDataKeyRequest; +import software.amazon.awssdk.services.kms.model.GenerateDataKeyResponse; + +/** + * Key management client implementation that uses AWS Key Management Service. To be used for + * encrypting/decrypting keys with a KMS-managed master key, (by referencing its key ID), and for + * the generation of new encryption keys. + */ +public class AwsKeyManagementClient implements KeyManagementClient { Review Comment: I think this will need to be serializable so that it can be used in a distributed setting (since an `EncryptionManager` instance can also be serialized, and generally we'd expect an `EncryptionManager` to also contain an instance of `KeyManagementClient` ########## aws/src/main/java/org/apache/iceberg/aws/AwsProperties.java: ########## @@ -230,6 +243,8 @@ public class AwsProperties implements Serializable { private String restAccessKeyId; private String restSecretAccessKey; private String restSessionToken; + private String kmsEncryptionAlgorithmSpec; + private String kmsDataKeySpec; Review Comment: I think it would be better if these fields were the actual types, `EncryptionAlgorithmSpec` and `DataKeySpec` so that in case invalid values are configured, it fails in the constructor, instead of an accessor later on. ########## core/src/main/java/org/apache/iceberg/encryption/KeyManagementClient.java: ########## @@ -24,7 +24,7 @@ import java.util.Map; /** A minimum client interface to connect to a key management service (KMS). */ -interface KeyManagementClient extends Serializable, Closeable { +public interface KeyManagementClient extends Serializable, Closeable { Review Comment: I think this will necessarily need to be public so that implementations can reside in other modules, so I do agree with this change. It'd be good if @rdblue can confirm that or if some other implementation pattern was intended here. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org For additional commands, e-mail: issues-h...@iceberg.apache.org