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

Http secured sink Kamelet #298

Merged
merged 4 commits into from
May 20, 2021
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions docs/modules/ROOT/nav.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
* xref:ROOT:google-mail-source.adoc[image:kamelets/google-mail-source.svg[] Google Mail Source]
* xref:ROOT:google-sheets-source.adoc[image:kamelets/google-sheets-source.svg[] Google Sheets Source]
* xref:ROOT:hoist-field-action.adoc[image:kamelets/hoist-field-action.svg[] Hoist Field Action]
* xref:ROOT:http-secured-sink.adoc[image:kamelets/http-secured-sink.svg[] Secured HTTP Sink]
* xref:ROOT:http-secured-source.adoc[image:kamelets/http-secured-source.svg[] HTTP Secured Source]
* xref:ROOT:http-sink.adoc[image:kamelets/http-sink.svg[] HTTP Sink]
* xref:ROOT:http-source.adoc[image:kamelets/http-source.svg[] HTTP Source]
Expand Down
65 changes: 65 additions & 0 deletions docs/modules/ROOT/pages/http-secured-sink.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
// THIS FILE IS AUTOMATICALLY GENERATED: DO NOT EDIT
= image:kamelets/http-secured-sink.svg[] Secured HTTP Sink

*Provided by: "Apache Software Foundation"*

Forwards an event to a secured HTTP endpoint

== Configuration Options

The following table summarizes the configuration options available for the `http-secured-sink` Kamelet:
[width="100%",cols="2,^2,3,^2,^2,^3",options="header"]
|===
| Property| Name| Description| Type| Default| Example
| *url {empty}* *| URL| The URL to send data to| string| | `"https://my-service/path"`
| authMethod| Authentication Method| Authentication methods allowed to use as a comma separated list of values Basic, Digest or NTLM.| string| `"Basic"`|
| authPassword| Authentication Password| Authentication password| string| |
| authUsername| Authentication Username| Authentication username| string| |
| authenticationPreemptive| Authentication Preemptive| If this option is true, camel-http sends preemptive basic authentication to the server.| boolean| `false`|
| method| Method| The HTTP method to use| string| `"POST"`|
|===

NOTE: Fields marked with ({empty}*) are mandatory.

== Usage

This section summarizes how the `http-secured-sink` can be used in various contexts.

=== Knative Sink

The `http-secured-sink` Kamelet can be used as Knative sink by binding it to a Knative object.

.http-secured-sink-binding.yaml
[source,yaml]
----
apiVersion: camel.apache.org/v1alpha1
kind: KameletBinding
metadata:
name: http-secured-sink-binding
spec:
source:
ref:
kind: InMemoryChannel
apiVersion: messaging.knative.dev/v1
name: mychannel
sink:
ref:
kind: Kamelet
apiVersion: camel.apache.org/v1alpha1
name: http-secured-sink
properties:
url: "https://my-service/path"

----

Make sure you have xref:latest@camel-k::installation/installation.adoc[Camel K installed] into the Kubernetes cluster you're connected to.

Save the `http-secured-sink-binding.yaml` file into your hard drive, then configure it according to your needs.

You can run the sink using the following command:

