nicinfo 1.4.1 → 1.5.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/lib/nicinfo/config.rb +2 -2
- data/lib/nicinfo/constants.rb +1 -1
- data/lib/nicinfo/demo/domain-dnr.json +2 -2
- data/lib/nicinfo/demo/entities.json +4 -4
- data/lib/nicinfo/demo/entity-dnr.json +2 -2
- data/lib/nicinfo/demo/entity-rir.json +2 -2
- data/lib/nicinfo/demo/error-code.json +3 -3
- data/lib/nicinfo/demo/nameservers.json +4 -4
- data/lib/nicinfo/demo/ns.json +2 -2
- data/lib/nicinfo/entity.rb +79 -77
- data/lib/nicinfo/nicinfo_main.rb +9 -7
- data/lib/nicinfo/utils.rb +3 -2
- metadata +10 -16
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 470a293eeb983a569b1c4c6b4efcf8db8362059964723fdbc0bb6dc92ccd3af0
|
4
|
+
data.tar.gz: ecc75c45646580c50bf742d75857d546227a2b52c375229665aa79c8d255d116
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c2ed93b9c261ed090e753f1b2ec20c28be87334be110eff77fba25e7ca96c9705320877482c448bfb5a6adf6451555fc1245bbda29ca1c1fd5aa9a0e7aad3baa
|
7
|
+
data.tar.gz: 66b285a0c792cb0b4dbabd5d4a62c79039723110c26489bea8f8e1ff1dd45ac7eb4926610faff5ba98ebd64ac4244f9b423e0795424d31fc329b5545f94d9c4c
|
data/lib/nicinfo/config.rb
CHANGED
@@ -315,9 +315,9 @@ cache:
|
|
315
315
|
bootstrap:
|
316
316
|
|
317
317
|
# The base or bootstrap URL. Specifying this will bypass all built-in bootstrapping.
|
318
|
-
#base_url: https://rdap.arin.net/bootstrap
|
318
|
+
#base_url: https://rdap-bootstrap.arin.net/bootstrap
|
319
319
|
|
320
|
-
help_root_url: https://rdap.arin.net/bootstrap
|
320
|
+
help_root_url: https://rdap-bootstrap.arin.net/bootstrap
|
321
321
|
|
322
322
|
entity_root_url: https://rdap.arin.net/registry
|
323
323
|
|
data/lib/nicinfo/constants.rb
CHANGED
@@ -506,9 +506,9 @@
|
|
506
506
|
],
|
507
507
|
"links":[
|
508
508
|
{
|
509
|
-
"value":"https://rdap.arin.net/bootstrap/domain/xn--fo-5ja.example",
|
509
|
+
"value":"https://rdap-bootstrap.arin.net/bootstrap/domain/xn--fo-5ja.example",
|
510
510
|
"rel":"self",
|
511
|
-
"href":"https://rdap.arin.net/bootstrap/domain/xn--fo-5ja.example"
|
511
|
+
"href":"https://rdap-bootstrap.arin.net/bootstrap/domain/xn--fo-5ja.example"
|
512
512
|
}
|
513
513
|
],
|
514
514
|
"port43":"whois.example.net",
|
@@ -147,9 +147,9 @@
|
|
147
147
|
],
|
148
148
|
"links": [
|
149
149
|
{
|
150
|
-
"value": "https://rdap.arin.net/bootstrap/entity/entity-dnr",
|
150
|
+
"value": "https://rdap-bootstrap.arin.net/bootstrap/entity/entity-dnr",
|
151
151
|
"rel": "self",
|
152
|
-
"href": "https://rdap.arin.net/bootstrap/entity/entity-dnr"
|
152
|
+
"href": "https://rdap-bootstrap.arin.net/bootstrap/entity/entity-dnr"
|
153
153
|
}
|
154
154
|
],
|
155
155
|
"port43": "whois.example.net",
|
@@ -286,9 +286,9 @@
|
|
286
286
|
],
|
287
287
|
"links": [
|
288
288
|
{
|
289
|
-
"value": "https://rdap.arin.net/bootstrap/entity/foo1",
|
289
|
+
"value": "https://rdap-bootstrap.arin.net/bootstrap/entity/foo1",
|
290
290
|
"rel": "self",
|
291
|
-
"href": "https://rdap.arin.net/bootstrap/entity/foo1"
|
291
|
+
"href": "https://rdap-bootstrap.arin.net/bootstrap/entity/foo1"
|
292
292
|
}
|
293
293
|
],
|
294
294
|
"events": [
|
@@ -123,9 +123,9 @@
|
|
123
123
|
],
|
124
124
|
"links":[
|
125
125
|
{
|
126
|
-
"value":"https://rdap.arin.net/bootstrap/entity/entity-dnr",
|
126
|
+
"value":"https://rdap-bootstrap.arin.net/bootstrap/entity/entity-dnr",
|
127
127
|
"rel":"self",
|
128
|
-
"href":"https://rdap.arin.net/bootstrap/entity/entity-dnr"
|
128
|
+
"href":"https://rdap-bootstrap.arin.net/bootstrap/entity/entity-dnr"
|
129
129
|
}
|
130
130
|
],
|
131
131
|
"port43":"whois.example.net",
|
@@ -132,9 +132,9 @@
|
|
132
132
|
],
|
133
133
|
"links":[
|
134
134
|
{
|
135
|
-
"value":"https://rdap.arin.net/bootstrap/entity/foo1",
|
135
|
+
"value":"https://rdap-bootstrap.arin.net/bootstrap/entity/foo1",
|
136
136
|
"rel":"self",
|
137
|
-
"href":"https://rdap.arin.net/bootstrap/entity/foo1"
|
137
|
+
"href":"https://rdap-bootstrap.arin.net/bootstrap/entity/foo1"
|
138
138
|
}
|
139
139
|
],
|
140
140
|
"events":[
|
@@ -14,7 +14,7 @@
|
|
14
14
|
],
|
15
15
|
"links":[
|
16
16
|
{
|
17
|
-
"value":"https://rdap.arin.net/bootstrap/entity/restricted",
|
17
|
+
"value":"https://rdap-bootstrap.arin.net/bootstrap/entity/restricted",
|
18
18
|
"rel":"terms-of-service",
|
19
19
|
"type":"text/html",
|
20
20
|
"href":"http://www.example.com/tos.html"
|
@@ -28,7 +28,7 @@
|
|
28
28
|
],
|
29
29
|
"links":[
|
30
30
|
{
|
31
|
-
"value":"https://rdap.arin.net/bootstrap/entity/restricted",
|
31
|
+
"value":"https://rdap-bootstrap.arin.net/bootstrap/entity/restricted",
|
32
32
|
"rel":"copyright",
|
33
33
|
"type":"text/html",
|
34
34
|
"href":"http://www.example.com/copyright.html"
|
@@ -43,7 +43,7 @@
|
|
43
43
|
],
|
44
44
|
"links":[
|
45
45
|
{
|
46
|
-
"value":"https://rdap.arin.net/bootstrap/entity/restricted",
|
46
|
+
"value":"https://rdap-bootstrap.arin.net/bootstrap/entity/restricted",
|
47
47
|
"rel":"about",
|
48
48
|
"type":"text/html",
|
49
49
|
"href":"https://lists.arin.net/mailman/listinfo/arin-tech-discuss"
|
@@ -45,9 +45,9 @@
|
|
45
45
|
],
|
46
46
|
"links":[
|
47
47
|
{
|
48
|
-
"value":"https://rdap.arin.net/bootstrap/nameserver/ns1.xn--fo-5ja.example",
|
48
|
+
"value":"https://rdap-bootstrap.arin.net/bootstrap/nameserver/ns1.xn--fo-5ja.example",
|
49
49
|
"rel":"self",
|
50
|
-
"href":"https://rdap.arin.net/bootstrap/nameserver/ns1.xn--fo-5ja.example"
|
50
|
+
"href":"https://rdap-bootstrap.arin.net/bootstrap/nameserver/ns1.xn--fo-5ja.example"
|
51
51
|
}
|
52
52
|
],
|
53
53
|
"port43":"whois.example.net",
|
@@ -248,9 +248,9 @@
|
|
248
248
|
],
|
249
249
|
"links":[
|
250
250
|
{
|
251
|
-
"value":"https://rdap.arin.net/bootstrap/nameserver/ns1.xn--fo-5ja.example",
|
251
|
+
"value":"https://rdap-bootstrap.arin.net/bootstrap/nameserver/ns1.xn--fo-5ja.example",
|
252
252
|
"rel":"self",
|
253
|
-
"href":"https://rdap.arin.net/bootstrap/nameserver/ns1.xn--fo-5ja.example"
|
253
|
+
"href":"https://rdap-bootstrap.arin.net/bootstrap/nameserver/ns1.xn--fo-5ja.example"
|
254
254
|
}
|
255
255
|
],
|
256
256
|
"port43":"whois.example.net",
|
data/lib/nicinfo/demo/ns.json
CHANGED
@@ -43,9 +43,9 @@
|
|
43
43
|
],
|
44
44
|
"links":[
|
45
45
|
{
|
46
|
-
"value":"https://rdap.arin.net/bootstrap/nameserver/ns1.xn--fo-5ja.example",
|
46
|
+
"value":"https://rdap-bootstrap.arin.net/bootstrap/nameserver/ns1.xn--fo-5ja.example",
|
47
47
|
"rel":"self",
|
48
|
-
"href":"https://rdap.arin.net/bootstrap/nameserver/ns1.xn--fo-5ja.example"
|
48
|
+
"href":"https://rdap-bootstrap.arin.net/bootstrap/nameserver/ns1.xn--fo-5ja.example"
|
49
49
|
}
|
50
50
|
],
|
51
51
|
"port43":"whois.example.net",
|
data/lib/nicinfo/entity.rb
CHANGED
@@ -131,96 +131,98 @@ module NicInfo
|
|
131
131
|
def process entity
|
132
132
|
if ( vcard = get_vcard( entity ) ) != nil
|
133
133
|
vcardElements = vcard[ 1 ]
|
134
|
-
if vcardElements.size == 0
|
134
|
+
if vcardElements.nil? || vcardElements.size == 0
|
135
135
|
@config.conf_msgs << "jCard (vCard) is empty."
|
136
136
|
elsif vcardElements[ 0 ][ 0 ] != "version"
|
137
137
|
@config.conf_msgs << "jCard (vCard) does not have required version first element."
|
138
138
|
end
|
139
|
-
vcardElements.
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
if element[ 0 ] == "n"
|
144
|
-
name = ""
|
145
|
-
if element[ 3 ][ -1 ].instance_of? Array
|
146
|
-
name << element[ 3 ][ -1 ].join( ' ' )
|
139
|
+
if !vcardElements.nil?
|
140
|
+
vcardElements.each do |element|
|
141
|
+
if element[ 0 ] == "fn"
|
142
|
+
@fns << element[ 3 ]
|
147
143
|
end
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
144
|
+
if element[ 0 ] == "n"
|
145
|
+
name = ""
|
146
|
+
if element[ 3 ][ -1 ].instance_of? Array
|
147
|
+
name << element[ 3 ][ -1 ].join( ' ' )
|
148
|
+
end
|
149
|
+
name << ' ' if name[-1] != ' '
|
150
|
+
name << element[ 3 ][ 1 ]
|
151
|
+
if element[ 3 ][ 2 ] && !element[ 3 ][ 2 ].empty?
|
152
|
+
name << " " << element[ 3 ][ 2 ]
|
153
|
+
end
|
154
|
+
if element[ 3 ][ 3 ] && !element[ 3 ][ 3 ].empty?
|
155
|
+
name << " " << element[ 3 ][ 3 ]
|
156
|
+
end
|
157
|
+
name << " " << element[ 3 ][ 0 ]
|
158
|
+
if element[ 3 ][ -2 ].instance_of? Array
|
159
|
+
name << " " << element[ 3 ][ -2 ].join( ' ' )
|
160
|
+
end
|
161
|
+
@names << name.strip
|
152
162
|
end
|
153
|
-
if element[
|
154
|
-
|
163
|
+
if element[ 0 ] == "tel"
|
164
|
+
tel = Tel.new
|
165
|
+
if (type = element[ 1 ][ "type" ]) != nil
|
166
|
+
tel.type << type if type.instance_of? String
|
167
|
+
tel.type = type if type.instance_of? Array
|
168
|
+
end
|
169
|
+
if (str = element[ 3 ] ).start_with?( "tel:" )
|
170
|
+
tel.number=str[ /^tel\:([^;]*)/,1 ]
|
171
|
+
tel.ext=str[ /[^;]*ext=(.*)/,1 ]
|
172
|
+
else
|
173
|
+
tel.number=str
|
174
|
+
end
|
175
|
+
@phones << tel
|
155
176
|
end
|
156
|
-
|
157
|
-
|
158
|
-
|
177
|
+
if element[ 0 ] == "email"
|
178
|
+
email = Email.new
|
179
|
+
if (type = element[ 1 ][ "type" ]) != nil
|
180
|
+
email.type << type if type.instance_of? String
|
181
|
+
email.type = type if type.instance_of? Array
|
182
|
+
end
|
183
|
+
email.addr=element[ 3 ]
|
184
|
+
@emails << email
|
159
185
|
end
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
186
|
+
if element[ 0 ] == "adr"
|
187
|
+
adr = Adr.new
|
188
|
+
if (type = element[ 1 ][ "type" ]) != nil
|
189
|
+
adr.type << type if type.instance_of? String
|
190
|
+
adr.type = type if type.instance_of? Array
|
191
|
+
end
|
192
|
+
if (label = element[ 1 ][ "label" ]) != nil
|
193
|
+
adr.label = label.split( "\n" )
|
194
|
+
else
|
195
|
+
adr.pobox=element[ 3 ][ 0 ]
|
196
|
+
adr.extended=element[ 3 ][ 1 ]
|
197
|
+
adr.street=element[ 3 ][ 2 ]
|
198
|
+
adr.locality=element[ 3 ][ 3 ]
|
199
|
+
adr.region=element[ 3 ][ 4 ]
|
200
|
+
adr.postal=element[ 3 ][ 5 ]
|
201
|
+
adr.country=element[ 3 ][ 6 ]
|
202
|
+
adr.structured=true
|
203
|
+
end
|
204
|
+
@adrs << adr
|
167
205
|
end
|
168
|
-
if
|
169
|
-
|
170
|
-
tel.ext=str[ /[^;]*ext=(.*)/,1 ]
|
171
|
-
else
|
172
|
-
tel.number=str
|
206
|
+
if element[ 0 ] == "kind"
|
207
|
+
@kind = element[ 3 ]
|
173
208
|
end
|
174
|
-
|
175
|
-
|
176
|
-
if element[ 0 ] == "email"
|
177
|
-
email = Email.new
|
178
|
-
if (type = element[ 1 ][ "type" ]) != nil
|
179
|
-
email.type << type if type.instance_of? String
|
180
|
-
email.type = type if type.instance_of? Array
|
181
|
-
end
|
182
|
-
email.addr=element[ 3 ]
|
183
|
-
@emails << email
|
184
|
-
end
|
185
|
-
if element[ 0 ] == "adr"
|
186
|
-
adr = Adr.new
|
187
|
-
if (type = element[ 1 ][ "type" ]) != nil
|
188
|
-
adr.type << type if type.instance_of? String
|
189
|
-
adr.type = type if type.instance_of? Array
|
209
|
+
if element[ 0 ] == "title"
|
210
|
+
@titles << element[ 3 ]
|
190
211
|
end
|
191
|
-
if
|
192
|
-
|
193
|
-
else
|
194
|
-
adr.pobox=element[ 3 ][ 0 ]
|
195
|
-
adr.extended=element[ 3 ][ 1 ]
|
196
|
-
adr.street=element[ 3 ][ 2 ]
|
197
|
-
adr.locality=element[ 3 ][ 3 ]
|
198
|
-
adr.region=element[ 3 ][ 4 ]
|
199
|
-
adr.postal=element[ 3 ][ 5 ]
|
200
|
-
adr.country=element[ 3 ][ 6 ]
|
201
|
-
adr.structured=true
|
212
|
+
if element[ 0 ] == "role"
|
213
|
+
@roles << element[ 3 ]
|
202
214
|
end
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
end
|
214
|
-
if element[ 0 ] == "org"
|
215
|
-
org = Org.new
|
216
|
-
if (type = element[ 1 ][ "type" ]) != nil
|
217
|
-
org.type << type if type.instance_of? String
|
218
|
-
org.type = type if type.instance_of? Array
|
215
|
+
if element[ 0 ] == "org"
|
216
|
+
org = Org.new
|
217
|
+
if (type = element[ 1 ][ "type" ]) != nil
|
218
|
+
org.type << type if type.instance_of? String
|
219
|
+
org.type = type if type.instance_of? Array
|
220
|
+
end
|
221
|
+
names = element[ 3 ]
|
222
|
+
org.names << names if names.instance_of? String
|
223
|
+
org.names = org.names + names if names.instance_of? Array
|
224
|
+
@orgs << org
|
219
225
|
end
|
220
|
-
names = element[ 3 ]
|
221
|
-
org.names << names if names.instance_of? String
|
222
|
-
org.names = org.names + names if names.instance_of? Array
|
223
|
-
@orgs << org
|
224
226
|
end
|
225
227
|
end
|
226
228
|
if @fns.empty?
|
data/lib/nicinfo/nicinfo_main.rb
CHANGED
@@ -319,7 +319,8 @@ module NicInfo
|
|
319
319
|
if data == nil
|
320
320
|
|
321
321
|
@config.logger.trace("Issuing GET for " + url)
|
322
|
-
|
322
|
+
p = URI::Parser.new
|
323
|
+
uri = URI.parse( p.escape( url ) )
|
323
324
|
req = Net::HTTP::Get.new(uri.request_uri)
|
324
325
|
req["User-Agent"] = NicInfo::VERSION_LABEL
|
325
326
|
req["Accept"] = NicInfo::RDAP_CONTENT_TYPE + ", " + NicInfo::JSON_CONTENT_TYPE
|
@@ -376,7 +377,8 @@ module NicInfo
|
|
376
377
|
def get_file_via_http url, file_name, try
|
377
378
|
|
378
379
|
@config.logger.trace("Downloading " + url + " to " + file_name )
|
379
|
-
|
380
|
+
p = URI::Parser.new
|
381
|
+
uri = URI.parse( p.escape( url ) )
|
380
382
|
req = Net::HTTP::Get.new(uri.request_uri)
|
381
383
|
req["User-Agent"] = NicInfo::VERSION_LABEL
|
382
384
|
req["Accept"] = NicInfo::JSON_CONTENT_TYPE
|
@@ -937,7 +939,7 @@ HELP_SUMMARY
|
|
937
939
|
|
938
940
|
# Creates a query type
|
939
941
|
def create_resource_url(args, queryType)
|
940
|
-
|
942
|
+
p = URI::Parser.new
|
941
943
|
path = ""
|
942
944
|
case queryType
|
943
945
|
when QueryType::BY_IP4_ADDR
|
@@ -959,15 +961,15 @@ HELP_SUMMARY
|
|
959
961
|
path = tree.find_rest_ref(args[0])
|
960
962
|
raise ArgumentError.new("Unable to find result for " + args[0]) unless path
|
961
963
|
when QueryType::BY_ENTITY_HANDLE
|
962
|
-
path << "entity/" <<
|
964
|
+
path << "entity/" << p.escape( args[ 0 ] )
|
963
965
|
when QueryType::SRCH_ENTITY_BY_NAME
|
964
966
|
case args.length
|
965
967
|
when 1
|
966
|
-
path << "entities?fn=" <<
|
968
|
+
path << "entities?fn=" << p.escape( args[ 0 ] )
|
967
969
|
when 2
|
968
|
-
path << "entities?fn=" <<
|
970
|
+
path << "entities?fn=" << p.escape( args[ 0 ] + " " + args[ 1 ] )
|
969
971
|
when 3
|
970
|
-
path << "entities?fn=" <<
|
972
|
+
path << "entities?fn=" << p.escape( args[ 0 ] + " " + args[ 1 ] + " " + args[ 2 ] )
|
971
973
|
end
|
972
974
|
when QueryType::SRCH_DOMAIN_BY_NAME
|
973
975
|
path << "domains?name=" << args[ 0 ]
|
data/lib/nicinfo/utils.rb
CHANGED
@@ -20,8 +20,9 @@ require 'nicinfo/config'
|
|
20
20
|
module NicInfo
|
21
21
|
|
22
22
|
def NicInfo.make_safe( url )
|
23
|
-
|
24
|
-
safe =
|
23
|
+
p = URI::Parser.new
|
24
|
+
safe = p.escape( url )
|
25
|
+
safe = p.escape( safe, "!*'();:@&=+$,/?#[]" )
|
25
26
|
return safe
|
26
27
|
end
|
27
28
|
|
metadata
CHANGED
@@ -1,14 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: nicinfo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.5.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andrew Newton
|
8
|
-
|
8
|
+
- Garth Dubin
|
9
|
+
autorequire:
|
9
10
|
bindir: bin
|
10
11
|
cert_chain: []
|
11
|
-
date:
|
12
|
+
date: 2022-09-29 00:00:00.000000000 Z
|
12
13
|
dependencies:
|
13
14
|
- !ruby/object:Gem::Dependency
|
14
15
|
name: netaddr
|
@@ -16,20 +17,14 @@ dependencies:
|
|
16
17
|
requirements:
|
17
18
|
- - "~>"
|
18
19
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
20
|
-
- - ">="
|
21
|
-
- !ruby/object:Gem::Version
|
22
|
-
version: 1.5.1
|
20
|
+
version: 2.0.4
|
23
21
|
type: :runtime
|
24
22
|
prerelease: false
|
25
23
|
version_requirements: !ruby/object:Gem::Requirement
|
26
24
|
requirements:
|
27
25
|
- - "~>"
|
28
26
|
- !ruby/object:Gem::Version
|
29
|
-
version:
|
30
|
-
- - ">="
|
31
|
-
- !ruby/object:Gem::Version
|
32
|
-
version: 1.5.1
|
27
|
+
version: 2.0.4
|
33
28
|
- !ruby/object:Gem::Dependency
|
34
29
|
name: rainbow
|
35
30
|
requirement: !ruby/object:Gem::Requirement
|
@@ -59,7 +54,7 @@ dependencies:
|
|
59
54
|
- !ruby/object:Gem::Version
|
60
55
|
version: 0.8.3
|
61
56
|
description: A command-line RDAP client.
|
62
|
-
email:
|
57
|
+
email: gdubin@arin.net
|
63
58
|
executables:
|
64
59
|
- nicinfo
|
65
60
|
extensions: []
|
@@ -120,7 +115,7 @@ homepage: https://github.com/arinlabs/nicinfo
|
|
120
115
|
licenses:
|
121
116
|
- ISC
|
122
117
|
metadata: {}
|
123
|
-
post_install_message:
|
118
|
+
post_install_message:
|
124
119
|
rdoc_options: []
|
125
120
|
require_paths:
|
126
121
|
- lib
|
@@ -135,9 +130,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
135
130
|
- !ruby/object:Gem::Version
|
136
131
|
version: '0'
|
137
132
|
requirements: []
|
138
|
-
|
139
|
-
|
140
|
-
signing_key:
|
133
|
+
rubygems_version: 3.3.3
|
134
|
+
signing_key:
|
141
135
|
specification_version: 4
|
142
136
|
summary: RDAP Client
|
143
137
|
test_files: []
|