azure-armrest 0.1.3 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3e89c3fbbfe48ed417ffd5ffd8a7d0c31d99ac0b
4
- data.tar.gz: a7dffd29227228c2a59e4e4b1bdf751fd1dc052a
3
+ metadata.gz: b38ce81faf1e7a3998d3d6cd13eb2b0355ba74a5
4
+ data.tar.gz: bed848faad0986fbaf58291d40786064ece38bbf
5
5
  SHA512:
6
- metadata.gz: ae33ec0c1675d5c13bb674d7bea315aac0eb3657ec854d8c98e1aab4c024f4d4cfff4c9f0616feaf9c0f25424784307fd13e67ad1eb0ff1080c2e4e0a8f2ac6b
7
- data.tar.gz: 77ae01437b56cf5322885e6c19850c94ccce7d3d4654ece3b1bf25f3e144cf40544b0dad68d1f718b0a7564aeabf5c44ad2fcda990add72fb862c07beaffd4f0
6
+ metadata.gz: 3d3c9da030fd7fbd38a255569898effe664a5018ebde842c2b174cd9a68cecdac89346098190ad052e4439afc461ac4a529a6b9e7c7c73910834b19abb644b3c
7
+ data.tar.gz: 015da585475887f7b3e223dbcf798608555de9b277f05aab3af95d9b23b024946b46bd0ef0ff930f4d87940d22df78b7c6b2d4519bc497ab099892cbf720ccfe
data/CHANGES CHANGED
@@ -1,3 +1,8 @@
1
+ = 0.2.0 - 10-Mar-2016
2
+ * The Armrest.configure method now supports the :ssl_verify and :ssl_version
3
+ options. By default, the ssl_version option is set to TLSv1 instead of
4
+ using older defaults used by Ruby's net-http library.
5
+
1
6
  = 0.1.3 - 7-Mar-2016
2
7
  * StorageAccount model objects now have their proxy value automatically
3
8
  set to whatever the proxy was set to in the configuration argument
@@ -17,7 +17,9 @@ module Azure
17
17
  :accept,
18
18
  :token,
19
19
  :token_expiration, # token expiration local system date
20
- :proxy
20
+ :proxy,
21
+ :ssl_verify,
22
+ :ssl_version
21
23
  ) do
22
24
  @@tokens = Hash.new([])
23
25
 
@@ -39,8 +41,10 @@ module Azure
39
41
 
40
42
  response = JSON.parse(
41
43
  ArmrestService.rest_post(
42
- :url => token_url,
43
- :proxy => proxy,
44
+ :url => token_url,
45
+ :proxy => proxy,
46
+ :ssl_version => ssl_version,
47
+ :ssl_verify => ssl_verify,
44
48
  :payload => {
45
49
  :grant_type => grant_type,
46
50
  :client_id => client_id,
@@ -74,6 +78,12 @@ module Azure
74
78
  # The http proxy used for each request. Uses ENV['http_proxy'] if set.
75
79
  attr_accessor :proxy
76
80
 
81
+ # The SSL verification method used for each request. The default is VERIFY_PEER.
82
+ attr_accessor :ssl_verify
83
+
84
+ # The SSL version used for each request. The default is TLSv1.
85
+ attr_accessor :ssl_version
86
+
77
87
  @@providers_hash = {} # Set in constructor
78
88
 
79
89
  @@tokens = {} # token caches
@@ -96,6 +106,9 @@ module Azure
96
106
  # - accept
97
107
  # - token,
98
108
  # - token_expiration
109
+ # - proxy
110
+ # - ssl_verify
111
+ # - ssl_version
99
112
  #
100
113
  # Of these, you should include a client_id, client_key and tenant_id.
101
114
  # The resource_group can be specified here, but many methods allow you
@@ -128,12 +141,19 @@ module Azure
128
141
  raise ArgumentError, "client_id and client_key must be specified"
129
142
  end
130
143
 
131
- configuration.api_version ||= '2015-01-01'
132
- configuration.grant_type ||= 'client_credentials'
133
- configuration.content_type ||= 'application/json'
134
- configuration.accept ||= 'application/json'
144
+ # Set default values for certain configuration items.
145
+ configuration.api_version ||= '2015-01-01'
146
+ configuration.grant_type ||= 'client_credentials'
147
+ configuration.content_type ||= 'application/json'
148
+ configuration.accept ||= 'application/json'
149
+ configuration.proxy ||= ENV['http_proxy']
150
+ configuration.ssl_version ||= 'TLSv1'
151
+
152
+ # Allows for URI objects or Strings.
153
+ configuration.proxy = configuration.proxy.to_s if configuration.proxy
154
+
155
+ # After all other config options have been set, look for default subscription.
135
156
  configuration.subscription_id ||= fetch_subscription_id(configuration)
136
- configuration.proxy ||= ENV['http_proxy']
137
157
 
138
158
  configuration
139
159
  end
@@ -146,8 +166,10 @@ module Azure
146
166
  url = File.join(Azure::Armrest::RESOURCE, "subscriptions?api-version=#{config.api_version}")
147
167
 
148
168
  response = rest_get(
149
- :url => url,
150
- :proxy => config.proxy,
169
+ :url => url,
170
+ :proxy => config.proxy,
171
+ :ssl_version => config.ssl_version,
172
+ :ssl_verify => config.ssl_verify,
151
173
  :headers => {
152
174
  :content_type => config.content_type,
153
175
  :authorization => config.token
@@ -379,8 +401,10 @@ module Azure
379
401
 
380
402
  def rest_execute(url, body = nil, http_method = :get)
381
403
  options = {
382
- :url => url,
383
- :proxy => configuration.proxy,
404
+ :url => url,
405
+ :proxy => configuration.proxy,
406
+ :ssl_version => configuration.ssl_version,
407
+ :ssl_verify => configuration.ssl_verify,
384
408
  :headers => {
385
409
  :accept => configuration.accept,
386
410
  :content_type => configuration.content_type,
@@ -1,5 +1,5 @@
1
1
  module Azure
2
2
  module Armrest
3
- VERSION = "0.1.3"
3
+ VERSION = "0.2.0"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: azure-armrest
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel J. Berger
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2016-03-07 00:00:00.000000000 Z
14
+ date: 2016-03-10 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: json