azure-storage-common 2.0.2 → 2.0.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA256:
3
- metadata.gz: 643d6f89a6ebfc972664a2b3f59d06ef341e8f65cdabc087b57277cd421108c0
4
- data.tar.gz: 636223cebe99000051c37a4cfb76afb655ff406ef4d1797a5d854002dd751d45
2
+ SHA1:
3
+ metadata.gz: 67a4e2d9b8e0b5eb89af5960ba865fb74ff08a02
4
+ data.tar.gz: fc1270f20cc5eb24a9316d8122ff4e44b8167bc2
5
5
  SHA512:
6
- metadata.gz: 6af15e2b3fbe43c79c9f75c66dafb82778e0ba888284c9afa9666d7fe712f629789c46f46fbfaf627f42f20e61f26df56614414387f3621b64487c754c6b4075
7
- data.tar.gz: 1b0ab5ad964bdc731ff62e468a96486189af272adcdb109b40bc652d34229bda5bcf80754df199d35ac77a45d533e3579b697349acc6662de3550bcfbd47c555
6
+ metadata.gz: 70b0c59e677f127ffef1ab4c0ccad7c7b83407bcd3f5a0902f1bc0c8c013eb49ff8ea5663234eaa39a85a840c9befb3e5b40630d0d20d83c5317c55a5b0ea57e
7
+ data.tar.gz: fb4f9d5cf70881e57957e685e751ac37a40ad826eaa0900eeefcb3011761aaee3a3923b7d0972ed097688cc38ecc53ec46d5b125b7498553db05bb8ebc788da4
@@ -125,7 +125,7 @@ module Azure::Storage::Common
125
125
  #
126
126
  # @return [Azure::Storage::Common::Client]
127
127
  def create(options = {}, &block)
128
- client = Client.new(options, &block)
128
+ Client.new(options, &block)
129
129
  end
130
130
 
131
131
  # Public: Creates an instance of [Azure::Storage::Common::Client] with Storage Emulator
@@ -137,14 +137,14 @@ module Azure::Storage::Common
137
137
  # @return [Azure::Storage::Common::Client]
138
138
  def create_development(proxy_uri = nil, &block)
139
139
  proxy_uri ||= StorageServiceClientConstants::DEV_STORE_URI
140
- client = create(use_development_storage: true, development_storage_proxy_uri: proxy_uri, &block)
140
+ create(use_development_storage: true, development_storage_proxy_uri: proxy_uri, &block)
141
141
  end
142
142
 
143
143
  # Public: Creates an instance of [Azure::Storage::Common::Client] from Environment Variables
144
144
  #
145
145
  # @return [Azure::Storage::Client]
146
146
  def create_from_env(&block)
147
- client = create(&block)
147
+ create(&block)
148
148
  end
149
149
 
150
150
  # Public: Creates an instance of [Azure::Storage::Common::Client] from Environment Variables
@@ -155,7 +155,7 @@ module Azure::Storage::Common
155
155
  #
156
156
  # @return [Azure::Storage::Common::Client]
157
157
  def create_from_connection_string(connection_string, &block)
158
- client = Client.new(connection_string, &block)
158
+ Client.new(connection_string, &block)
159
159
  end
160
160
  end
161
161
  end
@@ -191,7 +191,7 @@ module Azure::Storage::Common
191
191
  storage_file_host: "#{proxy_uri}:#{StorageServiceClientConstants::DEVSTORE_FILE_HOST_PORT}",
192
192
  use_path_style_uri: true)
193
193
  return results
194
- rescue InvalidOptionsError => e
194
+ rescue InvalidOptionsError
195
195
  end
196
196
 
197
197
  # P2 - explicit hosts with account connection string
@@ -202,7 +202,7 @@ module Azure::Storage::Common
202
202
  results[:use_path_style_uri] = results.key?(:use_path_style_uri)
203
203
  normalize_hosts(results)
204
204
  return results
205
- rescue InvalidOptionsError => e
205
+ rescue InvalidOptionsError
206
206
  end
207
207
 
208
208
  # P3 - account name and key or sas with default hosts or an end suffix
