Class: GraphRbac
- Inherits:
-
Object
- Object
- GraphRbac
- Defined in:
- lib/train/transports/clients/azure/graph_rbac.rb
Overview
Wrapper class for ::Azure::GraphRbac::Profiles::Latest::Client allowing custom configuration, for example, defining additional settings for the ::MsRestAzure::ApplicationTokenProvider.
Constant Summary collapse
- AUTH_ENDPOINT =
MsRestAzure::AzureEnvironments::AzureCloud.active_directory_endpoint_url
- API_ENDPOINT =
MsRestAzure::AzureEnvironments::AzureCloud.active_directory_graph_resource_id
Class Method Summary collapse
Class Method Details
.client(credentials) ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/train/transports/clients/azure/graph_rbac.rb', line 10 def self.client(credentials) provider = ::MsRestAzure::ApplicationTokenProvider.new( credentials[:tenant_id], credentials[:client_id], credentials[:client_secret], settings, ) credentials[:credentials] = ::MsRest::TokenCredentials.new(provider) credentials[:base_url] = API_ENDPOINT ::Azure::GraphRbac::Profiles::Latest::Client.new(credentials) end |
.settings ⇒ Object
22 23 24 25 26 27 |
# File 'lib/train/transports/clients/azure/graph_rbac.rb', line 22 def self.settings client_settings = MsRestAzure::ActiveDirectoryServiceSettings.get_azure_settings client_settings.authentication_endpoint = AUTH_ENDPOINT client_settings.token_audience = API_ENDPOINT client_settings end |