Jzjsnow commented on code in PR #3396:
URL: https://github.com/apache/amoro/pull/3396#discussion_r1907078375


##########
amoro-common/src/main/java/org/apache/amoro/config/shade/utils/ConfigShadeUtils.java:
##########
@@ -0,0 +1,139 @@
+/*
+ * 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.amoro.config.shade.utils;
+
+import org.apache.amoro.config.ConfigOption;
+import org.apache.amoro.config.ConfigOptions;
+import org.apache.amoro.config.Configurations;
+import org.apache.amoro.config.shade.ConfigShade;
+import 
org.apache.amoro.shade.guava32.com.google.common.annotations.VisibleForTesting;
+import org.apache.amoro.shade.guava32.com.google.common.base.Preconditions;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.ServiceLoader;
+import java.util.function.BiFunction;
+
+/** Config shade utilities. */
+public final class ConfigShadeUtils {
+  private static final Logger LOG = 
LoggerFactory.getLogger(ConfigShadeUtils.class);
+
+  private static final Map<String, ConfigShade> CONFIG_SHADES = new 
HashMap<>();
+
+  private static final ConfigShade DEFAULT_SHADE = new DefaultConfigShade();
+
+  public static final ConfigOption<String> SHADE_IDENTIFIER_OPTION =
+      ConfigOptions.key("shade.identifier")
+          .stringType()
+          .defaultValue("default")
+          .withDescription(
+              "The identifier of the encryption method for decryption. 
Defaults to \"default\", indicating no encryption");
+
+  public static final ConfigOption<List<String>> SHADE_SENSITIVE_KEYWORDS =
+      ConfigOptions.key("shade.sensitive-keywords")
+          .stringType()
+          .asList()
+          .defaultValues("admin-password", "database.password")

Review Comment:
   Currently, the sensitive keywords are all in the `ams` part, so first I put 
the shade-related configurations under `ams` part and only decrypt the `ams` 
configurations . If in the future the containers also contain sensitive 
information, I think it may be necessary to put the shade-related 
configurations in a separate part, alongside the `ams` and `containers`.



-- 
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]

Reply via email to