Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added ssl support to mongodb kamelets. #1251

Merged
merged 1 commit into from
Jan 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 23 additions & 3 deletions kamelets/mongodb-changes-stream-source.kamelet.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,20 @@ spec:
type: string
x-descriptors:
- urn:camel:group:credentials
ssl:
title: Enable Ssl for Mongodb Connection
description: whether to enable ssl connection to mongodb
type: boolean
default: true
x-descriptors:
- 'urn:alm:descriptor:com.tectonic.ui:checkbox'
sslValidationEnabled:
title: Enables Ssl Certificates Validation and Host name checks.
description: IMPORTANT this should be disabled only in test environment since can pose security issues.
type: boolean
default: true
x-descriptors:
- 'urn:alm:descriptor:com.tectonic.ui:checkbox'
database:
title: MongoDB Database
description: Sets the name of the MongoDB database to target.
Expand All @@ -76,16 +90,22 @@ spec:
beans:
- name: local-mongodb
type: "#class:org.apache.camel.component.mongodb.MongoDbComponent"
- name: mongo-client
type: "#class:org.apache.camel.kamelets.utils.mongodb.SslAwareMongoClient"
properties:
password: "{{?password}}"
username: "{{?username}}"
hosts: "{{hosts}}"
ssl: "{{ssl}}"
sslValidationEnabled: "{{sslValidationEnabled}}"
from:
uri: "{{local-mongodb}}:test"
parameters:
hosts: "{{hosts}}"
collection: "{{collection}}"
password: "{{?password}}"
username: "{{?username}}"
database: "{{database}}"
consumerType: "changeStreams"
streamFilter: "{{?streamFilter}}"
mongoConnection: "#{{mongo-client}}"
steps:
- marshal:
json: {}
Expand Down
26 changes: 23 additions & 3 deletions kamelets/mongodb-sink.kamelet.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,20 @@ spec:
type: string
x-descriptors:
- urn:camel:group:credentials
ssl:
title: Enable Ssl for Mongodb Connection
description: whether to enable ssl connection to mongodb
type: boolean
default: true
x-descriptors:
- 'urn:alm:descriptor:com.tectonic.ui:checkbox'
sslValidationEnabled:
title: Enables Ssl Certificates Validation and Host name checks.
description: IMPORTANT this should be disabled only in test environment since can pose security issues.
type: boolean
default: true
x-descriptors:
- 'urn:alm:descriptor:com.tectonic.ui:checkbox'
database:
title: MongoDB Database
description: The name of the MongoDB database.
Expand Down Expand Up @@ -90,6 +104,14 @@ spec:
beans:
- name: local-mongodb
type: "#class:org.apache.camel.component.mongodb.MongoDbComponent"
- name: mongo-client
type: "#class:org.apache.camel.kamelets.utils.mongodb.SslAwareMongoClient"
properties:
password: "{{?password}}"
username: "{{?username}}"
hosts: "{{hosts}}"
ssl: "{{ssl}}"
sslValidationEnabled: "{{sslValidationEnabled}}"
from:
uri: kamelet:source
steps:
Expand All @@ -110,9 +132,7 @@ spec:
parameters:
createCollection: "{{?createCollection}}"
writeConcern: "{{?writeConcern}}"
hosts: "{{hosts}}"
collection: "{{collection}}"
password: "{{?password}}"
username: "{{?username}}"
database: "{{database}}"
operation: "insert"
mongoConnection: "#{{mongo-client}}"
26 changes: 23 additions & 3 deletions kamelets/mongodb-source.kamelet.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,20 @@ spec:
type: string
x-descriptors:
- urn:camel:group:credentials
ssl:
title: Enable Ssl for Mongodb Connection
description: whether to enable ssl connection to mongodb
type: boolean
default: true
x-descriptors:
- 'urn:alm:descriptor:com.tectonic.ui:checkbox'
sslValidationEnabled:
title: Enables Ssl Certificates Validation and Host name checks.
description: IMPORTANT this should be disabled only in test environment since can pose security issues.
type: boolean
default: true
x-descriptors:
- 'urn:alm:descriptor:com.tectonic.ui:checkbox'
database:
title: MongoDB Database
description: The name of the MongoDB database.
Expand All @@ -88,16 +102,22 @@ spec:
beans:
- name: local-mongodb
type: "#class:org.apache.camel.component.mongodb.MongoDbComponent"
- name: mongo-client
type: "#class:org.apache.camel.kamelets.utils.mongodb.SslAwareMongoClient"
properties:
password: "{{?password}}"
username: "{{?username}}"
hosts: "{{hosts}}"
ssl: "{{ssl}}"
sslValidationEnabled: "{{sslValidationEnabled}}"
from:
uri: "{{local-mongodb}}:test"
parameters:
hosts: "{{hosts}}"
collection: "{{collection}}"
password: "{{?password}}"
username: "{{?username}}"
database: "{{database}}"
persistentTailTracking: "{{persistentTailTracking}}"
tailTrackIncreasingField: "{{?tailTrackIncreasingField}}"
mongoConnection: "#{{mongo-client}}"
steps:
- marshal:
json: {}
Expand Down
7 changes: 7 additions & 0 deletions library/camel-kamelets-utils/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,13 @@
<scope>provided</scope>
</dependency>

<!-- Dependencies for mongodb connection configuration -->
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-mongodb</artifactId>
<scope>provided</scope>
</dependency>

<!-- Test scoped dependencies -->
<dependency>
<groupId>org.junit.jupiter</groupId>
Expand Down
Loading