You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2016/12/20 12:04:41 UTC

[2/2] camel git commit: Those options are secret

Those options are secret


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/28013696
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/28013696
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/28013696

Branch: refs/heads/camel-2.18.x
Commit: 280136969c251f672a60e213db0920f57901927f
Parents: ae018d1
Author: Claus Ibsen <da...@apache.org>
Authored: Tue Dec 20 13:03:58 2016 +0100
Committer: Claus Ibsen <da...@apache.org>
Committed: Tue Dec 20 13:04:25 2016 +0100

----------------------------------------------------------------------
 .../camel-twitter/src/main/docs/twitter-component.adoc      | 8 ++++----
 .../apache/camel/component/twitter/TwitterComponent.java    | 9 +++++++++
 .../camel/component/twitter/TwitterConfiguration.java       | 8 ++++----
 .../camel/component/twitter/UriConfigurationTest.java       | 4 ----
 4 files changed, 17 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/28013696/components/camel-twitter/src/main/docs/twitter-component.adoc
----------------------------------------------------------------------
diff --git a/components/camel-twitter/src/main/docs/twitter-component.adoc b/components/camel-twitter/src/main/docs/twitter-component.adoc
index d514a41..e63fcf8 100644
--- a/components/camel-twitter/src/main/docs/twitter-component.adoc
+++ b/components/camel-twitter/src/main/docs/twitter-component.adoc
@@ -159,10 +159,6 @@ The Twitter component supports 43 endpoint options which are listed below:
 |=======================================================================
 | Name | Group | Default | Java Type | Description
 | kind | common |  | String | *Required* What polling mode to use direct polling or event based. The event mode is only supported when the endpoint kind is event based.
-| accessToken | common |  | String | The access token. Can also be configured on the TwitterComponent level instead.
-| accessTokenSecret | common |  | String | The access secret. Can also be configured on the TwitterComponent level instead.
-| consumerKey | common |  | String | The consumer key. Can also be configured on the TwitterComponent level instead.
-| consumerSecret | common |  | String | The consumer secret. Can also be configured on the TwitterComponent level instead.
 | user | common |  | String | Username used for user timeline consumption direct message production etc.
 | bridgeErrorHandler | consumer | false | boolean | Allows for bridging the consumer to the Camel routing Error Handler which mean any exceptions occurred while the consumer is trying to pickup incoming messages or the likes will now be processed as a message and handled by the routing Error Handler. By default the consumer will use the org.apache.camel.spi.ExceptionHandler to deal with exceptions that will be logged at WARN/ERROR level and ignored.
 | sendEmptyMessageWhenIdle | consumer | false | boolean | If the polling consumer did not poll any files you can enable this option to send an empty message (no body) instead.
@@ -201,6 +197,10 @@ The Twitter component supports 43 endpoint options which are listed below:
 | httpProxyPassword | proxy |  | String | The http proxy password which can be used for the camel-twitter. Can also be configured on the TwitterComponent level instead.
 | httpProxyPort | proxy |  | Integer | The http proxy port which can be used for the camel-twitter. Can also be configured on the TwitterComponent level instead.
 | httpProxyUser | proxy |  | String | The http proxy user which can be used for the camel-twitter. Can also be configured on the TwitterComponent level instead.
+| accessToken | security |  | String | The access token. Can also be configured on the TwitterComponent level instead.
+| accessTokenSecret | security |  | String | The access secret. Can also be configured on the TwitterComponent level instead.
+| consumerKey | security |  | String | The consumer key. Can also be configured on the TwitterComponent level instead.
+| consumerSecret | security |  | String | The consumer secret. Can also be configured on the TwitterComponent level instead.
 |=======================================================================
 {% endraw %}
 // endpoint options: END

http://git-wip-us.apache.org/repos/asf/camel/blob/28013696/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/TwitterComponent.java
----------------------------------------------------------------------
diff --git a/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/TwitterComponent.java b/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/TwitterComponent.java
index 8551f7b..adc4f28 100644
--- a/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/TwitterComponent.java
+++ b/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/TwitterComponent.java
@@ -20,19 +20,28 @@ import java.util.Map;
 
 import org.apache.camel.Endpoint;
 import org.apache.camel.impl.UriEndpointComponent;
+import org.apache.camel.spi.Metadata;
 
 /**
  * Twitter component
  */
 public class TwitterComponent extends UriEndpointComponent {
 
+    @Metadata(label = "security", secret = true)
     private String consumerKey;
+    @Metadata(label = "security", secret = true)
     private String consumerSecret;
+    @Metadata(label = "security", secret = true)
     private String accessToken;
+    @Metadata(label = "security", secret = true)
     private String accessTokenSecret;
+    @Metadata(label = "proxy")
     private String httpProxyHost;
+    @Metadata(label = "proxy")
     private String httpProxyUser;
+    @Metadata(label = "proxy")
     private String httpProxyPassword;
+    @Metadata(label = "proxy")
     private Integer httpProxyPort;
 
     public TwitterComponent() {

http://git-wip-us.apache.org/repos/asf/camel/blob/28013696/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/TwitterConfiguration.java
----------------------------------------------------------------------
diff --git a/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/TwitterConfiguration.java b/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/TwitterConfiguration.java
index fb6388f..f184739 100644
--- a/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/TwitterConfiguration.java
+++ b/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/TwitterConfiguration.java
@@ -36,13 +36,13 @@ public class TwitterConfiguration {
     private String kind;
     @UriParam(label = "consumer", defaultValue = "direct", enums = "polling,direct,event")
     private EndpointType type = EndpointType.DIRECT;
-    @UriParam(secret = true)
+    @UriParam(label = "security", secret = true)
     private String accessToken;
-    @UriParam(secret = true)
+    @UriParam(label = "security", secret = true)
     private String accessTokenSecret;
-    @UriParam(secret = true)
+    @UriParam(label = "security", secret = true)
     private String consumerKey;
-    @UriParam(secret = true)
+    @UriParam(label = "security", secret = true)
     private String consumerSecret;
     @UriParam
     private String user;

http://git-wip-us.apache.org/repos/asf/camel/blob/28013696/components/camel-twitter/src/test/java/org/apache/camel/component/twitter/UriConfigurationTest.java
----------------------------------------------------------------------
diff --git a/components/camel-twitter/src/test/java/org/apache/camel/component/twitter/UriConfigurationTest.java b/components/camel-twitter/src/test/java/org/apache/camel/component/twitter/UriConfigurationTest.java
index 62d75ad..c4bcd9b 100644
--- a/components/camel-twitter/src/test/java/org/apache/camel/component/twitter/UriConfigurationTest.java
+++ b/components/camel-twitter/src/test/java/org/apache/camel/component/twitter/UriConfigurationTest.java
@@ -73,10 +73,6 @@ public class UriConfigurationTest extends Assert {
         ComponentConfiguration compConf = comp.createComponentConfiguration();
         String json = compConf.createParameterJsonSchema();
         assertNotNull(json);
-
-        // REVIST this comparison test may be sensitive to some changes.
-        assertTrue(json.contains("\"accessToken\": { \"kind\": \"parameter\", \"group\": \"common\", \"type\": \"string\""));
-        assertTrue(json.contains("\"consumerKey\": { \"kind\": \"parameter\", \"group\": \"common\", \"type\": \"string\""));
     }
 
     @Test