File: default.rb

package info (click to toggle)
ruby-ms-rest-azure 0.12.0-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye
  • size: 200 kB
  • sloc: ruby: 906; makefile: 4
file content (57 lines) | stat: -rw-r--r-- 1,404 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
# encoding: utf-8
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.

module MsRestAzure::Common
  module Default
    class << self
      #
      # Default Azure Tenant Id.
      # @return [String] Azure Tenant Id.
      #
      def tenant_id
        ENV['AZURE_TENANT_ID']
      end

      #
      # Default Azure Client Id.
      # @return [String] Azure Client Id.
      #
      def client_id
        ENV['AZURE_CLIENT_ID']
      end

      #
      # Default Azure Client Secret.
      # @return [String] Azure Client Secret.
      #
      def client_secret
        ENV['AZURE_CLIENT_SECRET']
      end

      #
      # Default Azure Subscription Id.
      # @return [String] Azure Subscription Id.
      #
      def subscription_id
        ENV['AZURE_SUBSCRIPTION_ID']
      end

      #
      # Default Azure Active Directory Service Settings.
      # @return [MsRestAzure::ActiveDirectoryServiceSettings] Azure Active Directory Service Settings.
      #
      def active_directory_settings
        MsRestAzure::ActiveDirectoryServiceSettings.get_azure_settings
      end

      #
      # Configuration options.
      # @return [Hash] Configuration options.
      #
      def options
        Hash[MsRestAzure::Common::Configurable.keys.map { |key| [key, send(key)]}]
      end
    end
  end
end