From e7716adb7ec331cb1599de98b9f1be91ddc7233b Mon Sep 17 00:00:00 2001 From: Jozef Volak Date: Mon, 13 Nov 2023 14:29:05 +0100 Subject: [PATCH] [kafka] Fix SASL plain text validation --- misc/python/kafka/CHANGELOG.md | 5 +++- misc/python/kafka/README.md | 25 +++++++++++++++++++ .../frinx_worker/kafka/producer_cache.py | 4 --- misc/python/kafka/pyproject.toml | 2 +- 4 files changed, 30 insertions(+), 6 deletions(-) diff --git a/misc/python/kafka/CHANGELOG.md b/misc/python/kafka/CHANGELOG.md index dda1066..9835b76 100644 --- a/misc/python/kafka/CHANGELOG.md +++ b/misc/python/kafka/CHANGELOG.md @@ -1,2 +1,5 @@ # 1.0.0 -- Upgrade pydantic version to v2 \ No newline at end of file +- Upgrade pydantic version to v2 + +# 1.0.1 +- Remove validation for SASL plain text \ No newline at end of file diff --git a/misc/python/kafka/README.md b/misc/python/kafka/README.md index 071713e..7799ebe 100644 --- a/misc/python/kafka/README.md +++ b/misc/python/kafka/README.md @@ -10,3 +10,28 @@ Conductor Kafka producer workers for Frinx Machine ### Prerequisites - Python 3.10+ is required to use this package. + + +### Workflow input example + +```json +{ + ... + "tasks": [ + { + "name": "Kafka_publish", + "taskReferenceName": "kafka_publish", + "type": "SIMPLE", + "inputParameters": { + "topic": "${workflow.input.topic}", + "key": "${workflow.input.key}", + "message": "${workflow.input.message}", + "bootstrap_servers": "kafka:9092", + "security": "SASL_PLAINTEXT", + "ssl_conf": "{\"sasl_plain_username\": \"user1\", \"sasl_plain_password\": \"password1\", \"sasl_mechanism\": \"PLAIN\"}" + } + } + ] + ... +} +``` diff --git a/misc/python/kafka/frinx_worker/kafka/producer_cache.py b/misc/python/kafka/frinx_worker/kafka/producer_cache.py index da7f2bf..7322155 100644 --- a/misc/python/kafka/frinx_worker/kafka/producer_cache.py +++ b/misc/python/kafka/frinx_worker/kafka/producer_cache.py @@ -126,10 +126,6 @@ class ProducerConfigSaslPlain(ProducerConfigCommon): use_enum_values=True ) - @field_validator('sasl_plain_username', 'sasl_plain_password') - def read_passwd(cls, v: str) -> Any: - return construct_full_path(v, True)[1] - class KafkaProducerCache: __ttl: int diff --git a/misc/python/kafka/pyproject.toml b/misc/python/kafka/pyproject.toml index fa2495c..6f34f56 100644 --- a/misc/python/kafka/pyproject.toml +++ b/misc/python/kafka/pyproject.toml @@ -20,7 +20,7 @@ packages = [{ include = "frinx_worker" }] name = "frinx-kafka-worker" description = "Conductor Kafka worker for Frinx Machine" authors = ["Jozef Volak "] -version = "1.0.1" +version = "1.0.2" readme = ["README.md", "CHANGELOG.md"] keywords = ["frinx-machine", "kafka", "worker"] license = "Apache 2.0"