-
I am building a stream at runtime using Unfortunately I cannot find any of the examples or test cases for builder := service.NewStreamBuilder()
... Add Yaml fragments and call `SetFields`.
stream, err := builder.Build()
stream.Run(ctx) Printing the resulting string with input:
label: ""
kafka_franz:
seed_brokers:
- localhost:9092
topics:
- mytopic
consumer_group: myconsumergroup
tls:
enabled: true
skip_cert_verify: true
sasl:
- mechanism: SCRAM-SHA-512
username: user
password: '!!!SECRET_SCRUBBED!!!' I believe that the the same scrubbed value is the value that is being used instead of the actual password as the logs of the kafka server state:
Using the same credentials with the $ go run *.go -brokers 127.0.0.1:9092 -username user -passwd bitnami -topic topic_name -tls-skip-verify -algorithm sha256 -tls -mode produce
[Sarama] 2023/04/17 23:35:48 Initializing new client
[Sarama] 2023/04/17 23:35:48 client/metadata fetching metadata for all topics from broker 127.0.0.1:9092
[Sarama] 2023/04/17 23:35:48 Completed pre-auth SASL handshake. Available mechanisms: [PLAIN SCRAM-SHA-512 SCRAM-SHA-256]
[Sarama] 2023/04/17 23:35:48 SASL authentication succeeded
[Sarama] 2023/04/17 23:35:48 Connected to broker at 127.0.0.1:9092 (unregistered)
[Sarama] 2023/04/17 23:35:48 client/brokers registered new broker #1001 at 192.168.4.185:9092
[Sarama] 2023/04/17 23:35:48 Successfully initialized new client
[Sarama] 2023/04/17 23:35:48 producer/broker/1001 starting up
[Sarama] 2023/04/17 23:35:48 producer/broker/1001 state change to [open] on topic_name/0
[Sarama] 2023/04/17 23:35:48 Completed pre-auth SASL handshake. Available mechanisms: [PLAIN SCRAM-SHA-512 SCRAM-SHA-256]
[Sarama] 2023/04/17 23:35:48 SASL authentication succeeded
[Sarama] 2023/04/17 23:35:48 Connected to broker at 192.168.4.185:9092 (registered as #1001)
[Producer] 2023/04/17 23:35:48 wrote message at partition: 0, offset: 2
[Sarama] 2023/04/17 23:35:48 Producer shutting down.
[Sarama] 2023/04/17 23:35:48 Closing Client
[Sarama] 2023/04/17 23:35:48 producer/broker/1001 input chan closed
[Sarama] 2023/04/17 23:35:48 producer/broker/1001 shut down
[Sarama] 2023/04/17 23:35:48 Closed connection to broker 127.0.0.1:9092
[Sarama] 2023/04/17 23:35:48 Closed connection to broker 192.168.4.185:9092
[Producer] 2023/04/17 23:35:48 Bye now ! Any advice as to how to further troubleshoot, or what should be added to the |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
hey @jkoelker, I've tried to reproduce an issue with setting secrets via a unit test: https://github.com/benthosdev/benthos/blob/main/public/service/stream_builder_test.go#L1050 and it seems to function as expected. Any chance you can try and reproduce the issue via something I can run? Maybe take the code you have and swap |
Beta Was this translation helpful? Give feedback.
-
Hi @Jeffail Thanks for the test case and looking at this. I attempted to reproduce via a smaller case, and was unable to get it to fail in the same way. I believe the issue lies in some of the helpers I had to attempt to dry up calling In the end I've resorted to creating a set of "config" structs with |
Beta Was this translation helpful? Give feedback.
hey @jkoelker, I've tried to reproduce an issue with setting secrets via a unit test: https://github.com/benthosdev/benthos/blob/main/public/service/stream_builder_test.go#L1050 and it seems to function as expected. Any chance you can try and reproduce the issue via something I can run? Maybe take the code you have and swap
kafka_franz
for a custom plugin that exposes the password value in the test.