@@ -220,7 +220,7 @@ module Azure::Storage::Common
220
220
  storage_file_host: "#{protocol}://#{account}.#{ServiceType::FILE}.#{suffix}",
221
221
  use_path_style_uri: false)
222
222
  return results
223
- rescue InvalidOptionsError => e
223
+ rescue InvalidOptionsError
224
224
  end
225
225
 
226
226
  # P4 - explicit hosts with account name and key
@@ -232,7 +232,7 @@ module Azure::Storage::Common
232
232
  results[:use_path_style_uri] = results.key?(:use_path_style_uri)
233
233
  normalize_hosts(results)
234
234
  return results
235
- rescue InvalidOptionsError => e
235
+ rescue InvalidOptionsError
236
236
  end
237
237
 
238
238
  # P5 - anonymous or sas only for one or more particular services, options with account name/key + hosts should be already validated in P4
@@ -245,7 +245,7 @@ module Azure::Storage::Common
245
245
  # Adds anonymous signer if no sas token
246
246
  results[:signer] = Azure::Storage::Common::Core::Auth::AnonymousSigner.new unless results.key?(:storage_sas_token)
247
247
  return results
248
- rescue InvalidOptionsError => e
248
+ rescue InvalidOptionsError
249
249
  end
250
250
 
251
251
  # P6 - account name and key or sas with explicit hosts
@@ -257,7 +257,7 @@ module Azure::Storage::Common
257
257
  results[:use_path_style_uri] = results.key?(:use_path_style_uri)
258
258
  normalize_hosts(results)
259
259
  return results
260
- rescue InvalidOptionsError => e
260
+ rescue InvalidOptionsError
261
261
  end
262
262
 
263
263
  raise InvalidOptionsError, "options provided are not valid set: #{opts}" # wrong opts if move to this line
@@ -347,7 +347,7 @@ module Azure::Storage::Common
347
347
  def parse_connection_string(connection_string)
348
348
  opts = {}
349
349
  connection_string.split(";").each do |i|
350
- e = i.index("=")
350
+ e = i.index("=") || -1
351
351
  raise InvalidConnectionStringError, Azure::Storage::Common::Core::SR::INVALID_CONNECTION_STRING if e < 0 || e == i.length - 1
352
352
  key, value = i[0..e - 1], i[e + 1..i.length - 1]
353
353
  raise InvalidConnectionStringError, Azure::Storage::Common::Core::SR::INVALID_CONNECTION_STRING_BAD_KEY % key unless ClientOptions.connection_string_mapping.key? key
@@ -213,6 +213,12 @@ end
213
213
 
214
214
  # Code validate private/public IP acceptable ranges.
215
215
  class IPAddr
216
+ PRIVATE_RANGES = [
217
+ IPAddr.new('10.0.0.0/8'),
218
+ IPAddr.new('172.16.0.0/12'),
219
+ IPAddr.new('192.168.0.0/16')
220
+ ]
221
+
216
222
  def private?
217
223
  return false unless self.ipv4?
218
224
  PRIVATE_RANGES.each do |ipr|
@@ -31,7 +31,7 @@ module Azure
31
31
  # Fields represent the parts defined in http://semver.org/
32
32
  MAJOR = 2 unless defined? MAJOR
33
33
  MINOR = 0 unless defined? MINOR
34
- UPDATE = 2 unless defined? UPDATE
34
+ UPDATE = 3 unless defined? UPDATE
35
35
 
36
36
  class << self
37
37
  # @return [String]
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: azure-storage-common
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.2
4
+ version: 2.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Microsoft Corporation
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-08-31 00:00:00.000000000 Z
11
+ date: 2021-10-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -267,7 +267,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
267
267
  - !ruby/object:Gem::Version
268
268
  version: '0'
269
269
  requirements: []
270
- rubygems_version: 3.0.0
270
+ rubyforge_project:
271
+ rubygems_version: 2.6.14.4
271
272
  signing_key:
272
273
  specification_version: 4
273
274
  summary: Official Ruby client library to consume Azure Storage Common service