justinmclean opened a new issue, #4697:
URL: https://github.com/apache/iggy/issues/4697

   ### Description
   
   The Rust, Java and Node examples include a multi-tenant example: each tenant 
gets its own stream and its own user, limited to that stream, and the example 
shows that a tenant cannot reach another tenant's stream. The Python examples 
have none.
   
   ### Affected area / component
   
   Python examples
   
   ### Proposed solution
   
   Add `examples/python/multi-tenant/producer.py` and `consumer.py`, and a 
README section in `examples/python/README.md`.
   
   - Use `examples/rust/src/multi-tenant/producer/main.rs` as the model. It 
takes the tenant count from `TENANTS_COUNT` (default 3) and checks that other 
tenants' streams are refused.
   - The Python SDK already has `create_user` (with an optional `permissions` 
argument), `update_permissions`, and the `Permissions`, `GlobalPermissions`, 
`StreamPermissions` and `TopicPermissions` classes in 
`foreign/python/apache_iggy.pyi`.
   - The producer creates each tenant's stream, topic and restricted user, 
sends messages as each tenant, and prints that reading another tenant's stream 
fails.
   - The consumer reads one tenant's stream as that tenant.
   - Use the argument and logging style of `message-headers/common.py`.
   
   **How to test:** start a fresh server, then run both scripts with `uv run` 
from `examples/python`. The README should list the commands.
   
   ### Good first issue
   
   - [x] I think this could be a good first issue for a new contributor
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to