pulsar-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mme...@apache.org
Subject [pulsar] branch master updated: Expose Secrets in Source/SinkContext (#3717)
Date Thu, 07 Mar 2019 18:37:26 GMT
This is an automated email from the ASF dual-hosted git repository.

mmerli pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/pulsar.git


The following commit(s) were added to refs/heads/master by this push:
     new 1cf88cf  Expose Secrets in Source/SinkContext (#3717)
1cf88cf is described below

commit 1cf88cfcdd9d490220a1e0c87e1e55158a3b6e7d
Author: Sanjeev Kulkarni <sanjeevrk@gmail.com>
AuthorDate: Thu Mar 7 10:37:20 2019 -0800

    Expose Secrets in Source/SinkContext (#3717)
    
    * Expose Secrets in Source/SinkContext
    
    * Fix unittest
---
 .../core/src/main/java/org/apache/pulsar/io/core/SinkContext.java  | 7 +++++++
 .../src/main/java/org/apache/pulsar/io/core/SourceContext.java     | 7 +++++++
 .../org/apache/pulsar/io/kafka/sink/KafkaAbstractSinkTest.java     | 3 +++
 .../org/apache/pulsar/io/kafka/source/KafkaAbstractSourceTest.java | 3 +++
 4 files changed, 20 insertions(+)

diff --git a/pulsar-io/core/src/main/java/org/apache/pulsar/io/core/SinkContext.java b/pulsar-io/core/src/main/java/org/apache/pulsar/io/core/SinkContext.java
index 384302a..d30ff7b 100644
--- a/pulsar-io/core/src/main/java/org/apache/pulsar/io/core/SinkContext.java
+++ b/pulsar-io/core/src/main/java/org/apache/pulsar/io/core/SinkContext.java
@@ -74,4 +74,11 @@ public interface SinkContext {
      * @return the logger object
      */
     Logger getLogger();
+
+    /**
+     * Get the secret associated with this key
+     * @param secretName The name of the secret
+     * @return The secret if anything was found or null
+     */
+    String getSecret(String secretName);
 }
diff --git a/pulsar-io/core/src/main/java/org/apache/pulsar/io/core/SourceContext.java b/pulsar-io/core/src/main/java/org/apache/pulsar/io/core/SourceContext.java
index 201ff47..b758220 100644
--- a/pulsar-io/core/src/main/java/org/apache/pulsar/io/core/SourceContext.java
+++ b/pulsar-io/core/src/main/java/org/apache/pulsar/io/core/SourceContext.java
@@ -72,4 +72,11 @@ public interface SourceContext {
      * @return the logger object
      */
     Logger getLogger();
+
+    /**
+     * Get the secret associated with this key
+     * @param secretName The name of the secret
+     * @return The secret if anything was found or null
+     */
+    String getSecret(String secretName);
 }
diff --git a/pulsar-io/kafka/src/test/java/org/apache/pulsar/io/kafka/sink/KafkaAbstractSinkTest.java
b/pulsar-io/kafka/src/test/java/org/apache/pulsar/io/kafka/sink/KafkaAbstractSinkTest.java
index 2295820..9e74b89 100644
--- a/pulsar-io/kafka/src/test/java/org/apache/pulsar/io/kafka/sink/KafkaAbstractSinkTest.java
+++ b/pulsar-io/kafka/src/test/java/org/apache/pulsar/io/kafka/sink/KafkaAbstractSinkTest.java
@@ -112,6 +112,9 @@ public class KafkaAbstractSinkTest {
             public Logger getLogger() {
                 return null;
             }
+
+            @Override
+            public String getSecret(String key) { return null; }
         };
         ThrowingRunnable openAndClose = ()->{
             try {
diff --git a/pulsar-io/kafka/src/test/java/org/apache/pulsar/io/kafka/source/KafkaAbstractSourceTest.java
b/pulsar-io/kafka/src/test/java/org/apache/pulsar/io/kafka/source/KafkaAbstractSourceTest.java
index eadf3fc..2cee062 100644
--- a/pulsar-io/kafka/src/test/java/org/apache/pulsar/io/kafka/source/KafkaAbstractSourceTest.java
+++ b/pulsar-io/kafka/src/test/java/org/apache/pulsar/io/kafka/source/KafkaAbstractSourceTest.java
@@ -113,6 +113,9 @@ public class KafkaAbstractSourceTest {
             public Logger getLogger() {
                 return null;
             }
+
+            @Override
+            public String getSecret(String key) { return null; }
         };
         Map<String, Object> config = new HashMap<>();
         ThrowingRunnable openAndClose = ()->{


Mime
View raw message