xanderbailey commented on code in PR #3173:
URL: https://github.com/apache/iceberg-rust/pull/3173#discussion_r3957216213


##########
crates/kms/aws/src/config.rs:
##########
@@ -0,0 +1,147 @@
+// 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.
+
+use std::collections::HashMap;
+
+use aws_sdk_kms::types::{DataKeySpec, EncryptionAlgorithmSpec};
+use iceberg::{Error, ErrorKind, Result};
+
+/// Catalog property selecting an AWS profile.
+pub const AWS_PROFILE_NAME: &str = "profile_name";
+/// Catalog property selecting the AWS region.
+pub const AWS_REGION_NAME: &str = "region_name";
+/// Catalog property containing a static AWS access key ID.
+pub const AWS_ACCESS_KEY_ID: &str = "aws_access_key_id";
+/// Catalog property containing a static AWS secret access key.
+pub const AWS_SECRET_ACCESS_KEY: &str = "aws_secret_access_key";
+/// Catalog property containing a static AWS session token.
+pub const AWS_SESSION_TOKEN: &str = "aws_session_token";
+
+/// Catalog property overriding the AWS KMS service endpoint.
+pub const KMS_ENDPOINT: &str = "kms.endpoint";
+/// Catalog property selecting the AWS KMS encryption algorithm.
+pub const KMS_ENCRYPTION_ALGORITHM_SPEC: &str = 
"kms.encryption-algorithm-spec";
+/// Default AWS KMS encryption algorithm, matching Iceberg Java.
+pub const KMS_ENCRYPTION_ALGORITHM_SPEC_DEFAULT: &str = "SYMMETRIC_DEFAULT";
+/// Catalog property selecting the size of keys generated by AWS KMS.
+pub const KMS_DATA_KEY_SPEC: &str = "kms.data-key-spec";
+/// Default AWS KMS generated key size, matching Iceberg Java.
+pub const KMS_DATA_KEY_SPEC_DEFAULT: &str = "AES_256";
+
+#[derive(Clone)]
+pub(crate) struct AwsKmsConfig {
+    pub(crate) endpoint: Option<String>,
+    pub(crate) encryption_algorithm: EncryptionAlgorithmSpec,
+    pub(crate) data_key_spec: DataKeySpec,
+}
+
+impl AwsKmsConfig {
+    pub(crate) fn from_properties(properties: &HashMap<String, String>) -> 
Result<Self> {

Review Comment:
   Config macro will help you here I think



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to