Closed eeskildsen closed 4 years ago
I'm happy with how simple and straightforward this addition looks! π
Cool.... would now be a good time to merge your PR? π
Cool.... would now be a good time to merge your PR? π
Yep, it should be good to go!
Excellent! Your contribution is out in Rebus.AzureServiceBus 7.1.0, which is on NuGet.org as soon as they update their index π
Thanks for your contribution! π
The added parameter to UseAzureServiceBus
causes an incompatability between 7.0.0 and 7.1.0 which could've been avoided as described here https://stackoverflow.com/questions/44104352/adding-option-parameter-to-a-library-in-c-sharp-without-creating-a-breaking-chan
Something to watch out for in the future π
This change lets a consumer pass an
ITokenProvider
to Rebus. The token provider is then passed to the underlying Azure Service Bus clients.Token providers support authentication methods beyond SAS. For example, they support Azure Active Directory, which can be used for Role-Based Access Control (RBAC). This gives the consumer more granular access control over queues and topics.
I implemented this as an optional parameter in
UseAzureServiceBus
. The argument (default null) is passed to the transport constructor. If the argument is null, the various Service Bus clients are instantiated with the same constructor overloads that were in the code before my changes. If the parameter is not null, alternative constructor overloads, which acceptITokenProvider
s, are called instead.I added a passing test in
TokenProviderTest
, but it only covers queues.Let me know if any questions, suggestions, etc....
Rebus is MIT-licensed. The code submitted in this pull request needs to carry the MIT license too. By leaving this text in, I hereby acknowledge that the code submitted in the pull request has the MIT license and can be merged with the Rebus codebase.