feat(python): add TLS and auth args to getting-started examples#2754
feat(python): add TLS and auth args to getting-started examples#2754mmodzelewski merged 14 commits intoapache:masterfrom
Conversation
a324506 to
861c7ef
Compare
|
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. |
|
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? |
|
@slbotbm Sure, I can write an integration test for TLS. |
…l testing-docker for lint
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #2754 +/- ##
============================================
- Coverage 68.37% 68.35% -0.02%
Complexity 739 739
============================================
Files 1053 1053
Lines 84717 84752 +35
Branches 61252 61297 +45
============================================
+ Hits 57928 57936 +8
- Misses 24415 24439 +24
- Partials 2374 2377 +3
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
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