[
https://issues.apache.org/jira/browse/KAFKA-6886?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16495724#comment-16495724
]
ASF GitHub Bot commented on KAFKA-6886:
---
ewencp closed pull request #5068: KAFKA-6886 Externalize secrets from Connect
configs
URL: https://github.com/apache/kafka/pull/5068
This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:
As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):
diff --git a/checkstyle/suppressions.xml b/checkstyle/suppressions.xml
index ba48c38cb28..5bf69b6b65f 100644
--- a/checkstyle/suppressions.xml
+++ b/checkstyle/suppressions.xml
@@ -83,7 +83,7 @@
files="(KafkaConfigBackingStore|RequestResponseTest|WorkerSinkTaskTest).java"/>
+ files="(WorkerSinkTask|WorkerSourceTask).java"/>
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.kafka.common.config;
+
+/**
+ * A callback passed to {@link ConfigProvider} for subscribing to changes.
+ */
+public interface ConfigChangeCallback {
+
+/**
+ * Performs an action when configuration data changes.
+ *
+ * @param path the path at which the data resides
+ * @param data the configuration data
+ */
+void onChange(String path, ConfigData data);
+}
diff --git
a/clients/src/main/java/org/apache/kafka/common/config/ConfigData.java
b/clients/src/main/java/org/apache/kafka/common/config/ConfigData.java
new file mode 100644
index 000..2bd0ff6b06a
--- /dev/null
+++ b/clients/src/main/java/org/apache/kafka/common/config/ConfigData.java
@@ -0,0 +1,66 @@
+/*
+ * 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.kafka.common.config;
+
+import java.util.Map;
+
+/**
+ * Configuration data from a {@link ConfigProvider}.
+ */
+public class ConfigData {
+
+private final Map data;
+private final Long ttl;
+
+/**
+ * Creates a new ConfigData with the given data and TTL (in milliseconds).
+ *
+ * @param data a Map of key-value pairs
+ * @param ttl the time-to-live of the data in milliseconds, or null if
there is no TTL
+ */
+public ConfigData(Map data, Long ttl) {
+this.data = data;
+this.ttl = ttl;
+}
+
+/**
+ * Creates a new ConfigData with the given data.
+ *
+ * @param data a Map of key-value pairs
+ */
+public ConfigData(Map data) {
+this(data, null);
+}
+
+/**
+ * Returns the data.
+ *
+ * @return data a Map of key-value pairs
+ */
+public Map data() {
+return data;
+}
+
+/**
+ * Returns the TTL (in milliseconds).
+ *
+ * @return ttl the time-to-live (in milliseconds) of the data, or null if
there is no TTL
+ */
+public Long ttl() {
+return ttl;
+}
+}
diff --git
a/clients/src/main/java/org/apache/kafka/common/config/ConfigProvider.java
b/clients/src/main/java/org/apache/kafka/common/config/ConfigProvider.java
new file mode 100644
index 000..7133baaebd0
--- /dev/null
+++ b/clients/src/main/java/org/apache/kafka/common/config/ConfigProvider.java
@@ -0,0 +1,78 @@
+/*
+ * 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