chaitanya-y20 opened a new pull request, #4716:
URL: https://github.com/apache/iggy/pull/4716

   Adds the multi-tenant Go examples the issue asked for: one stream and one 
restricted user per tenant, modelled on the Rust example.
   
   Producer: creates `tenant_<n>_stream` with an `events` topic and a 
`tenant_<n>_producer` user that may only read and append to that stream, sends 
two batches as each tenant, then asks for another tenant's stream and prints 
the refusal.
   
   Consumer: adds a read-only `tenant_<n>_consumer` user per tenant, reads each 
stream as that tenant, and makes the same refused request. Consumer groups and 
TLS stay out of scope, as the issue asked.
   
   `TENANTS_COUNT` sets the tenant count (default 3). Streams, topics and users 
are reused when they already exist and their permissions are rewritten, so a 
second run succeeds instead of panicking.
   
   Verification, against a server built from this checkout (`cargo build --bin 
iggy-server`, then `--fresh --with-default-root-credentials`):
   
   - producer then consumer exit 0 on a fresh server, 3 tenants, and each 
tenant reads 5 messages from its own stream
   - a second run of each exits 0 and logs reuse of every stream, topic and user
   - `TENANTS_COUNT=2` runs two tenants
   - running the consumer before the producer exits non-zero with "run the 
multi-tenant producer first", and does not panic
   - `go test -race ./...`, `go vet`, `gofmt -s -l` and `go mod tidy` are clean 
in examples/go
   
   Closes #4695.
   


-- 
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