whois-parser-next 0.4.7 → 0.4.8

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: bf39e6c3afbb1b6a0cb49c48cb3fb11cf6db7d0162aaba77c9027ca4d2fadc3f
4
- data.tar.gz: 1134d08ab3b1bcef0551f8008c366234805614e86cbe02ffe90501f5203dae84
3
+ metadata.gz: dd5238487b0cc29b77e6d56f3594c009ea7712fe877fc31a41079dc1e49178be
4
+ data.tar.gz: 6f94667791431a36eb9b45ce8550143c89b91e9f08d88eafded9411722ae92fc
5
5
  SHA512:
6
- metadata.gz: addd71819acd60b21142b60e419625ac8ebbed5b160b33e6cfe5562bcd064727e04b98c820f53bb98c1e1649158829b10b10d3c9ae7b900b47b25f57c1023043
7
- data.tar.gz: 56a6dde832f4f0a9990e7753ea7f709a2bcba56d461d4eac0aa299bdd69b5896fd3b584647b6766267e621c4f6d52e42961a1fca1521c619b086f96f2dc80fcf
6
+ metadata.gz: 454380ba261a261d3f13e91646c54fde3adf7141b5782580323c3511f45b13c1dde9fd5f3f29b03855a090d7d48585304d660788e5a2942f943706670ae104cf
7
+ data.tar.gz: 21b62020ab6c094190a908d3e3e926b38928589c1727266fb691743b06003662a8ee3c22a973c6904b38f37402f6596e68de25efcf2a2f2443f9079e709f2564
data/CHANGELOG.md CHANGED
@@ -2,6 +2,35 @@
2
2
 
3
3
  This project uses [Semantic Versioning 2.0.0](http://semver.org/).
4
4
 
5
+ #### Release 0.4.8 (2026-10-24)
6
+
7
+ - ADDED: Added `registrant_contacts` to the `whois.trabis.gov.tr` (`.tr`)
8
+ parser. The `** Registrant:` block yields the name, and the email when one is
9
+ published. Address, city, country, phone and fax are read only from the fully
10
+ published eight-line layout, because hidden fields ("Hidden upon user
11
+ request") shorten the block. Fully hidden blocks, no-match responses and
12
+ throttled responses yield no contact.
13
+ - EVIDENCE: Bounded 2026-10-22 observations of `whois.trabis.gov.tr` returned a
14
+ fully published registrant block, a block with only the name visible
15
+ (`google.com.tr`), a fully hidden block, and the `No match found` response.
16
+ The fully published and fully hidden fixtures are redacted: the registrant
17
+ name, address and email, the domain name and the name servers are replaced
18
+ with placeholders while the line layout and whitespace are preserved.
19
+ - FIXED: The `whois.aeda.net.ae` (`.ae`) parser no longer reports the
20
+ registry's rate-limit reply ("BLACKLISTED: You have exceeded the query limit
21
+ ...") as registered. `registered?` was the negation of `available?`, so any
22
+ reply other than an explicit absence marker counted as a registration. The
23
+ parser now includes `RegistryResponseSafety` and treats the `BLACKLISTED:`
24
+ reply as throttled, so status, availability and registration raise
25
+ `Whois::ResponseIsThrottled`. Empty and access-denied replies now raise
26
+ `Whois::ResponseIsUnavailable` instead of counting as registered.
27
+ - EVIDENCE: On 2026-10-22, after a bounded series of lookups, `whois.aeda.net.ae`
28
+ answered every query from the client network, including `google.ae` and
29
+ generated unregistered names, with the single `BLACKLISTED:` line in the new
30
+ `response_blacklisted.txt` fixture (unmodified). Earlier the same day,
31
+ registered names and generated unregistered names returned the regular
32
+ registered and `No Data Found` responses.
33
+
5
34
  #### Release 0.4.7 (2026-10-19)
6
35
 
7
36
  - ADDED: Added strict parsing for the official `.gt` and `.com.gt` web WHOIS
@@ -1,6 +1,6 @@
1
1
  module Whois
2
2
  class Parser
3
3
  # The current library version.
4
- VERSION = "0.4.7".freeze
4
+ VERSION = "0.4.8".freeze
5
5
  end
6
6
  end
@@ -8,6 +8,7 @@
8
8
 
9
9
 
10
10
  require_relative 'base'
11
+ require_relative 'registry_response_safety'
11
12
 
12
13
 
13
14
  module Whois
@@ -23,6 +24,14 @@ module Whois
23
24
  # The Example parser for the list of all available methods.
24
25
  #
25
26
  class WhoisAedaNetAe < Base
27
+ include RegistryResponseSafety
28
+
29
+ # The registry answers rate-limited clients with a single "BLACKLISTED:"
30
+ # line. That reply carries no domain data, so it must not be read as
31
+ # either registered or available.
32
+ def response_throttled?
33
+ super || content_for_scanner.match?(/^BLACKLISTED:/i)
34
+ end
26
35
 
27
36
  property_supported :status do
28
37
  if content_for_scanner =~ /Status:\s+(.+?)\n/
@@ -7,6 +7,9 @@ module Whois
7
7
  class WhoisTrabisGovTr < Base
8
8
  include RegistryResponseSafety
9
9
 
10
+ HIDDEN = "Hidden upon user request".freeze
11
+ EMAIL = /[\w.+-]+@[\w-]+(?:\.[\w-]+)+/
12
+
10
13
  property_supported :domain do
11
14
  content_for_scanner.slice(/^\*\* Domain Name:\s+(.+)\n/, 1)
12
15
  end
@@ -43,7 +46,35 @@ module Whois
43
46
 
44
47
  property_not_supported :updated_on
45
48
  property_not_supported :registrar
46
- property_not_supported :registrant_contacts
49
+
50
+ # The "** Registrant:" block runs until the first blank line. A fully
51
+ # published block has eight lines: name, two address lines, "city,",
52
+ # country, email, phone and fax. Each hidden field reads "Hidden upon user
53
+ # request" and hidden blocks are shorter (a visible name plus four hidden
54
+ # lines), so positional fields are read only from the eight-line layout.
55
+ # The name is always the first line and the email is matched anywhere in
56
+ # the block. A block with no visible field yields no contact.
57
+ property_supported :registrant_contacts do
58
+ block = content_for_scanner.slice(/^\*\* Registrant:\n((?:.+\n)+)/, 1)
59
+ return [] unless block
60
+
61
+ lines = block.lines.map(&:strip)
62
+ value = ->(i) { (v = lines[i].to_s).empty? || v == "+" || v == HIDDEN ? nil : v }
63
+ email = lines.find { |l| l.match?(EMAIL) }&.slice(EMAIL)
64
+ name = value.call(0)
65
+ full = lines.size == 8
66
+
67
+ address = full ? [value.call(1), value.call(2)].compact.join("\n").presence : nil
68
+ city = full ? value.call(3)&.chomp(",")&.strip : nil
69
+ country = full ? value.call(4) : nil
70
+ phone = full ? value.call(6) : nil
71
+ fax = full ? value.call(7) : nil
72
+ return [] if [name, email, address, city, country, phone, fax].all?(&:nil?)
73
+
74
+ [Parser::Contact.new(type: Parser::Contact::TYPE_REGISTRANT, name: name, address: address,
75
+ city: city, country: country, email: email, phone: phone, fax: fax)]
76
+ end
77
+
47
78
  property_not_supported :admin_contacts
48
79
  property_not_supported :technical_contacts
49
80
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: whois-parser-next
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.7
4
+ version: 0.4.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Simone Carletti