Event Hubs Java RBAC#3753
Conversation
|
Can one of the admins verify this patch? |
| public class ManagedIdentityTokenProvider implements ITokenProvider { | ||
| @Override | ||
| public CompletableFuture<SecurityToken> getToken(final String resource, final Duration timeout) { | ||
| final MSICredentials credentials = new MSICredentials(); |
There was a problem hiding this comment.
credentials [](start = 26, length = 11)
static
| }); | ||
| } | ||
|
|
||
| public interface AuthenticationCallback { |
There was a problem hiding this comment.
interface [](start = 11, length = 9)
Can this possibly be a @FunctionalInterface?
| }, executor); | ||
| } | ||
|
|
||
| public static CompletableFuture<EventHubClient> create( |
There was a problem hiding this comment.
public static CompletableFuture create( [](start = 4, length = 55)
Do we need to make this public since we removed Create API on the client?
There was a problem hiding this comment.
EventHubClient and EventHubClientImpl are in separate packages. If the creates on Impl are not public, then EventHubClient can't call them.
| import com.microsoft.azure.eventhubs.impl.ClientConstants; | ||
|
|
||
| public class ManagedIdentityTokenProvider implements ITokenProvider { | ||
| final static MSICredentials credentials = new MSICredentials(); |
There was a problem hiding this comment.
That won't support:
- Webapp as a whole, you need a second class: https://github.com/Azure/autorest-clientruntime-for-java/blob/a55f87f3cc3a68742a2ac94c031c6d715965a9c2/azure-client-authentication/src/main/java/com/microsoft/azure/credentials/AppServiceMSICredentials.java
- User Assigned Identity, you need to be able to provide a client_id / object_id for that
| <artifactId>gson</artifactId> | ||
| </dependency> | ||
| <dependency> | ||
| <groupId>com.microsoft.azure</groupId> |
There was a problem hiding this comment.
We try to add new dependencies in parent pom.xml files so that versions are consistent between client libraries. You would add it here:
https://github.com/Azure/azure-sdk-for-java/blob/master/parent/pom.xml
@JonathanGiles Is this the correct place to define new dependencies? I tried to find gson in it, but doesn't look like it is declared there.
|
Git could not recover this PR after the reorganization into the sdk directory. Replaced by #4498. |
This is in-progress work on RBAC support for the Event Hubs Java SDK. PR exists to let people conveniently review the changes.