lib/fog/azurerm/credentials.rb in gitlab-fog-azure-rm-1.5.0 vs lib/fog/azurerm/credentials.rb in gitlab-fog-azure-rm-1.6.0
- old
+ new
@@ -1,17 +1,21 @@
module Fog
module Credentials
# This class is managing credentials token
class AzureRM
- def self.get_credentials(tenant_id, client_id, client_secret, environment = ENVIRONMENT_AZURE_CLOUD)
+ class << self
+ include Fog::AzureRM::Utilities::General
+ end
+
+ def self.get_credentials(tenant_id, client_id, client_secret, environment = Fog::AzureRM::ENVIRONMENT_AZURE_CLOUD)
if @credentials.nil? || new_management_credential?(tenant_id, client_id, client_secret, environment)
get_new_credentials(tenant_id, client_id, client_secret, environment)
else
@credentials
end
end
- def self.get_token(tenant_id, client_id, client_secret, environment = ENVIRONMENT_AZURE_CLOUD)
+ def self.get_token(tenant_id, client_id, client_secret, environment = Fog::AzureRM::ENVIRONMENT_AZURE_CLOUD)
get_credentials(tenant_id, client_id, client_secret, environment) if @credentials.nil?
@token_provider.get_authentication_header
end
def self.get_new_credentials(tenant_id, client_id, client_secret, environment)