private_address_check 0.4.0 → 0.4.1
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.
Potentially problematic release.
This version of private_address_check might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/lib/private_address_check.rb +28 -14
- data/lib/private_address_check/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c1a4bcbc9ec82314b86bb620261268077132d6c9
|
4
|
+
data.tar.gz: fe1ecc17c73d3cef97a38e9bc845089e42b360f1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6b7551e633389296e49e25687a29fbd066614e37ef103dd6745dc6f7b3a332c3e0c500a1a1eb8196dd46ef8cc38041980b483b49426f531aeea98b05a1de4457
|
7
|
+
data.tar.gz: dd232f46857c690672d00a68a245026f1701775f8e34f017ee6fc48a3d04e75ffd7ec89da4ab6ba7e19e276005bbbedea99ba1089036663c751de04e03287e5b
|
@@ -6,21 +6,35 @@ require "private_address_check/version"
|
|
6
6
|
module PrivateAddressCheck
|
7
7
|
module_function
|
8
8
|
|
9
|
+
# https://en.wikipedia.org/wiki/Reserved_IP_addresses
|
9
10
|
CIDR_LIST = [
|
10
|
-
# Loopback
|
11
|
-
IPAddr.new("
|
12
|
-
IPAddr.new("
|
13
|
-
|
14
|
-
#
|
15
|
-
IPAddr.new("
|
16
|
-
|
17
|
-
#
|
18
|
-
IPAddr.new("
|
19
|
-
IPAddr.new("
|
20
|
-
IPAddr.new("192.168.0.0/16"),
|
21
|
-
|
22
|
-
#
|
23
|
-
IPAddr.new("
|
11
|
+
IPAddr.new("127.0.0.0/8"), # Loopback
|
12
|
+
IPAddr.new("::1/128"), # Loopback
|
13
|
+
IPAddr.new("0.0.0.0/8"), # Current network (only valid as source address)
|
14
|
+
IPAddr.new("169.254.0.0/16"), # Link-local
|
15
|
+
IPAddr.new("10.0.0.0/8"), # Private network
|
16
|
+
IPAddr.new("100.64.0.0/10"), # Shared Address Space
|
17
|
+
IPAddr.new("172.16.0.0/12"), # Private network
|
18
|
+
IPAddr.new("192.0.0.0/24"), # IETF Protocol Assignments
|
19
|
+
IPAddr.new("192.0.2.0/24"), # TEST-NET-1, documentation and examples
|
20
|
+
IPAddr.new("192.88.99.0/24"), # IPv6 to IPv4 relay (includes 2002::/16)
|
21
|
+
IPAddr.new("192.168.0.0/16"), # Private network
|
22
|
+
IPAddr.new("198.18.0.0/15"), # Network benchmark tests
|
23
|
+
IPAddr.new("198.51.100.0/24"), # TEST-NET-2, documentation and examples
|
24
|
+
IPAddr.new("203.0.113.0/24"), # TEST-NET-3, documentation and examples
|
25
|
+
IPAddr.new("224.0.0.0/4"), # IP multicast (former Class D network)
|
26
|
+
IPAddr.new("240.0.0.0/4"), # Reserved (former Class E network)
|
27
|
+
IPAddr.new("255.255.255.255"), # Broadcast
|
28
|
+
IPAddr.new("64:ff9b::/96"), # IPv4/IPv6 translation (RFC 6052)
|
29
|
+
IPAddr.new("100::/64"), # Discard prefix (RFC 6666)
|
30
|
+
IPAddr.new("2001::/32"), # Teredo tunneling
|
31
|
+
IPAddr.new("2001:10::/28"), # Deprecated (previously ORCHID)
|
32
|
+
IPAddr.new("2001:20::/28"), # ORCHIDv2
|
33
|
+
IPAddr.new("2001:db8::/32"), # Addresses used in documentation and example source code
|
34
|
+
IPAddr.new("2002::/16"), # 6to4
|
35
|
+
IPAddr.new("fc00::/7"), # Unique local address
|
36
|
+
IPAddr.new("fe80::/10"), # Link-local address
|
37
|
+
IPAddr.new("ff00::/8") # Multicast
|
24
38
|
]
|
25
39
|
|
26
40
|
def private_address?(address)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: private_address_check
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- John Downey
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-11-
|
11
|
+
date: 2017-11-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|