From 9b082ce2657f9add47c80197d46699a9dfc8b760 Mon Sep 17 00:00:00 2001 From: nicolaferraro Date: Tue, 19 Oct 2021 10:26:36 +0200 Subject: [PATCH 1/2] chore: add authorization to MQTT Kamelet --- mqtt-sink.kamelet.yaml | 13 +++++++++++++ mqtt-source.kamelet.yaml | 13 +++++++++++++ 2 files changed, 26 insertions(+) diff --git a/mqtt-sink.kamelet.yaml b/mqtt-sink.kamelet.yaml index e279e7461..39e13318d 100644 --- a/mqtt-sink.kamelet.yaml +++ b/mqtt-sink.kamelet.yaml @@ -30,6 +30,17 @@ spec: description: The URL of the broker where to establish the connection type: string example: "tcp://mosquitto:1883" + username: + title: Username + description: Username to use when connecting to the MQTT broker + type: string + password: + title: Password + description: Password to use when connecting to the MQTT broker + type: string + format: password + x-descriptors: + - urn:alm:descriptor:com.tectonic.ui:password dependencies: - "camel:paho" - "camel:kamelet" @@ -41,3 +52,5 @@ spec: uri: paho:{{topic}} parameters: brokerUrl: "{{brokerUrl}}" + userName: "{{?username}}" + password: "{{?password}}" diff --git a/mqtt-source.kamelet.yaml b/mqtt-source.kamelet.yaml index 1ae863a9a..e3d69e0de 100644 --- a/mqtt-source.kamelet.yaml +++ b/mqtt-source.kamelet.yaml @@ -35,6 +35,17 @@ spec: description: The client ID to use when connecting to the resource type: string default: "mqtt-source" + username: + title: Username + description: Username to use when connecting to the MQTT broker + type: string + password: + title: Password + description: Password to use when connecting to the MQTT broker + type: string + format: password + x-descriptors: + - urn:alm:descriptor:com.tectonic.ui:password dependencies: - "camel:paho" - "camel:kamelet" @@ -44,5 +55,7 @@ spec: parameters: brokerUrl: "{{brokerUrl}}" clientId: "{{clientId}}" + userName: "{{?username}}" + password: "{{?password}}" steps: - to: kamelet:sink From 0f1866cb42eeae4c1e42a470375d7ce7b29fb4ed Mon Sep 17 00:00:00 2001 From: nicolaferraro Date: Tue, 19 Oct 2021 10:27:49 +0200 Subject: [PATCH 2/2] chore: regen docs --- docs/modules/ROOT/pages/mqtt-sink.adoc | 2 ++ docs/modules/ROOT/pages/mqtt-source.adoc | 2 ++ .../main/resources/kamelets/mqtt-sink.kamelet.yaml | 13 +++++++++++++ .../resources/kamelets/mqtt-source.kamelet.yaml | 13 +++++++++++++ 4 files changed, 30 insertions(+) diff --git a/docs/modules/ROOT/pages/mqtt-sink.adoc b/docs/modules/ROOT/pages/mqtt-sink.adoc index 65afdf987..a401e16e4 100644 --- a/docs/modules/ROOT/pages/mqtt-sink.adoc +++ b/docs/modules/ROOT/pages/mqtt-sink.adoc @@ -16,6 +16,8 @@ The following table summarizes the configuration options available for the `mqtt | Property| Name| Description| Type| Default| Example | *brokerUrl {empty}* *| Broker URL| The URL of the broker where to establish the connection| string| | `"tcp://mosquitto:1883"` | *topic {empty}* *| Topic| The topic to send messages to| string| | `"mytopic"` +| password| Password| Password to use when connecting to the MQTT broker| string| | +| username| Username| Username to use when connecting to the MQTT broker| string| | |=== NOTE: Fields marked with an asterisk ({empty}*) are mandatory. diff --git a/docs/modules/ROOT/pages/mqtt-source.adoc b/docs/modules/ROOT/pages/mqtt-source.adoc index be5b291db..8d213a7a9 100644 --- a/docs/modules/ROOT/pages/mqtt-source.adoc +++ b/docs/modules/ROOT/pages/mqtt-source.adoc @@ -17,6 +17,8 @@ The following table summarizes the configuration options available for the `mqtt | *brokerUrl {empty}* *| Broker URL| The URL of the broker where to establish the connection| string| | `"tcp://mosquitto:1883"` | *topic {empty}* *| Topic| The topic to subscribe to| string| | `"mytopic"` | clientId| Client ID| The client ID to use when connecting to the resource| string| `"mqtt-source"`| +| password| Password| Password to use when connecting to the MQTT broker| string| | +| username| Username| Username to use when connecting to the MQTT broker| string| | |=== NOTE: Fields marked with an asterisk ({empty}*) are mandatory. diff --git a/library/camel-kamelets/src/main/resources/kamelets/mqtt-sink.kamelet.yaml b/library/camel-kamelets/src/main/resources/kamelets/mqtt-sink.kamelet.yaml index e279e7461..39e13318d 100644 --- a/library/camel-kamelets/src/main/resources/kamelets/mqtt-sink.kamelet.yaml +++ b/library/camel-kamelets/src/main/resources/kamelets/mqtt-sink.kamelet.yaml @@ -30,6 +30,17 @@ spec: description: The URL of the broker where to establish the connection type: string example: "tcp://mosquitto:1883" + username: + title: Username + description: Username to use when connecting to the MQTT broker + type: string + password: + title: Password + description: Password to use when connecting to the MQTT broker + type: string + format: password + x-descriptors: + - urn:alm:descriptor:com.tectonic.ui:password dependencies: - "camel:paho" - "camel:kamelet" @@ -41,3 +52,5 @@ spec: uri: paho:{{topic}} parameters: brokerUrl: "{{brokerUrl}}" + userName: "{{?username}}" + password: "{{?password}}" diff --git a/library/camel-kamelets/src/main/resources/kamelets/mqtt-source.kamelet.yaml b/library/camel-kamelets/src/main/resources/kamelets/mqtt-source.kamelet.yaml index 1ae863a9a..e3d69e0de 100644 --- a/library/camel-kamelets/src/main/resources/kamelets/mqtt-source.kamelet.yaml +++ b/library/camel-kamelets/src/main/resources/kamelets/mqtt-source.kamelet.yaml @@ -35,6 +35,17 @@ spec: description: The client ID to use when connecting to the resource type: string default: "mqtt-source" + username: + title: Username + description: Username to use when connecting to the MQTT broker + type: string + password: + title: Password + description: Password to use when connecting to the MQTT broker + type: string + format: password + x-descriptors: + - urn:alm:descriptor:com.tectonic.ui:password dependencies: - "camel:paho" - "camel:kamelet" @@ -44,5 +55,7 @@ spec: parameters: brokerUrl: "{{brokerUrl}}" clientId: "{{clientId}}" + userName: "{{?username}}" + password: "{{?password}}" steps: - to: kamelet:sink