Class TokenCredentialManager
- java.lang.Object
-
- com.microsoft.azure.toolkit.lib.auth.TokenCredentialManager
-
- All Implemented Interfaces:
SubscriptionProvider,TenantProvider
- Direct Known Subclasses:
TokenCredentialManagerWithCache
public class TokenCredentialManager extends Object implements TenantProvider, SubscriptionProvider
-
-
Field Summary
Fields Modifier and Type Field Description protected java.util.function.Function<String,com.azure.core.credential.TokenCredential>credentialSupplierprotected Stringemailprotected com.azure.core.management.AzureEnvironmentenvironmentprivate static com.azure.core.util.logging.ClientLoggerLOGGERprotected java.util.function.Supplier<com.azure.core.credential.TokenCredential>rootCredentialSupplier
-
Constructor Summary
Constructors Constructor Description TokenCredentialManager()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private static com.azure.resourcemanager.resources.ResourceManager.ConfigurableconfigureAzure()TODO: share the same code for creating ResourceManager.Configurableprivate com.azure.resourcemanager.resources.ResourceManager.AuthenticatedcreateAzureClient(com.azure.core.management.AzureEnvironment env)private com.azure.resourcemanager.resources.ResourceManager.AuthenticatedcreateAzureClient(com.azure.core.management.AzureEnvironment env, String tenantId)com.azure.core.credential.TokenCredentialcreateTokenCredentialForTenant(String tenantId)private static com.azure.core.http.policy.HttpPipelinePolicycreateUserAgentPolicy()reactor.core.publisher.Mono<List<com.microsoft.azure.toolkit.lib.common.model.Subscription>>listSubscriptions(List<String> tenantIds)private static reactor.core.publisher.Mono<List<com.microsoft.azure.toolkit.lib.common.model.Subscription>>listSubscriptionsInTenant(com.azure.resourcemanager.resources.ResourceManager.Authenticated client, String tenantId)reactor.core.publisher.Mono<List<String>>listTenants()private static com.microsoft.azure.toolkit.lib.common.model.SubscriptiontoSubscriptionEntity(String tenantId, com.azure.resourcemanager.resources.models.Subscription subscription)
-
-
-
Field Detail
-
LOGGER
private static final com.azure.core.util.logging.ClientLogger LOGGER
-
environment
protected com.azure.core.management.AzureEnvironment environment
-
email
protected String email
-
rootCredentialSupplier
protected java.util.function.Supplier<com.azure.core.credential.TokenCredential> rootCredentialSupplier
-
credentialSupplier
protected java.util.function.Function<String,com.azure.core.credential.TokenCredential> credentialSupplier
-
-
Method Detail
-
createTokenCredentialForTenant
public com.azure.core.credential.TokenCredential createTokenCredentialForTenant(String tenantId)
-
listTenants
public reactor.core.publisher.Mono<List<String>> listTenants()
- Specified by:
listTenantsin interfaceTenantProvider
-
listSubscriptions
public reactor.core.publisher.Mono<List<com.microsoft.azure.toolkit.lib.common.model.Subscription>> listSubscriptions(List<String> tenantIds)
- Specified by:
listSubscriptionsin interfaceSubscriptionProvider
-
listSubscriptionsInTenant
private static reactor.core.publisher.Mono<List<com.microsoft.azure.toolkit.lib.common.model.Subscription>> listSubscriptionsInTenant(com.azure.resourcemanager.resources.ResourceManager.Authenticated client, String tenantId)
-
toSubscriptionEntity
private static com.microsoft.azure.toolkit.lib.common.model.Subscription toSubscriptionEntity(String tenantId, com.azure.resourcemanager.resources.models.Subscription subscription)
-
createAzureClient
private com.azure.resourcemanager.resources.ResourceManager.Authenticated createAzureClient(com.azure.core.management.AzureEnvironment env, String tenantId)
-
createAzureClient
private com.azure.resourcemanager.resources.ResourceManager.Authenticated createAzureClient(com.azure.core.management.AzureEnvironment env)
-
configureAzure
private static com.azure.resourcemanager.resources.ResourceManager.Configurable configureAzure()
TODO: share the same code for creating ResourceManager.Configurable
-
createUserAgentPolicy
private static com.azure.core.http.policy.HttpPipelinePolicy createUserAgentPolicy()
-
-