gitlab-fog-azure-rm 2.0.1 → 2.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/azure/core/utility.rb +0 -51
- data/lib/azure/storage/common/core/utility.rb +0 -50
- data/lib/fog/azurerm/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4d92167cf3193f73d9c97ae76465057206f076c4f2a14e1f8a12c677d77ca2f0
|
4
|
+
data.tar.gz: 04fce79fa98d5f6dbb512dc974678be18ccb45cc84921c6914e61a60f4a6a62c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a4eca952fa0daa27b5149654960ae75b4b875d128114388f2cc539b3a3e1bdd2874e03456f60b8da7a2b05f5d994cdcd58962940e2abc1c328bdddfec2f86960
|
7
|
+
data.tar.gz: b503003e15965b9076b1ad75b25fd1282dfae71f4eacd806be13c6bc004a9bad5843c491c568fe4ff7cc42e09f9d6ac367c4fc7db9b27efa62288badb5f3477b
|
data/CHANGELOG.md
CHANGED
data/lib/azure/core/utility.rb
CHANGED
@@ -13,8 +13,6 @@
|
|
13
13
|
# limitations under the License.
|
14
14
|
#--------------------------------------------------------------------------
|
15
15
|
|
16
|
-
require 'ipaddr'
|
17
|
-
|
18
16
|
if RUBY_VERSION.to_f < 2.0
|
19
17
|
begin
|
20
18
|
require 'Win32/Console/ANSI' if RUBY_PLATFORM =~ /win32|mingw32/
|
@@ -192,53 +190,4 @@ class String
|
|
192
190
|
end
|
193
191
|
end
|
194
192
|
|
195
|
-
# Code validate private/public IP acceptable ranges.
|
196
|
-
class IPAddr
|
197
|
-
PRIVATE_RANGES = [
|
198
|
-
IPAddr.new('10.0.0.0/8'),
|
199
|
-
IPAddr.new('172.16.0.0/12'),
|
200
|
-
IPAddr.new('192.168.0.0/16')
|
201
|
-
]
|
202
|
-
|
203
|
-
def private?
|
204
|
-
return false unless self.ipv4?
|
205
|
-
PRIVATE_RANGES.each do |ipr|
|
206
|
-
return true if ipr.include?(self)
|
207
|
-
end
|
208
|
-
false
|
209
|
-
end
|
210
|
-
|
211
|
-
def public?
|
212
|
-
!private?
|
213
|
-
end
|
214
|
-
|
215
|
-
class << self
|
216
|
-
def validate_ip_and_prefix(ip, cidr)
|
217
|
-
if cidr.to_s.empty?
|
218
|
-
raise "Cidr is missing for IP '#{ip}'."
|
219
|
-
elsif valid?(ip)
|
220
|
-
raise "Ip address '#{ip}' is invalid."
|
221
|
-
elsif !IPAddr.new(ip).private?
|
222
|
-
raise "Ip Address #{ip} must be private."
|
223
|
-
end
|
224
|
-
end
|
225
|
-
|
226
|
-
def validate_address_space(ip)
|
227
|
-
if ip.split('/').size != 2
|
228
|
-
raise "Cidr is invalid for IP #{ip}."
|
229
|
-
elsif valid?(ip)
|
230
|
-
raise "Address space '#{ip}' is invalid."
|
231
|
-
end
|
232
|
-
end
|
233
|
-
|
234
|
-
def address_prefix(ip, cidr)
|
235
|
-
ip + '/' + cidr.to_s
|
236
|
-
end
|
237
|
-
|
238
|
-
def valid?(ip)
|
239
|
-
(IPAddr.new(ip) rescue nil).nil?
|
240
|
-
end
|
241
|
-
end
|
242
|
-
end
|
243
|
-
|
244
193
|
Azure::Loggerx = Azure::Core::Logger
|
@@ -24,7 +24,6 @@
|
|
24
24
|
# THE SOFTWARE.
|
25
25
|
#--------------------------------------------------------------------------
|
26
26
|
|
27
|
-
require "ipaddr"
|
28
27
|
require "azure/storage/common/core/error"
|
29
28
|
|
30
29
|
if RUBY_VERSION.to_f < 2.0
|
@@ -210,52 +209,3 @@ class String
|
|
210
209
|
end
|
211
210
|
end
|
212
211
|
end
|
213
|
-
|
214
|
-
# Code validate private/public IP acceptable ranges.
|
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
|
-
|
222
|
-
def private?
|
223
|
-
return false unless self.ipv4?
|
224
|
-
PRIVATE_RANGES.each do |ipr|
|
225
|
-
return true if ipr.include?(self)
|
226
|
-
end
|
227
|
-
false
|
228
|
-
end
|
229
|
-
|
230
|
-
def public?
|
231
|
-
!private?
|
232
|
-
end
|
233
|
-
|
234
|
-
class << self
|
235
|
-
def validate_ip_and_prefix(ip, cidr)
|
236
|
-
if cidr.to_s.empty?
|
237
|
-
raise "Cidr is missing for IP '#{ip}'."
|
238
|
-
elsif valid?(ip)
|
239
|
-
raise "Ip address '#{ip}' is invalid."
|
240
|
-
elsif !IPAddr.new(ip).private?
|
241
|
-
raise "Ip Address #{ip} must be private."
|
242
|
-
end
|
243
|
-
end
|
244
|
-
|
245
|
-
def validate_address_space(ip)
|
246
|
-
if ip.split("/").size != 2
|
247
|
-
raise "Cidr is invalid for IP #{ip}."
|
248
|
-
elsif valid?(ip)
|
249
|
-
raise "Address space '#{ip}' is invalid."
|
250
|
-
end
|
251
|
-
end
|
252
|
-
|
253
|
-
def address_prefix(ip, cidr)
|
254
|
-
ip + "/" + cidr.to_s
|
255
|
-
end
|
256
|
-
|
257
|
-
def valid?(ip)
|
258
|
-
(IPAddr.new(ip) rescue nil).nil?
|
259
|
-
end
|
260
|
-
end
|
261
|
-
end
|
data/lib/fog/azurerm/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gitlab-fog-azure-rm
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0
|
4
|
+
version: 2.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Shaffan Chaudhry
|
@@ -18,7 +18,7 @@ authors:
|
|
18
18
|
autorequire:
|
19
19
|
bindir: bin
|
20
20
|
cert_chain: []
|
21
|
-
date: 2024-
|
21
|
+
date: 2024-08-17 00:00:00.000000000 Z
|
22
22
|
dependencies:
|
23
23
|
- !ruby/object:Gem::Dependency
|
24
24
|
name: codeclimate-test-reporter
|