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 2021/06/11 05:55:01 UTC

[camel] branch main updated: CAMEL-16708: camel-pubnub - Allow to configure security on component level

This is an automated email from the ASF dual-hosted git repository.

davsclaus pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git


The following commit(s) were added to refs/heads/main by this push:
     new 92d824d  CAMEL-16708: camel-pubnub - Allow to configure security on component level
92d824d is described below

commit 92d824d0ea0888b10e06604d90568f3a55f79958
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Fri Jun 11 07:53:13 2021 +0200

    CAMEL-16708: camel-pubnub - Allow to configure security on component level
---
 .../camel/catalog/docs/pubnub-component.adoc       |  12 +-
 .../pubnub/PubNubComponentConfigurer.java          |  55 +++++++
 .../org/apache/camel/component/pubnub/pubnub.json  |  12 +-
 .../src/main/docs/pubnub-component.adoc            |  12 +-
 .../camel/component/pubnub/PubNubComponent.java    |  22 ++-
 .../component/pubnub/PubNubConfiguration.java      |  24 +--
 .../component/pubnub/PubNubConfigurationTest.java  |   6 +-
 .../dsl/PubnubComponentBuilderFactory.java         | 178 +++++++++++++++++++++
 .../modules/ROOT/pages/pubnub-component.adoc       |  12 +-
 9 files changed, 310 insertions(+), 23 deletions(-)

diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/pubnub-component.adoc b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/pubnub-component.adoc
index 508c5b9..934c6ce 100644
--- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/pubnub-component.adoc
+++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/pubnub-component.adoc
@@ -52,16 +52,26 @@ Where *channel* is the PubNub channel to publish or subscribe to.
 
 
 // component options: START
-The PubNub component supports 3 options, which are listed below.
+The PubNub component supports 13 options, which are listed below.
 
 
 
 [width="100%",cols="2,5,^1,2",options="header"]
 |===
 | Name | Description | Default | Type
+| *configuration* (common) | The component configurations |  | PubNubConfiguration
+| *uuid* (common) | UUID to be used as a device identifier, a default UUID is generated if not passed. |  | String
 | *bridgeErrorHandler* (consumer) | 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 or ERROR level and ignored. | false | boolean
+| *withPresence* (consumer) | Also subscribe to related presence information | false | boolean
 | *lazyStartProducer* (producer) | Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel's routing error handlers. Beware that when the first message is processed then creating and [...]
+| *operation* (producer) | The operation to perform. PUBLISH: Default. Send a message to all subscribers of a channel. FIRE: allows the client to send a message to BLOCKS Event Handlers. These messages will go directly to any Event Handlers registered on the channel. HERENOW: Obtain information about the current state of a channel including a list of unique user-ids currently subscribed to the channel and the total occupancy count. WHERENOW: Obtain information about the current list of c [...]
 | *autowiredEnabled* (advanced) | Whether autowiring is enabled. This is used for automatic autowiring options (the option must be marked as autowired) by looking up in the registry to find if there is a single instance of matching type, which then gets configured on the component. This can be used for automatic configuring JDBC data sources, JMS connection factories, AWS Clients, etc. | true | boolean
+| *authKey* (security) | If Access Manager is utilized, client will use this authKey in all restricted requests. |  | String
+| *cipherKey* (security) | If cipher is passed, all communications to/from PubNub will be encrypted. |  | String
+| *publishKey* (security) | The publish key obtained from your PubNub account. Required when publishing messages. |  | String
+| *secretKey* (security) | The secret key used for message signing. |  | String
+| *secure* (security) | Use SSL for secure transmission. | true | boolean
+| *subscribeKey* (security) | The subscribe key obtained from your PubNub account. Required when subscribing to channels or listening for presence events |  | String
 |===
 // component options: END
 
