whois-parser-next 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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5351ca8b47d24f7a194be90595c52c18210e24682bf223134f075cc66c223b04
4
- data.tar.gz: 4befccbf200b2c77f9338c91d2cf122eef11e25883916e070f887db1bdbe1bb3
3
+ metadata.gz: '09b27e56a5225ea22fadb05db7497d93757e87e811520604377c2dcaa14900f8'
4
+ data.tar.gz: 7db37727a691aad97de784fb680da596ad79f5918df671a9f862becae1a0d37e
5
5
  SHA512:
6
- metadata.gz: f9b65eaac1e8ebcaac940563ca1c9748fa7607f900dc30e5977844323b1799dcd4f365166dc54920a2b2eb8eda094cd68eb42c62920b8a76495ffaab0eb9e45d
7
- data.tar.gz: f2a5197d3b4e7a78f486a43d76b34a7ebd91da46fe3485f4bc3fcaa117c67b78b0c202a645ae11f4ebd1a7c755d24305d180ddd442b0b67c0acf75cda4431fd7
6
+ metadata.gz: e71cf9f12d9602ad01877a3ab8592dfd387bc3f9afe6a01976a55a3d44af2e931ddd70debe9d9a60042b439712a4773cb4b65f29f5199f91d0815624ce749a7e
7
+ data.tar.gz: 3671c9bd5513063ebde38e00f07b39e26b3b00f2ad605ba6233a402cf5002a43cf75f0c0ce52bc3dcce376c860309a438530764d3dfb6494d76006c507927ccb
data/CHANGELOG.md CHANGED
@@ -2,6 +2,21 @@
2
2
 
3
3
  This project uses [Semantic Versioning 2.0.0](http://semver.org/).
4
4
 
5
+ #### Release 0.4.1 (2026-10-17)
6
+
7
+ - SAFETY: `.lu` records are registered only when the response contains a
8
+ domain name and an exact `domaintype: ACTIVE` field. The exact existing
9
+ absence marker is accepted only without a record; mixed, incomplete, or
10
+ ambiguous replies remain unknown.
11
+ - SAFETY: `.lu` query-rate limits, including the registry's repeated-percent
12
+ `%% Maximum query rate reached` response, raise a throttled-response error
13
+ even when the reply also contains a domain record or absence marker.
14
+ - TESTED: The parser suite passes 7,016 examples with 0 failures and the
15
+ package smoke check passes on Ruby 3.2 and 3.4.5.
16
+ - EVIDENCE: The [2026-10-17 DomScan audit](docs/audits/domscan-whois-usage-2026-10-17.md)
17
+ documents the fixed false-availability path and explains why its fixture
18
+ overlap and bounded replay do not establish 99% live accuracy.
19
+
5
20
  #### Release 0.4.0 (2026-09-29)
6
21
 
7
22
  - ADDED: Expanded and tightened first-class parsing for current official WHOIS
@@ -1,6 +1,6 @@
1
1
  module Whois
2
2
  class Parser
3
3
  # The current library version.
4
- VERSION = "0.4.0".freeze
4
+ VERSION = "0.4.1".freeze
5
5
  end
6
6
  end
@@ -11,7 +11,7 @@ module Whois
11
11
  content_for_scanner.match?(
12
12
  /^(?:[ \t]*(?:%|#)[ \t]*)?(?:whois\s+)?query\s+(?:rate\s+)?limit\s+exceeded\b/i
13
13
  ) || content_for_scanner.match?(
14
- /^(?:[ \t]*(?:%|#)[ \t]*)?maximum\s+query\s+rate\s+reached\b/i
14
+ /^(?:[ \t]*(?:%|#)+[ \t]*)?maximum\s+query\s+rate\s+reached\b/i
15
15
  ) || content_for_scanner.match?(
16
16
  /^(?:[ \t]*(?:%|#)[ \t]*)?excessive\s+querying\b/i
17
17
  ) || content_for_scanner.match?(
@@ -27,17 +27,19 @@ module Whois
27
27
  include RegistryResponseSafety
28
28
 
29
29
  property_supported :status do
30
- if content_for_scanner.match?(/domaintype:\s+active\s*$/i)
30
+ if response_unavailable? || response_throttled? || (lu_record? && lu_absence?)
31
+ :unknown
32
+ elsif lu_record? && content_for_scanner.match?(/^domaintype:[ \t]+active[ \t]*$/i)
31
33
  :registered
32
- elsif available?
34
+ elsif lu_absence? && !lu_record?
33
35
  :available
34
36
  else
35
- Whois::Parser.bug!(ParserError, "Unable to parse .lu response status.")
37
+ :unknown
36
38
  end
37
39
  end
38
40
 
39
41
  property_supported :available? do
40
- !!(content_for_scanner =~ /% No such domain/)
42
+ status == :available
41
43
  end
42
44
 
43
45
  property_supported :registered? do
@@ -92,6 +94,14 @@ module Whois
92
94
 
93
95
  private
94
96
 
97
+ def lu_record?
98
+ content_for_scanner.match?(/^domainname:[ \t]+\S+[ \t]*$/i)
99
+ end
100
+
101
+ def lu_absence?
102
+ content_for_scanner.match?(/^%[ \t]+No such domain(?:[ \t]*[.:].*)?[ \t]*$/i)
103
+ end
104
+
95
105
  def build_contact(element, type)
96
106
  return unless (name = value_for_key(format("%s-name", element)))
97
107
 
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.0
4
+ version: 0.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Simone Carletti