[source,shell]
----
kubectl apply -f http-secured-sink-binding.yaml
----
// THIS FILE IS AUTOMATICALLY GENERATED: DO NOT EDIT
67 changes: 67 additions & 0 deletions http-secured-sink.kamelet.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
apiVersion: camel.apache.org/v1alpha1
kind: Kamelet
metadata:
name: http-secured-sink
annotations:
camel.apache.org/kamelet.icon: "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI0MjAiCmhlaWdodD0iNDIwIiBzdHJva2U9IiMwMDAiIGZpbGw9Im5vbmUiPgo8cGF0aCBzdHJva2Utd2lkdGg9IjI2IgpkPSJNMjA5LDE1YTE5NSwxOTUgMCAxLDAgMiwweiIvPgo8cGF0aCBzdHJva2Utd2lkdGg9IjE4IgpkPSJtMjEwLDE1djM5MG0xOTUtMTk1SDE1TTU5LDkwYTI2MCwyNjAgMCAwLDAgMzAyLDAgbTAsMjQwIGEyNjAsMjYwIDAgMCwwLTMwMiwwTTE5NSwyMGEyNTAsMjUwIDAgMCwwIDAsMzgyIG0zMCwwIGEyNTAsMjUwIDAgMCwwIDAtMzgyIi8+Cjwvc3ZnPg=="
camel.apache.org/provider: "Apache Software Foundation"
camel.apache.org/kamelet.group: "HTTP"
labels:
camel.apache.org/kamelet.type: sink
spec:
definition:
title: Secured HTTP Sink
description: Forwards an event to a secured HTTP endpoint
required:
- url
type: object
properties:
url:
title: URL
description: The URL to send data to
type: string
example: "https://my-service/path"
pattern: "^(http|https)://.*"
method:
title: Method
description: The HTTP method to use
type: string
default: POST
authMethod:
title: Authentication Method
description: Authentication methods allowed to use as a comma separated list of values Basic, Digest or NTLM.
type: string
default: "Basic"
authenticationPreemptive:
title: Authentication Preemptive
description: If this option is true, camel-http sends preemptive basic authentication to the server.
type: boolean
x-descriptors:
- 'urn:alm:descriptor:com.tectonic.ui:checkbox'
default: false
authUsername:
title: Authentication Username
description: Authentication username
type: string
authPassword:
title: Authentication Password
description: Authentication password
type: string
dependencies:
- "camel:http"
- "camel:kamelet"
- "camel:core"
flow:
from:
uri: kamelet:source
steps:
- set-header:
name: CamelHttpMethod
constant: "{{method}}"
- to:
uri: "{{url}}"
parameters:
authMethod: "{{authMethod}}"
authUsername: "{{authUsername}}"
authPassword: "{{authPassword}}"
authenticationPreemptive: "{{authenticationPreemptive}}"
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
apiVersion: camel.apache.org/v1alpha1
kind: Kamelet
metadata:
name: http-secured-sink
annotations:
camel.apache.org/kamelet.icon: "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI0MjAiCmhlaWdodD0iNDIwIiBzdHJva2U9IiMwMDAiIGZpbGw9Im5vbmUiPgo8cGF0aCBzdHJva2Utd2lkdGg9IjI2IgpkPSJNMjA5LDE1YTE5NSwxOTUgMCAxLDAgMiwweiIvPgo8cGF0aCBzdHJva2Utd2lkdGg9IjE4IgpkPSJtMjEwLDE1djM5MG0xOTUtMTk1SDE1TTU5LDkwYTI2MCwyNjAgMCAwLDAgMzAyLDAgbTAsMjQwIGEyNjAsMjYwIDAgMCwwLTMwMiwwTTE5NSwyMGEyNTAsMjUwIDAgMCwwIDAsMzgyIG0zMCwwIGEyNTAsMjUwIDAgMCwwIDAtMzgyIi8+Cjwvc3ZnPg=="
camel.apache.org/provider: "Apache Software Foundation"
camel.apache.org/kamelet.group: "HTTP"
labels:
camel.apache.org/kamelet.type: sink
spec:
definition:
title: Secured HTTP Sink
description: Forwards an event to a secured HTTP endpoint
required:
- url
type: object
properties:
url:
title: URL
description: The URL to send data to
type: string
example: "https://my-service/path"
pattern: "^(http|https)://.*"
method:
title: Method
description: The HTTP method to use
type: string
default: POST
authMethod:
title: Authentication Method
description: Authentication methods allowed to use as a comma separated list of values Basic, Digest or NTLM.
type: string
default: "Basic"
authenticationPreemptive:
title: Authentication Preemptive
description: If this option is true, camel-http sends preemptive basic authentication to the server.
type: boolean
x-descriptors:
- 'urn:alm:descriptor:com.tectonic.ui:checkbox'
default: false
authUsername:
title: Authentication Username
description: Authentication username
type: string
authPassword:
title: Authentication Password
description: Authentication password
type: string
dependencies:
- "camel:http"
- "camel:kamelet"
- "camel:core"
flow:
from:
uri: kamelet:source
steps:
- set-header:
name: CamelHttpMethod
constant: "{{method}}"
- to:
uri: "{{url}}"
parameters:
authMethod: "{{authMethod}}"
authUsername: "{{authUsername}}"
authPassword: "{{authPassword}}"
authenticationPreemptive: "{{authenticationPreemptive}}"