You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ac...@apache.org on 2021/05/06 09:37:54 UTC
[camel-kamelets] 02/06: Added Mask Field Action
This is an automated email from the ASF dual-hosted git repository.
acosentino pushed a commit to branch maskfield-action
in repository https://gitbox.apache.org/repos/asf/camel-kamelets.git
commit c5fc3c5e04e1760f1b3617b5e5c86795c9a5d169
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Thu May 6 11:33:12 2021 +0200
Added Mask Field Action
---
mask-field-action.kamelet.yaml | 51 ++++++++++++++++++++++++++++++++++++++++++
1 file changed, 51 insertions(+)
diff --git a/mask-field-action.kamelet.yaml b/mask-field-action.kamelet.yaml
new file mode 100644
index 0000000..7b59b85
--- /dev/null
+++ b/mask-field-action.kamelet.yaml
@@ -0,0 +1,51 @@
+apiVersion: camel.apache.org/v1alpha1
+kind: Kamelet
+metadata:
+ name: mask-field-action
+ labels:
+ camel.apache.org/kamelet.type: "action"
+ annotations:
+ camel.apache.org/kamelet.icon: "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+CjxzdmcKICAgeG1sbnM6ZGM9Imh0dHA6Ly9wdXJsLm9yZy9kYy9lbGVtZW50cy8xLjEvIgogICB4bWxuczpjYz0iaHR0cDovL2NyZWF0aXZlY29tbW9ucy5vcmcvbnMjIgogICB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiCiAgIHhtbG5zOnN2Zz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciCiAgIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIKICAgeG1sbnM6c29kaXBvZGk9Imh0dHA6Ly9zb2RpcG [...]
+ camel.apache.org/provider: "Apache Software Foundation"
+ camel.apache.org/kamelet.group: "Actions"
+spec:
+ definition:
+ title: "Mask Fields"
+ description: "Mask fields with a constant value in the message in transit"
+ required:
+ - fields
+ - replacement
+ properties:
+ fields:
+ title: Fields
+ description: Comma separated list of fields to mask
+ type: string
+ replacement:
+ title: Replacement
+ description: Replacement for the fields to be masked
+ type: string
+ type: object
+ dependencies:
+ - github:apache.camel-kamelets:camel-kamelets-utils:main-SNAPSHOT
+ flow:
+ from:
+ uri: kamelet:source
+ steps:
+ - choice:
+ when:
+ - simple: "${header[Content-Type]} == 'application/json'"
+ steps:
+ - unmarshal:
+ json: {}
+ - set-property:
+ name: "fields"
+ constant: "{{fields}}"
+ - set-property:
+ name: "replacement"
+ constant: "{{replacement}}"
+ - bean: "org.apache.camel.kamelets.utils.transform.MaskField"
+ - marshal:
+ json: {}
+ - set-header:
+ name: "Content-Type"
+ constant: "application/json"