atech 1.0.31 → 1.0.32
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/atech/network_restrictions.rb +8 -8
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 078718173184fab300fff58a471791c570a1e898
|
4
|
+
data.tar.gz: 468fabe3522c79e3648e9d3fa92d2409cbc9984f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 897645789bc544fa9b61ca78b600edf222e1e05beed76e177f0c2293e80e1975293efcaf8589e5400b2fc81c447a9ae79b28229d0b785ecb7e53ad52301df5f5
|
7
|
+
data.tar.gz: 51c8e7340ef8a0fb5a218016aa58cb339925627c43a7de869937eaf7cb2eb3103c27f9c6ad8b040a2a51b5c012ac5e04660b7923a1bab7ce6c5098afc45749ce
|
@@ -21,10 +21,10 @@ require 'ipaddr'
|
|
21
21
|
|
22
22
|
module Atech
|
23
23
|
module NetworkRestrictions
|
24
|
-
|
24
|
+
|
25
25
|
class << self
|
26
26
|
attr_accessor :networks
|
27
|
-
|
27
|
+
|
28
28
|
def networks
|
29
29
|
@networks ||= [
|
30
30
|
'127.0.0.1/32', # localhost
|
@@ -32,15 +32,15 @@ module Atech
|
|
32
32
|
'10.0.0.0/16', # vpn nets
|
33
33
|
'2a00:67a0:a:1::/64', # infra ipv6
|
34
34
|
'2a00:67a0:a:5::/64', # vpn ipv6
|
35
|
-
'
|
36
|
-
'
|
35
|
+
'2a02:8010:6006::/64', # office ipv6
|
36
|
+
'2a02:8011:701f:0::/64'
|
37
37
|
]
|
38
38
|
end
|
39
|
-
|
39
|
+
|
40
40
|
def approved_ip?(requested_ip)
|
41
41
|
!!approved_ip(requested_ip)
|
42
42
|
end
|
43
|
-
|
43
|
+
|
44
44
|
def approved_ip(requested_ip)
|
45
45
|
self.networks.each do |i|
|
46
46
|
if IPAddr.new(i).include?(requested_ip)
|
@@ -56,12 +56,12 @@ module Atech
|
|
56
56
|
end
|
57
57
|
end
|
58
58
|
end
|
59
|
-
|
59
|
+
|
60
60
|
class RouteConstraint
|
61
61
|
def self.matches?(request)
|
62
62
|
Atech::NetworkRestrictions.approved_ip?(request.ip)
|
63
63
|
end
|
64
64
|
end
|
65
|
-
|
65
|
+
|
66
66
|
end
|
67
67
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: atech
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.32
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- aTech Media
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-05-09 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description:
|
14
14
|
email: hello@atechmedia.com
|
@@ -45,7 +45,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
45
45
|
version: '0'
|
46
46
|
requirements: []
|
47
47
|
rubyforge_project:
|
48
|
-
rubygems_version: 2.
|
48
|
+
rubygems_version: 2.5.1
|
49
49
|
signing_key:
|
50
50
|
specification_version: 4
|
51
51
|
summary: Libraries & Utilities from aTech Media
|