Skip to content

feat(python): add TLS and auth args to getting-started examples#2754

Open
saie-ch wants to merge 6 commits intoapache:masterfrom
saie-ch:feature/add-tls-args-to-example
Open

feat(python): add TLS and auth args to getting-started examples#2754
saie-ch wants to merge 6 commits intoapache:masterfrom
saie-ch:feature/add-tls-args-to-example

Conversation

@saie-ch
Copy link

@saie-ch saie-ch commented Feb 17, 2026

The Python getting-started examples connection settings has no way to configure TLS, authentication credentials.

What changed?

The producer and consumer examples only supported a basic --tcp-server-address argument.

Both examples now accept --tls, --tls-ca-file, --username, and --password arguments, and use IggyClient.from_connection_string() to build a connection string with optional TLS parameters.

Local Execution : Passed
Pre-commit hooks ran

  • Tested locally against iggy server on 127.0.0.1:8090 without TLS:
    python examples/python/getting-started/producer.py --tcp-server-address 127.0.0.1:8090
    python examples/python/getting-started/consumer.py --tcp-server-address 127.0.0.1:8090
    Producer sent 5 batches of 10 messages (50 total), consumer consumed all 50 messages successfully.

  • Tested on manged server with --tls , --tls-ca-file, username, password.
    examples/python/getting-started/producer.py
    --tls
    --tcp-server-address xxxxxxxx
    --username xxxx
    --password xxxxxx
    --tls-ca-file xxxxx

  • Python SDK tests: 18/18 passed

Copy link
Contributor

@kparisa kparisa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@saie-ch check comments, not blockers though.

@saie-ch saie-ch force-pushed the feature/add-tls-args-to-example branch from a324506 to 861c7ef Compare February 17, 2026 08:26
@slbotbm
Copy link
Contributor

slbotbm commented Feb 19, 2026

Since we use the examples to validate the behaviour of the sdks, my concern is that currently only the "happy path" of the example working without tls is tested. If we are to merge the changes, I'd appreciate it if the example could be tested with the tls config in CI.

@slbotbm
Copy link
Contributor

slbotbm commented Feb 21, 2026

I thought about it, and instead of testing tls using the examples, it would be better to test as an integration test. @saie-ch would you be amenable to writing an integration test that will test tls?

@saie-ch
Copy link
Author

saie-ch commented Feb 21, 2026

@slbotbm Sure, I can write an integration test for TLS.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@saie-ch Thank you for the update! One comment: We would like to run these tests as part of the "test" task for python, not as part of the "examples" task. I'd appreciate if you could wire this code into the test task.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@slbotbm could you recheck? The test_tls.py test already runs as part of the sdk-python / test task and the shell script TLS pass is a separate, lightweight check to ensure the example scripts (producer.py/consumer.py) work with the --tls flags.

Please correct me if I'm mistaken, thanks!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@saie-ch you are right -- that was my oversight. I apologize.

I'd like to request you to please fix the CI. After that, I think we are good to go.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Python SDK: Add TCP/TLS support, integration tests and examples

3 participants