diff --git a/components/camel-pubnub/src/generated/java/org/apache/camel/component/pubnub/PubNubComponentConfigurer.java b/components/camel-pubnub/src/generated/java/org/apache/camel/component/pubnub/PubNubComponentConfigurer.java
index 4be3a6e..dfb1062 100644
--- a/components/camel-pubnub/src/generated/java/org/apache/camel/component/pubnub/PubNubComponentConfigurer.java
+++ b/components/camel-pubnub/src/generated/java/org/apache/camel/component/pubnub/PubNubComponentConfigurer.java
@@ -17,16 +17,39 @@ import org.apache.camel.support.component.PropertyConfigurerSupport;
 @SuppressWarnings("unchecked")
 public class PubNubComponentConfigurer extends PropertyConfigurerSupport implements GeneratedPropertyConfigurer, PropertyConfigurerGetter {
 
+    private org.apache.camel.component.pubnub.PubNubConfiguration getOrCreateConfiguration(PubNubComponent target) {
+        if (target.getConfiguration() == null) {
+            target.setConfiguration(new org.apache.camel.component.pubnub.PubNubConfiguration());
+        }
+        return target.getConfiguration();
+    }
+
     @Override
     public boolean configure(CamelContext camelContext, Object obj, String name, Object value, boolean ignoreCase) {
         PubNubComponent target = (PubNubComponent) obj;
         switch (ignoreCase ? name.toLowerCase() : name) {
+        case "authkey":
+        case "authKey": getOrCreateConfiguration(target).setAuthKey(property(camelContext, java.lang.String.class, value)); return true;
         case "autowiredenabled":
         case "autowiredEnabled": target.setAutowiredEnabled(property(camelContext, boolean.class, value)); return true;
         case "bridgeerrorhandler":
         case "bridgeErrorHandler": target.setBridgeErrorHandler(property(camelContext, boolean.class, value)); return true;
+        case "cipherkey":
+        case "cipherKey": getOrCreateConfiguration(target).setCipherKey(property(camelContext, java.lang.String.class, value)); return true;
+        case "configuration": target.setConfiguration(property(camelContext, org.apache.camel.component.pubnub.PubNubConfiguration.class, value)); return true;
         case "lazystartproducer":
         case "lazyStartProducer": target.setLazyStartProducer(property(camelContext, boolean.class, value)); return true;
+        case "operation": getOrCreateConfiguration(target).setOperation(property(camelContext, java.lang.String.class, value)); return true;
+        case "publishkey":
+        case "publishKey": getOrCreateConfiguration(target).setPublishKey(property(camelContext, java.lang.String.class, value)); return true;
+        case "secretkey":
+        case "secretKey": getOrCreateConfiguration(target).setSecretKey(property(camelContext, java.lang.String.class, value)); return true;
+        case "secure": getOrCreateConfiguration(target).setSecure(property(camelContext, boolean.class, value)); return true;
+        case "subscribekey":
+        case "subscribeKey": getOrCreateConfiguration(target).setSubscribeKey(property(camelContext, java.lang.String.class, value)); return true;
+        case "uuid": getOrCreateConfiguration(target).setUuid(property(camelContext, java.lang.String.class, value)); return true;
+        case "withpresence":
+        case "withPresence": getOrCreateConfiguration(target).setWithPresence(property(camelContext, boolean.class, value)); return true;
         default: return false;
         }
     }
@@ -34,12 +57,28 @@ public class PubNubComponentConfigurer extends PropertyConfigurerSupport impleme
     @Override
     public Class<?> getOptionType(String name, boolean ignoreCase) {
         switch (ignoreCase ? name.toLowerCase() : name) {
+        case "authkey":
+        case "authKey": return java.lang.String.class;
         case "autowiredenabled":
         case "autowiredEnabled": return boolean.class;
         case "bridgeerrorhandler":
         case "bridgeErrorHandler": return boolean.class;
+        case "cipherkey":
+        case "cipherKey": return java.lang.String.class;
+        case "configuration": return org.apache.camel.component.pubnub.PubNubConfiguration.class;
         case "lazystartproducer":
         case "lazyStartProducer": return boolean.class;
+        case "operation": return java.lang.String.class;
+        case "publishkey":
+        case "publishKey": return java.lang.String.class;
+        case "secretkey":
+        case "secretKey": return java.lang.String.class;
+        case "secure": return boolean.class;
+        case "subscribekey":
+        case "subscribeKey": return java.lang.String.class;
+        case "uuid": return java.lang.String.class;
+        case "withpresence":
+        case "withPresence": return boolean.class;
         default: return null;
         }
     }
@@ -48,12 +87,28 @@ public class PubNubComponentConfigurer extends PropertyConfigurerSupport impleme
     public Object getOptionValue(Object obj, String name, boolean ignoreCase) {
         PubNubComponent target = (PubNubComponent) obj;
         switch (ignoreCase ? name.toLowerCase() : name) {
+        case "authkey":
+        case "authKey": return getOrCreateConfiguration(target).getAuthKey();
         case "autowiredenabled":
         case "autowiredEnabled": return target.isAutowiredEnabled();
         case "bridgeerrorhandler":
         case "bridgeErrorHandler": return target.isBridgeErrorHandler();
+        case "cipherkey":
+        case "cipherKey": return getOrCreateConfiguration(target).getCipherKey();
+        case "configuration": return target.getConfiguration();
         case "lazystartproducer":
         case "lazyStartProducer": return target.isLazyStartProducer();
+        case "operation": return getOrCreateConfiguration(target).getOperation();
+        case "publishkey":
+        case "publishKey": return getOrCreateConfiguration(target).getPublishKey();
+        case "secretkey":
+        case "secretKey": return getOrCreateConfiguration(target).getSecretKey();
+        case "secure": return getOrCreateConfiguration(target).isSecure();
+        case "subscribekey":
+        case "subscribeKey": return getOrCreateConfiguration(target).getSubscribeKey();
+        case "uuid": return getOrCreateConfiguration(target).getUuid();
+        case "withpresence":
+        case "withPresence": return getOrCreateConfiguration(target).isWithPresence();
         default: return null;
         }
     }
diff --git a/components/camel-pubnub/src/generated/resources/org/apache/camel/component/pubnub/pubnub.json b/components/camel-pubnub/src/generated/resources/org/apache/camel/component/pubnub/pubnub.json
index 5c8cacd..fa81c7b 100644
--- a/components/camel-pubnub/src/generated/resources/org/apache/camel/component/pubnub/pubnub.json
+++ b/components/camel-pubnub/src/generated/resources/org/apache/camel/component/pubnub/pubnub.json
@@ -22,9 +22,19 @@
     "lenientProperties": false
   },
   "componentProperties": {
+    "configuration": { "kind": "property", "displayName": "Configuration", "group": "common", "label": "", "required": false, "type": "object", "javaType": "org.apache.camel.component.pubnub.PubNubConfiguration", "deprecated": false, "autowired": false, "secret": false, "description": "The component configurations" },
+    "uuid": { "kind": "property", "displayName": "Uuid", "group": "common", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.pubnub.PubNubConfiguration", "configurationField": "configuration", "description": "UUID to be used as a device identifier, a default UUID is generated if not passed." },
     "bridgeErrorHandler": { "kind": "property", "displayName": "Bridge Error Handler", "group": "consumer", "label": "consumer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "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 me [...]
+    "withPresence": { "kind": "property", "displayName": "With Presence", "group": "consumer", "label": "consumer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.pubnub.PubNubConfiguration", "configurationField": "configuration", "description": "Also subscribe to related presence information" },
     "lazyStartProducer": { "kind": "property", "displayName": "Lazy Start Producer", "group": "producer", "label": "producer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during star [...]
-    "autowiredEnabled": { "kind": "property", "displayName": "Autowired Enabled", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Whether autowiring is enabled. This is used for automatic autowiring options (the option must be marked as autowired) by looking up in the registry to find if there is a single instance of matching type, which t [...]
+    "operation": { "kind": "property", "displayName": "Operation", "group": "producer", "label": "producer", "required": false, "type": "string", "javaType": "java.lang.String", "enum": [ "HERENOW", "WHERENOW", "GETSTATE", "SETSTATE", "GETHISTORY", "PUBLISH", "FIRE" ], "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.pubnub.PubNubConfiguration", "configurationField": "configuration", "description": "The operation to perform. PUBL [...]
+    "autowiredEnabled": { "kind": "property", "displayName": "Autowired Enabled", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Whether autowiring is enabled. This is used for automatic autowiring options (the option must be marked as autowired) by looking up in the registry to find if there is a single instance of matching type, which t [...]
+    "authKey": { "kind": "property", "displayName": "Auth Key", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": true, "configurationClass": "org.apache.camel.component.pubnub.PubNubConfiguration", "configurationField": "configuration", "description": "If Access Manager is utilized, client will use this authKey in all restricted requests." },
+    "cipherKey": { "kind": "property", "displayName": "Cipher Key", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": true, "configurationClass": "org.apache.camel.component.pubnub.PubNubConfiguration", "configurationField": "configuration", "description": "If cipher is passed, all communications to\/from PubNub will be encrypted." },
+    "publishKey": { "kind": "property", "displayName": "Publish Key", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": true, "configurationClass": "org.apache.camel.component.pubnub.PubNubConfiguration", "configurationField": "configuration", "description": "The publish key obtained from your PubNub account. Required when publishing messages." },
+    "secretKey": { "kind": "property", "displayName": "Secret Key", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": true, "configurationClass": "org.apache.camel.component.pubnub.PubNubConfiguration", "configurationField": "configuration", "description": "The secret key used for message signing." },
+    "secure": { "kind": "property", "displayName": "Secure", "group": "security", "label": "security", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "configurationClass": "org.apache.camel.component.pubnub.PubNubConfiguration", "configurationField": "configuration", "description": "Use SSL for secure transmission." },
+    "subscribeKey": { "kind": "property", "displayName": "Subscribe Key", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": true, "configurationClass": "org.apache.camel.component.pubnub.PubNubConfiguration", "configurationField": "configuration", "description": "The subscribe key obtained from your PubNub account. Required when subscribing to channels or listening for presence [...]
   },
   "properties": {
     "channel": { "kind": "path", "displayName": "Channel", "group": "common", "label": "", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.pubnub.PubNubConfiguration", "configurationField": "configuration", "description": "The channel used for subscribing\/publishing events" },
diff --git a/components/camel-pubnub/src/main/docs/pubnub-component.adoc b/components/camel-pubnub/src/main/docs/pubnub-component.adoc
index 508c5b9..934c6ce 100644
--- a/components/camel-pubnub/src/main/docs/pubnub-component.adoc
+++ b/components/camel-pubnub/src/main/docs/pubnub-component.adoc
@@ -52,16 +52,26 @@ Where *channel* is the PubNub channel to publish or subscribe to.
 
 
 // component options: START
-The PubNub component supports 3 options, which are listed below.
+The PubNub component supports 13 options, which are listed below.
 
 
 
 [width="100%",cols="2,5,^1,2",options="header"]
 |===
 | Name | Description | Default | Type
+| *configuration* (common) | The component configurations |  | PubNubConfiguration
+| *uuid* (common) | UUID to be used as a device identifier, a default UUID is generated if not passed. |  | String
 | *bridgeErrorHandler* (consumer) | 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 or ERROR level and ignored. | false | boolean
+| *withPresence* (consumer) | Also subscribe to related presence information | false | boolean
 | *lazyStartProducer* (producer) | Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel's routing error handlers. Beware that when the first message is processed then creating and [...]
+| *operation* (producer) | The operation to perform. PUBLISH: Default. Send a message to all subscribers of a channel. FIRE: allows the client to send a message to BLOCKS Event Handlers. These messages will go directly to any Event Handlers registered on the channel. HERENOW: Obtain information about the current state of a channel including a list of unique user-ids currently subscribed to the channel and the total occupancy count. WHERENOW: Obtain information about the current list of c [...]
 | *autowiredEnabled* (advanced) | Whether autowiring is enabled. This is used for automatic autowiring options (the option must be marked as autowired) by looking up in the registry to find if there is a single instance of matching type, which then gets configured on the component. This can be used for automatic configuring JDBC data sources, JMS connection factories, AWS Clients, etc. | true | boolean
+| *authKey* (security) | If Access Manager is utilized, client will use this authKey in all restricted requests. |  | String
+| *cipherKey* (security) | If cipher is passed, all communications to/from PubNub will be encrypted. |  | String
+| *publishKey* (security) | The publish key obtained from your PubNub account. Required when publishing messages. |  | String
+| *secretKey* (security) | The secret key used for message signing. |  | String
+| *secure* (security) | Use SSL for secure transmission. | true | boolean
+| *subscribeKey* (security) | The subscribe key obtained from your PubNub account. Required when subscribing to channels or listening for presence events |  | String
 |===
 // component options: END
 
diff --git a/components/camel-pubnub/src/main/java/org/apache/camel/component/pubnub/PubNubComponent.java b/components/camel-pubnub/src/main/java/org/apache/camel/component/pubnub/PubNubComponent.java
index 000f5e6..bed4878 100644
--- a/components/camel-pubnub/src/main/java/org/apache/camel/component/pubnub/PubNubComponent.java
+++ b/components/camel-pubnub/src/main/java/org/apache/camel/component/pubnub/PubNubComponent.java
@@ -20,6 +20,7 @@ import java.util.Map;
 
 import org.apache.camel.CamelContext;
 import org.apache.camel.Endpoint;
+import org.apache.camel.spi.Metadata;
 import org.apache.camel.spi.annotations.Component;
 import org.apache.camel.support.DefaultComponent;
 import org.apache.camel.util.ObjectHelper;
@@ -27,6 +28,9 @@ import org.apache.camel.util.ObjectHelper;
 @Component("pubnub")
 public class PubNubComponent extends DefaultComponent {
 
+    @Metadata
+    private PubNubConfiguration configuration = new PubNubConfiguration();
+
     public PubNubComponent(CamelContext context) {
         super(context);
     }
@@ -38,13 +42,23 @@ public class PubNubComponent extends DefaultComponent {
     protected Endpoint createEndpoint(String uri, String remaining, Map<String, Object> parameters) throws Exception {
         ObjectHelper.notNull(remaining, "channel");
 
-        PubNubConfiguration pubNubConfiguration = new PubNubConfiguration();
-        pubNubConfiguration.setChannel(remaining);
-        setProperties(pubNubConfiguration, parameters);
+        final PubNubConfiguration config
+                = this.configuration != null ? this.configuration.copy() : new PubNubConfiguration();
 
-        PubNubEndpoint endpoint = new PubNubEndpoint(uri, this, pubNubConfiguration);
+        config.setChannel(remaining);
+        PubNubEndpoint endpoint = new PubNubEndpoint(uri, this, config);
         setProperties(endpoint, parameters);
         return endpoint;
     }
 
+    public PubNubConfiguration getConfiguration() {
+        return configuration;
+    }
+
+    /**
+     * The component configurations
+     */
+    public void setConfiguration(PubNubConfiguration configuration) {
+        this.configuration = configuration;
+    }
 }
diff --git a/components/camel-pubnub/src/main/java/org/apache/camel/component/pubnub/PubNubConfiguration.java b/components/camel-pubnub/src/main/java/org/apache/camel/component/pubnub/PubNubConfiguration.java
index 00200d7..7e5b402 100644
--- a/components/camel-pubnub/src/main/java/org/apache/camel/component/pubnub/PubNubConfiguration.java
+++ b/components/camel-pubnub/src/main/java/org/apache/camel/component/pubnub/PubNubConfiguration.java
@@ -16,45 +16,45 @@
  */
 package org.apache.camel.component.pubnub;
 
+import org.apache.camel.RuntimeCamelException;
 import org.apache.camel.spi.Metadata;
 import org.apache.camel.spi.UriParam;
 import org.apache.camel.spi.UriParams;
 import org.apache.camel.spi.UriPath;
 
 @UriParams
-public class PubNubConfiguration {
+public class PubNubConfiguration implements Cloneable {
 
-    @UriPath()
+    @UriPath
     @Metadata(required = true)
     private String channel;
-
     @UriParam(label = "security", secret = true)
     private String publishKey;
-
     @UriParam(label = "security", secret = true)
     private String subscribeKey;
-
     @UriParam(label = "security", secret = true)
     private String secretKey;
-
     @UriParam(label = "security", secret = true)
     private String authKey;
-
     @UriParam(label = "security", secret = true)
     private String cipherKey;
-
     @UriParam(label = "security", defaultValue = "true")
     private boolean secure = true;
-
-    @UriParam()
+    @UriParam
     private String uuid;
-
     @UriParam(label = "producer", enums = "HERENOW,WHERENOW,GETSTATE,SETSTATE,GETHISTORY,PUBLISH,FIRE")
     private String operation;
-
     @UriParam(label = "consumer", defaultValue = "false")
     private boolean withPresence;
 
+    public PubNubConfiguration copy() {
+        try {
+            return (PubNubConfiguration) clone();
+        } catch (CloneNotSupportedException e) {
+            throw new RuntimeCamelException(e);
+        }
+    }
+
     /**
      * The publish key obtained from your PubNub account. Required when publishing messages.
      */
diff --git a/components/camel-pubnub/src/test/java/org/apache/camel/component/pubnub/PubNubConfigurationTest.java b/components/camel-pubnub/src/test/java/org/apache/camel/component/pubnub/PubNubConfigurationTest.java
index b83bce0..27dc5a6 100644
--- a/components/camel-pubnub/src/test/java/org/apache/camel/component/pubnub/PubNubConfigurationTest.java
+++ b/components/camel-pubnub/src/test/java/org/apache/camel/component/pubnub/PubNubConfigurationTest.java
@@ -28,14 +28,14 @@ public class PubNubConfigurationTest extends CamelTestSupport {
 
     @Test
     public void createEndpointWithIllegalArguments() throws Exception {
-        PubNubComponent component = new PubNubComponent(context);
+        PubNubComponent component = context.getComponent("pubnub", PubNubComponent.class);
         assertThrows(IllegalArgumentException.class,
                 () -> component.createEndpoint("pubnub"));
     }
 
     @Test
     public void createEndpointWithMinimalConfiguration() throws Exception {
-        PubNubComponent component = new PubNubComponent(context);
+        PubNubComponent component = context.getComponent("pubnub", PubNubComponent.class);
         PubNubEndpoint endpoint = (PubNubEndpoint) component.createEndpoint("pubnub:xxx?subscribeKey=mysubkey");
 
         assertEquals("xxx", endpoint.getConfiguration().getChannel());
@@ -45,7 +45,7 @@ public class PubNubConfigurationTest extends CamelTestSupport {
 
     @Test
     public void createEndpointWithMaximalConfiguration() throws Exception {
-        PubNubComponent component = new PubNubComponent(context);
+        PubNubComponent component = context.getComponent("pubnub", PubNubComponent.class);
         PubNubEndpoint endpoint = (PubNubEndpoint) component
                 .createEndpoint(
                         "pubnub:xxx?subscribeKey=mysubkey&publishKey=mypubkey&secretKey=secrets&uuid=myuuid&operation=PUBLISH&secure=false&authKey=authKey");
diff --git a/core/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/PubnubComponentBuilderFactory.java b/core/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/PubnubComponentBuilderFactory.java
index cea1d90..42d5357 100644
--- a/core/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/PubnubComponentBuilderFactory.java
+++ b/core/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/PubnubComponentBuilderFactory.java
@@ -53,6 +53,37 @@ public interface PubnubComponentBuilderFactory {
             extends
                 ComponentBuilder<PubNubComponent> {
         /**
+         * The component configurations.
+         * 
+         * The option is a:
+         * &lt;code&gt;org.apache.camel.component.pubnub.PubNubConfiguration&lt;/code&gt; type.
+         * 
+         * Group: common
+         * 
+         * @param configuration the value to set
+         * @return the dsl builder
+         */
+        default PubnubComponentBuilder configuration(
+                org.apache.camel.component.pubnub.PubNubConfiguration configuration) {
+            doSetProperty("configuration", configuration);
+            return this;
+        }
+        /**
+         * UUID to be used as a device identifier, a default UUID is generated
+         * if not passed.
+         * 
+         * The option is a: &lt;code&gt;java.lang.String&lt;/code&gt; type.
+         * 
+         * Group: common
+         * 
+         * @param uuid the value to set
+         * @return the dsl builder
+         */
+        default PubnubComponentBuilder uuid(java.lang.String uuid) {
+            doSetProperty("uuid", uuid);
+            return this;
+        }
+        /**
          * 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
@@ -75,6 +106,21 @@ public interface PubnubComponentBuilderFactory {
             return this;
         }
         /**
+         * Also subscribe to related presence information.
+         * 
+         * The option is a: &lt;code&gt;boolean&lt;/code&gt; type.
+         * 
+         * Default: false
+         * Group: consumer
+         * 
+         * @param withPresence the value to set
+         * @return the dsl builder
+         */
+        default PubnubComponentBuilder withPresence(boolean withPresence) {
+            doSetProperty("withPresence", withPresence);
+            return this;
+        }
+        /**
          * Whether the producer should be started lazy (on the first message).
          * By starting lazy you can use this to allow CamelContext and routes to
          * startup in situations where a producer may otherwise fail during
@@ -99,6 +145,31 @@ public interface PubnubComponentBuilderFactory {
             return this;
         }
         /**
+         * The operation to perform. PUBLISH: Default. Send a message to all
+         * subscribers of a channel. FIRE: allows the client to send a message
+         * to BLOCKS Event Handlers. These messages will go directly to any
+         * Event Handlers registered on the channel. HERENOW: Obtain information
+         * about the current state of a channel including a list of unique
+         * user-ids currently subscribed to the channel and the total occupancy
+         * count. WHERENOW: Obtain information about the current list of
+         * channels to which a uuid is subscribed to. GETSTATE: Used to get
+         * key/value pairs specific to a subscriber uuid. State information is
+         * supplied as a JSON object of key/value pairs SETSTATE: Used to set
+         * key/value pairs specific to a subscriber uuid GETHISTORY: Fetches
+         * historical messages of a channel.
+         * 
+         * The option is a: &lt;code&gt;java.lang.String&lt;/code&gt; type.
+         * 
+         * Group: producer
+         * 
+         * @param operation the value to set
+         * @return the dsl builder
+         */
+        default PubnubComponentBuilder operation(java.lang.String operation) {
+            doSetProperty("operation", operation);
+            return this;
+        }
+        /**
          * Whether autowiring is enabled. This is used for automatic autowiring
          * options (the option must be marked as autowired) by looking up in the
          * registry to find if there is a single instance of matching type,
@@ -118,6 +189,96 @@ public interface PubnubComponentBuilderFactory {
             doSetProperty("autowiredEnabled", autowiredEnabled);
             return this;
         }
+        /**
+         * If Access Manager is utilized, client will use this authKey in all
+         * restricted requests.
+         * 
+         * The option is a: &lt;code&gt;java.lang.String&lt;/code&gt; type.
+         * 
+         * Group: security
+         * 
+         * @param authKey the value to set
+         * @return the dsl builder
+         */
+        default PubnubComponentBuilder authKey(java.lang.String authKey) {
+            doSetProperty("authKey", authKey);
+            return this;
+        }
+        /**
+         * If cipher is passed, all communications to/from PubNub will be
+         * encrypted.
+         * 
+         * The option is a: &lt;code&gt;java.lang.String&lt;/code&gt; type.
+         * 
+         * Group: security
+         * 
+         * @param cipherKey the value to set
+         * @return the dsl builder
+         */
+        default PubnubComponentBuilder cipherKey(java.lang.String cipherKey) {
+            doSetProperty("cipherKey", cipherKey);
+            return this;
+        }
+        /**
+         * The publish key obtained from your PubNub account. Required when
+         * publishing messages.
+         * 
+         * The option is a: &lt;code&gt;java.lang.String&lt;/code&gt; type.
+         * 
+         * Group: security
+         * 
+         * @param publishKey the value to set
+         * @return the dsl builder
+         */
+        default PubnubComponentBuilder publishKey(java.lang.String publishKey) {
+            doSetProperty("publishKey", publishKey);
+            return this;
+        }
+        /**
+         * The secret key used for message signing.
+         * 
+         * The option is a: &lt;code&gt;java.lang.String&lt;/code&gt; type.
+         * 
+         * Group: security
+         * 
+         * @param secretKey the value to set
+         * @return the dsl builder
+         */
+        default PubnubComponentBuilder secretKey(java.lang.String secretKey) {
+            doSetProperty("secretKey", secretKey);
+            return this;
+        }
+        /**
+         * Use SSL for secure transmission.
+         * 
+         * The option is a: &lt;code&gt;boolean&lt;/code&gt; type.
+         * 
+         * Default: true
+         * Group: security
+         * 
+         * @param secure the value to set
+         * @return the dsl builder
+         */
+        default PubnubComponentBuilder secure(boolean secure) {
+            doSetProperty("secure", secure);
+            return this;
+        }
+        /**
+         * The subscribe key obtained from your PubNub account. Required when
+         * subscribing to channels or listening for presence events.
+         * 
+         * The option is a: &lt;code&gt;java.lang.String&lt;/code&gt; type.
+         * 
+         * Group: security
+         * 
+         * @param subscribeKey the value to set
+         * @return the dsl builder
+         */
+        default PubnubComponentBuilder subscribeKey(
+                java.lang.String subscribeKey) {
+            doSetProperty("subscribeKey", subscribeKey);
+            return this;
+        }
     }
 
     class PubnubComponentBuilderImpl
@@ -129,15 +290,32 @@ public interface PubnubComponentBuilderFactory {
         protected PubNubComponent buildConcreteComponent() {
             return new PubNubComponent();
         }
+        private org.apache.camel.component.pubnub.PubNubConfiguration getOrCreateConfiguration(
+                org.apache.camel.component.pubnub.PubNubComponent component) {
+            if (component.getConfiguration() == null) {
+                component.setConfiguration(new org.apache.camel.component.pubnub.PubNubConfiguration());
+            }
+            return component.getConfiguration();
+        }
         @Override
         protected boolean setPropertyOnComponent(
                 Component component,
                 String name,
                 Object value) {
             switch (name) {
+            case "configuration": ((PubNubComponent) component).setConfiguration((org.apache.camel.component.pubnub.PubNubConfiguration) value); return true;
+            case "uuid": getOrCreateConfiguration((PubNubComponent) component).setUuid((java.lang.String) value); return true;
             case "bridgeErrorHandler": ((PubNubComponent) component).setBridgeErrorHandler((boolean) value); return true;
+            case "withPresence": getOrCreateConfiguration((PubNubComponent) component).setWithPresence((boolean) value); return true;
             case "lazyStartProducer": ((PubNubComponent) component).setLazyStartProducer((boolean) value); return true;
+            case "operation": getOrCreateConfiguration((PubNubComponent) component).setOperation((java.lang.String) value); return true;
             case "autowiredEnabled": ((PubNubComponent) component).setAutowiredEnabled((boolean) value); return true;
+            case "authKey": getOrCreateConfiguration((PubNubComponent) component).setAuthKey((java.lang.String) value); return true;
+            case "cipherKey": getOrCreateConfiguration((PubNubComponent) component).setCipherKey((java.lang.String) value); return true;
+            case "publishKey": getOrCreateConfiguration((PubNubComponent) component).setPublishKey((java.lang.String) value); return true;
+            case "secretKey": getOrCreateConfiguration((PubNubComponent) component).setSecretKey((java.lang.String) value); return true;
+            case "secure": getOrCreateConfiguration((PubNubComponent) component).setSecure((boolean) value); return true;
+            case "subscribeKey": getOrCreateConfiguration((PubNubComponent) component).setSubscribeKey((java.lang.String) value); return true;
             default: return false;
             }
         }
diff --git a/docs/components/modules/ROOT/pages/pubnub-component.adoc b/docs/components/modules/ROOT/pages/pubnub-component.adoc
index b4a1904..8679365 100644
--- a/docs/components/modules/ROOT/pages/pubnub-component.adoc
+++ b/docs/components/modules/ROOT/pages/pubnub-component.adoc
@@ -54,16 +54,26 @@ Where *channel* is the PubNub channel to publish or subscribe to.
 
 
 // component options: START
-The PubNub component supports 3 options, which are listed below.
+The PubNub component supports 13 options, which are listed below.
 
 
 
 [width="100%",cols="2,5,^1,2",options="header"]
 |===
 | Name | Description | Default | Type
+| *configuration* (common) | The component configurations |  | PubNubConfiguration
+| *uuid* (common) | UUID to be used as a device identifier, a default UUID is generated if not passed. |  | String
 | *bridgeErrorHandler* (consumer) | 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 or ERROR level and ignored. | false | boolean
+| *withPresence* (consumer) | Also subscribe to related presence information | false | boolean
 | *lazyStartProducer* (producer) | Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel's routing error handlers. Beware that when the first message is processed then creating and [...]
+| *operation* (producer) | The operation to perform. PUBLISH: Default. Send a message to all subscribers of a channel. FIRE: allows the client to send a message to BLOCKS Event Handlers. These messages will go directly to any Event Handlers registered on the channel. HERENOW: Obtain information about the current state of a channel including a list of unique user-ids currently subscribed to the channel and the total occupancy count. WHERENOW: Obtain information about the current list of c [...]
 | *autowiredEnabled* (advanced) | Whether autowiring is enabled. This is used for automatic autowiring options (the option must be marked as autowired) by looking up in the registry to find if there is a single instance of matching type, which then gets configured on the component. This can be used for automatic configuring JDBC data sources, JMS connection factories, AWS Clients, etc. | true | boolean
+| *authKey* (security) | If Access Manager is utilized, client will use this authKey in all restricted requests. |  | String
+| *cipherKey* (security) | If cipher is passed, all communications to/from PubNub will be encrypted. |  | String
+| *publishKey* (security) | The publish key obtained from your PubNub account. Required when publishing messages. |  | String
+| *secretKey* (security) | The secret key used for message signing. |  | String
+| *secure* (security) | Use SSL for secure transmission. | true | boolean
+| *subscribeKey* (security) | The subscribe key obtained from your PubNub account. Required when subscribing to channels or listening for presence events |  | String
 |===
 // component options: END