pulsar
pulsar copied to clipboard
[improve][authentication] Pass the authorization when user lookup transactionCoordinator topic
Motivation
As seen in the AuthenticatedTransactionProducerConsumerTest, if we enable authorization, and want to produce/consume to a normal topic by transaction, we not only need to grant permission on normal topic, but also need to grant permission on system namespace.
It looks unreasonable and very dangerous.
Normal users just want to produce/consume to a normal topic by transaction, but super user need to grant the whole system namespace permission to them. I think the reasonable way is to make normal user unable to produce/consume system namespace directly, instead, make them able to lookup the transactionCoordinator topic.
Modifications
When do canLookupAsync(), if the topic is tc topic, pass the authorization
Verifying this change
- [ ] Make sure that the change passes the CI checks.
Documentation
- [ ]
doc
- [ ]
doc-required
- [x]
doc-not-needed
- [ ]
doc-complete
Matching PR in forked repository
PR in forked repository: https://github.com/TakaHiR07/pulsar/pull/20