shunping commented on code in PR #39806:
URL: https://github.com/apache/beam/pull/39806#discussion_r3807299395


##########
sdks/java/core/src/main/java/org/apache/beam/sdk/util/Secret.java:
##########
@@ -17,30 +17,75 @@
  */
 package org.apache.beam.sdk.util;
 
+import com.fasterxml.jackson.core.type.TypeReference;
+import com.fasterxml.jackson.databind.ObjectMapper;
 import java.io.Serializable;
-import java.util.Arrays;
+import java.nio.charset.StandardCharsets;
 import java.util.HashMap;
-import java.util.HashSet;
 import java.util.Map;
-import java.util.Set;
-import 
org.apache.beam.vendor.guava.v32_1_2_jre.com.google.common.base.Preconditions;
+import org.checkerframework.checker.nullness.qual.Nullable;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 /**
- * A secret management interface used for handling sensitive data.
+ * A secret management class used for handling sensitive data.
  *
- * <p>This interface provides a generic way to handle secrets. Implementations 
of this interface
- * should handle fetching secrets from a secret management system. The 
underlying secret management
- * system should be able to return a valid byte array representing the secret.
+ * <p>This class provides a generic way to handle secrets. Implementations of 
this class should
+ * handle fetching secrets from a secret management system. The underlying 
secret management system
+ * should be able to return a valid byte array representing the secret.
  */
-public interface Secret extends Serializable {
+public abstract class Secret implements Serializable {

Review Comment:
   Another way of doing this is to keep the Secret interface as not using 
cache, and then define a new abstract class `CachedSecret`.
   
   This gives people flexibility to implement their Secret provider if they 
don't want cache in the first place, but it also adds another class layer of 
complexity.
   
   It would be great to get a second opinion on this. 



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