whois 5.1.1 → 6.0.0

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: 8ff6872ad8615b4343c701a4db1eedc42eaa11adbb8e208c57a27925529a1cc2
4
- data.tar.gz: fb06f748a5f3c51552ac2554dd09afd5dede8a1827c55a3c4466e9718a81ff20
3
+ metadata.gz: 233983f2127c776b5e77d6ac832a4443aa21a8da7dcc09dba31c76772926783a
4
+ data.tar.gz: 84ee1063c4dbdded63b6b6d83aaaf957a44f548eda71cba420a249a887a7f5e4
5
5
  SHA512:
6
- metadata.gz: a27c9e7c48268fb08698628dc59e89b39182726f76cb882962c4a7fee139afb7bbca24ee1f04852c317221b58598237b036ccbda2d645012816e391e527ec7bf
7
- data.tar.gz: 9cbb25f0c7ef46d0a39eb1699fae0d9e64943c8c5f9ae0c919524eb400eb228198046f5527f526d86a342a61746b6053576de9aa7a1967efccf2059ecc7a3e7c
6
+ metadata.gz: 7acf2553be68cc588e3850e6b9ed2339bfa8c63b138c63511d6c4b3dacbbe8f63bdf9b074a9823606f7e6f56c5925adda2d0ad781742eedc2c16d9eb5e5d6eca
7
+ data.tar.gz: 59137ef3644bf7a5ac1ba42622550b9eb3aabdbb2f90a78d5eba3da69c5163d494630f430c94e166bec430dd77ba5df080d126bb48d05d596fa442e72ca275de
@@ -36,7 +36,7 @@ jobs:
36
36
 
37
37
  # Initializes the CodeQL tools for scanning.
38
38
  - name: Initialize CodeQL
39
- uses: github/codeql-action/init@v2
39
+ uses: github/codeql-action/init@v3
40
40
  with:
41
41
  languages: ${{ matrix.language }}
42
42
  # If you wish to specify custom queries, you can do so here or in a config file.
@@ -47,7 +47,7 @@ jobs:
47
47
  # Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
48
48
  # If this step fails, then you should remove it and run the build manually (see below)
49
49
  - name: Autobuild
50
- uses: github/codeql-action/autobuild@v2
50
+ uses: github/codeql-action/autobuild@v3
51
51
 
52
52
  # ℹ️ Command-line programs to run using the OS shell.
53
53
  # 📚 https://git.io/JvXDl
@@ -61,4 +61,4 @@ jobs:
61
61
  # make release
62
62
 
63
63
  - name: Perform CodeQL Analysis
64
- uses: github/codeql-action/analyze@v2
64
+ uses: github/codeql-action/analyze@v3
@@ -1,16 +1,18 @@
1
1
  name: release
2
2
 
3
3
  on:
4
+ workflow_dispatch:
4
5
  push:
5
6
  tags:
6
7
  - v*.*.*
8
+
7
9
  jobs:
8
10
  release:
9
11
  runs-on: ubuntu-latest
10
12
  steps:
11
13
  - uses: actions/checkout@v4
12
14
  - name: Release Gem
13
- uses: cadwallion/publish-rubygems-action@d9474d9633f4674e59afb0c343f2dafe25181328
15
+ uses: cadwallion/publish-rubygems-action@94a6f4cd5350581749c569b5001eecc864e3ad0b
14
16
  env:
15
17
  RUBYGEMS_API_KEY: ${{ secrets.RUBYGEMS_API_KEY }}
16
18
  RELEASE_COMMAND: rake release
@@ -6,12 +6,10 @@ on:
6
6
  workflow_dispatch:
7
7
 
8
8
  jobs:
9
- build:
9
+ test:
10
10
  strategy:
11
11
  matrix:
12
12
  ruby-version:
13
- - "2.6"
14
- - "2.7"
15
13
  - "3.0"
16
14
  - "3.1"
17
15
  - "3.2"
data/.rubocop.yml CHANGED
@@ -6,7 +6,7 @@ require:
6
6
  - rubocop-rspec
7
7
 
8
8
  AllCops:
9
- TargetRubyVersion: 2.5
9
+ TargetRubyVersion: 3.0
10
10
  Exclude:
11
11
  # Exclude .gemspec files because they are generally auto-generated
12
12
  - '*.gemspec'
data/CHANGELOG.md CHANGED
@@ -3,6 +3,18 @@
3
3
  This project uses [Semantic Versioning 2.0.0](http://semver.org/).
4
4
 
5
5
 
6
+ ## Release 6.0.0
7
+
8
+ ### Fixed
9
+
10
+ - Fixed badly anchored regular expression (GH-661)
11
+
12
+ ### Changed
13
+
14
+ - Minimum Ruby version 3.0
15
+ - SERVER: Updated .GOV.UK and .AC.UK (GH-554). The official whois servers are not responding correctly, I am reverting them to the .UK TLD.
16
+
17
+
6
18
  ## Release 5.1.1
7
19
 
8
20
  ### Changed
data/LICENSE.txt CHANGED
@@ -1,6 +1,6 @@
1
1
  The MIT License (MIT)
2
2
 
3
- Copyright (c) 2009-2022 Simone Carletti
3
+ Copyright (c) 2009-2024 Simone Carletti
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
data/README.md CHANGED
@@ -33,7 +33,7 @@ This repository contains the core whois library, that includes the WHOIS client,
33
33
 
34
34
  ## Requirements
35
35
 
36
- - Ruby >= 2.4
36
+ - Ruby >= 3.0
37
37
 
38
38
  For older versions of Ruby, see the [CHANGELOG](CHANGELOG.md).
39
39
 
@@ -213,4 +213,4 @@ Report issues or feature requests to [GitHub Issues](https://github.com/weppos/w
213
213
 
214
214
  ## License
215
215
 
216
- Copyright (c) 2009-2022 [Simone Carletti](https://simonecarletti.com/). This is Free Software distributed under the MIT license.
216
+ Copyright (c) 2009-2024 [Simone Carletti](https://simonecarletti.com/). This is Free Software distributed under the MIT license.
data/SECURITY.md ADDED
@@ -0,0 +1,24 @@
1
+ # Security Policy
2
+
3
+ ## Supported Versions
4
+
5
+ Security updates are provided only for the current minor version.
6
+
7
+ If you are using a previous minor version, we recommend to upgrade to the current minor version. This project uses [semantic versioning](https://semver.org/), therefore you can upgrade to a more recent minor version without incurring into breaking changes.
8
+
9
+ Exceptionally, we may support previous minor versions upon request if there are significant reasons preventing to immediately switch the latest minor version.
10
+
11
+ Older major versions are no longer supported.
12
+
13
+
14
+ ## Reporting a Vulnerability
15
+
16
+ To make a report, please email weppos@weppos.net.
17
+
18
+ > [!IMPORTANT]
19
+ > Please consider encrypting your report with GPG using the key [0x420da82a989398df](https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x420da82a989398df).
20
+
21
+
22
+ ## Tracking Security Updates
23
+
24
+ Information about security vulnerabilities are published in the [Security Advisories](https://github.com/weppos/whois/security/advisories) page.
data/data/tld.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "_": {
3
3
  "schema": "2",
4
- "updated": "2023-11-08 10:10:00 UTC"
4
+ "updated": "2024-08-05 11:39:00 UTC"
5
5
  },
6
6
  "aaa": {
7
7
  "_type": "newgtld",
@@ -5703,18 +5703,18 @@
5703
5703
  "uk": {
5704
5704
  "host": "whois.nic.uk"
5705
5705
  },
5706
- "ac.uk": {
5707
- "host": "whois.ja.net"
5708
- },
5706
+ // "ac.uk": {
5707
+ // "host": "whois.nic.ac.uk"
5708
+ // },
5709
5709
  "bl.uk": {
5710
5710
  "adapter": "none"
5711
5711
  },
5712
5712
  "british-library.uk": {
5713
5713
  "adapter": "none"
5714
5714
  },
5715
- "gov.uk": {
5716
- "host": "whois.ja.net"
5717
- },
5715
+ // "gov.uk": {
5716
+ // "host": "whois.gov.uk"
5717
+ // },
5718
5718
  "icnet.uk": {
5719
5719
  "adapter": "none"
5720
5720
  },
data/lib/whois/client.rb CHANGED
@@ -5,7 +5,7 @@
5
5
  #
6
6
  # An intelligent pure Ruby WHOIS client and parser.
7
7
  #
8
- # Copyright (c) 2009-2022 Simone Carletti <weppos@weppos.net>
8
+ # Copyright (c) 2009-2024 Simone Carletti <weppos@weppos.net>
9
9
  #++
10
10
 
11
11
 
data/lib/whois/errors.rb CHANGED
@@ -5,7 +5,7 @@
5
5
  #
6
6
  # An intelligent pure Ruby WHOIS client and parser.
7
7
  #
8
- # Copyright (c) 2009-2022 Simone Carletti <weppos@weppos.net>
8
+ # Copyright (c) 2009-2024 Simone Carletti <weppos@weppos.net>
9
9
  #++
10
10
 
11
11
 
@@ -5,7 +5,7 @@
5
5
  #
6
6
  # An intelligent pure Ruby WHOIS client and parser.
7
7
  #
8
- # Copyright (c) 2009-2022 Simone Carletti <weppos@weppos.net>
8
+ # Copyright (c) 2009-2024 Simone Carletti <weppos@weppos.net>
9
9
  #++
10
10
 
11
11
 
data/lib/whois/record.rb CHANGED
@@ -5,7 +5,7 @@
5
5
  #
6
6
  # An intelligent pure Ruby WHOIS client and parser.
7
7
  #
8
- # Copyright (c) 2009-2022 Simone Carletti <weppos@weppos.net>
8
+ # Copyright (c) 2009-2024 Simone Carletti <weppos@weppos.net>
9
9
  #++
10
10
 
11
11
 
@@ -5,7 +5,7 @@
5
5
  #
6
6
  # An intelligent pure Ruby WHOIS client and parser.
7
7
  #
8
- # Copyright (c) 2009-2022 Simone Carletti <weppos@weppos.net>
8
+ # Copyright (c) 2009-2024 Simone Carletti <weppos@weppos.net>
9
9
  #++
10
10
 
11
11
 
@@ -5,7 +5,7 @@
5
5
  #
6
6
  # An intelligent pure Ruby WHOIS client and parser.
7
7
  #
8
- # Copyright (c) 2009-2022 Simone Carletti <weppos@weppos.net>
8
+ # Copyright (c) 2009-2024 Simone Carletti <weppos@weppos.net>
9
9
  #++
10
10
 
11
11
 
@@ -5,7 +5,7 @@
5
5
  #
6
6
  # An intelligent pure Ruby WHOIS client and parser.
7
7
  #
8
- # Copyright (c) 2009-2022 Simone Carletti <weppos@weppos.net>
8
+ # Copyright (c) 2009-2024 Simone Carletti <weppos@weppos.net>
9
9
  #++
10
10
 
11
11
 
@@ -30,7 +30,7 @@ module Whois
30
30
  # "192.in-addr.arpa" => "192.0.0.0"
31
31
  # "in-addr.arpa" => "0.0.0.0"
32
32
  def inaddr_to_ip(string)
33
- raise ServerError, "Invalid .in-addr.arpa address" unless string.match?(/^([0-9]{1,3}\.?){0,4}in-addr\.arpa$/)
33
+ raise ServerError, "Invalid .in-addr.arpa address" unless string.match?(/\A([0-9]{1,3}\.?){0,4}in-addr\.arpa\z/)
34
34
 
35
35
  a, b, c, d = string.scan(/[0-9]{1,3}\./).reverse
36
36
  [a, b, c, d].map do |token|
@@ -5,7 +5,7 @@
5
5
  #
6
6
  # An intelligent pure Ruby WHOIS client and parser.
7
7
  #
8
- # Copyright (c) 2009-2022 Simone Carletti <weppos@weppos.net>
8
+ # Copyright (c) 2009-2024 Simone Carletti <weppos@weppos.net>
9
9
  #++
10
10
 
11
11
 
@@ -5,7 +5,7 @@
5
5
  #
6
6
  # An intelligent pure Ruby WHOIS client and parser.
7
7
  #
8
- # Copyright (c) 2009-2022 Simone Carletti <weppos@weppos.net>
8
+ # Copyright (c) 2009-2024 Simone Carletti <weppos@weppos.net>
9
9
  #++
10
10
 
11
11
 
@@ -5,7 +5,7 @@
5
5
  #
6
6
  # An intelligent pure Ruby WHOIS client and parser.
7
7
  #
8
- # Copyright (c) 2009-2022 Simone Carletti <weppos@weppos.net>
8
+ # Copyright (c) 2009-2024 Simone Carletti <weppos@weppos.net>
9
9
  #++
10
10
 
11
11
 
@@ -5,7 +5,7 @@
5
5
  #
6
6
  # An intelligent pure Ruby WHOIS client and parser.
7
7
  #
8
- # Copyright (c) 2009-2022 Simone Carletti <weppos@weppos.net>
8
+ # Copyright (c) 2009-2024 Simone Carletti <weppos@weppos.net>
9
9
  #++
10
10
 
11
11
 
@@ -5,7 +5,7 @@
5
5
  #
6
6
  # An intelligent pure Ruby WHOIS client and parser.
7
7
  #
8
- # Copyright (c) 2009-2022 Simone Carletti <weppos@weppos.net>
8
+ # Copyright (c) 2009-2024 Simone Carletti <weppos@weppos.net>
9
9
  #++
10
10
 
11
11
 
@@ -5,7 +5,7 @@
5
5
  #
6
6
  # An intelligent pure Ruby WHOIS client and parser.
7
7
  #
8
- # Copyright (c) 2009-2022 Simone Carletti <weppos@weppos.net>
8
+ # Copyright (c) 2009-2024 Simone Carletti <weppos@weppos.net>
9
9
  #++
10
10
 
11
11
 
@@ -5,7 +5,7 @@
5
5
  #
6
6
  # An intelligent pure Ruby WHOIS client and parser.
7
7
  #
8
- # Copyright (c) 2009-2022 Simone Carletti <weppos@weppos.net>
8
+ # Copyright (c) 2009-2024 Simone Carletti <weppos@weppos.net>
9
9
  #++
10
10
 
11
11
 
@@ -5,7 +5,7 @@
5
5
  #
6
6
  # An intelligent pure Ruby WHOIS client and parser.
7
7
  #
8
- # Copyright (c) 2009-2022 Simone Carletti <weppos@weppos.net>
8
+ # Copyright (c) 2009-2024 Simone Carletti <weppos@weppos.net>
9
9
  #++
10
10
 
11
11
 
data/lib/whois/server.rb CHANGED
@@ -5,7 +5,7 @@
5
5
  #
6
6
  # An intelligent pure Ruby WHOIS client and parser.
7
7
  #
8
- # Copyright (c) 2009-2022 Simone Carletti <weppos@weppos.net>
8
+ # Copyright (c) 2009-2024 Simone Carletti <weppos@weppos.net>
9
9
  #++
10
10
 
11
11
 
@@ -86,7 +86,7 @@ module Whois
86
86
  options = if settings.empty?
87
87
  EMPTY_HASH
88
88
  else
89
- settings.map { |k, v| [k.to_sym, v.is_a?(String) ? intern_string(v) : v] }.to_h.freeze
89
+ settings.to_h { |k, v| [k.to_sym, v.is_a?(String) ? intern_string(v) : v] }.freeze
90
90
  end
91
91
  define(type, allocation, host, options)
92
92
  end
@@ -268,7 +268,7 @@ module Whois
268
268
  begin
269
269
  ip = IPAddr.new(string)
270
270
  type = ip.ipv4? ? TYPE_IPV4 : TYPE_IPV6
271
- _definitions(type).each do |_, definition|
271
+ _definitions(type).each_value do |definition|
272
272
  return factory(type, *definition) if IPAddr.new(definition.first).include?(ip)
273
273
  end
274
274
  rescue ArgumentError
@@ -303,7 +303,7 @@ module Whois
303
303
  index = token.index(".")
304
304
  break if index.nil?
305
305
 
306
- token = token[(index + 1)..-1]
306
+ token = token[(index + 1)..]
307
307
  end
308
308
  end
309
309
 
@@ -321,7 +321,7 @@ module Whois
321
321
  def find_for_asn(string)
322
322
  asn = string[/\d+/].to_i
323
323
  asn_type = asn <= 65_535 ? TYPE_ASN16 : TYPE_ASN32
324
- _definitions(asn_type).each do |_, definition|
324
+ _definitions(asn_type).each_value do |definition|
325
325
  if (range = definition.first.split.map(&:to_i)) && asn >= range.first && asn <= range.last
326
326
  return factory(asn_type, *definition)
327
327
  end
data/lib/whois/version.rb CHANGED
@@ -5,11 +5,11 @@
5
5
  #
6
6
  # An intelligent pure Ruby WHOIS client and parser.
7
7
  #
8
- # Copyright (c) 2009-2022 Simone Carletti <weppos@weppos.net>
8
+ # Copyright (c) 2009-2024 Simone Carletti <weppos@weppos.net>
9
9
  #++
10
10
 
11
11
 
12
12
  module Whois
13
13
  # The current library version.
14
- VERSION = "5.1.1"
14
+ VERSION = "6.0.0"
15
15
  end
data/lib/whois.rb CHANGED
@@ -5,7 +5,7 @@
5
5
  #
6
6
  # An intelligent pure Ruby WHOIS client and parser.
7
7
  #
8
- # Copyright (c) 2009-2022 Simone Carletti <weppos@weppos.net>
8
+ # Copyright (c) 2009-2024 Simone Carletti <weppos@weppos.net>
9
9
  #++
10
10
 
11
11
 
data/spec/spec_helper.rb CHANGED
@@ -12,7 +12,7 @@ Encoding.default_internal = Encoding::UTF_8
12
12
 
13
13
  # Requires supporting ruby files with custom matchers and macros, etc,
14
14
  # in spec/support/ and its subdirectories.
15
- Dir[File.join(SPEC_ROOT, "support/**/*.rb")].sort.each { |f| require f }
15
+ Dir[File.join(SPEC_ROOT, "support/**/*.rb")].each { |f| require f }
16
16
 
17
17
  RSpec.configure do |config|
18
18
  config.mock_with :rspec
@@ -8,13 +8,22 @@ describe Whois::Server::Adapters::Arpa do
8
8
 
9
9
  describe "#lookup" do
10
10
  it "returns the WHOIS record" do
11
- response = "Whois Response"
12
11
  server = described_class.new(*definition)
13
- expect(Whois::Server::Adapters::Arin.query_handler).to receive(:call).with("n + 229.128.in-addr.arpa", "whois.arin.net", 43).and_return(response)
12
+ expect(Whois::Server::Adapters::Arin.query_handler).to receive(:call)
13
+ .with("n + 229.128.in-addr.arpa", "whois.arin.net", 43)
14
+ .and_return(response = "Whois Response")
14
15
 
15
16
  record = server.lookup("229.128.in-addr.arpa")
16
17
  expect(record.to_s).to eq(response)
17
18
  expect(record.parts).to eq([Whois::Record::Part.new(body: response, host: "whois.arin.net")])
18
19
  end
20
+
21
+ it "discards newlines" do
22
+ server = described_class.new(*definition)
23
+
24
+ expect do
25
+ server.lookup("229.128.in-addr.arpa\nextra")
26
+ end.to raise_error(Whois::ServerError, "Invalid .in-addr.arpa address")
27
+ end
19
28
  end
20
29
  end
data/whois.gemspec CHANGED
@@ -12,7 +12,7 @@ Gem::Specification.new do |s|
12
12
  s.description = "Whois is an intelligent WHOIS client and parser written in pure Ruby. It can query registry data for IPv4, IPv6 and top level domains, and parse the responses into easy-to-use Ruby objects via the whois-parser library."
13
13
  s.license = "MIT"
14
14
 
15
- s.required_ruby_version = ">= 2.4"
15
+ s.required_ruby_version = ">= 3.0"
16
16
 
17
17
  s.require_paths = %w( lib )
18
18
  s.executables =%w( whoisrb )
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: whois
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.1.1
4
+ version: 6.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Simone Carletti
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-11-08 00:00:00.000000000 Z
11
+ date: 2024-08-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -84,6 +84,7 @@ files:
84
84
  - LICENSE.txt
85
85
  - README.md
86
86
  - Rakefile
87
+ - SECURITY.md
87
88
  - bin/console
88
89
  - bin/whoisrb
89
90
  - data/asn16.json
@@ -159,46 +160,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
159
160
  requirements:
160
161
  - - ">="
161
162
  - !ruby/object:Gem::Version
162
- version: '2.4'
163
+ version: '3.0'
163
164
  required_rubygems_version: !ruby/object:Gem::Requirement
164
165
  requirements:
165
166
  - - ">="
166
167
  - !ruby/object:Gem::Version
167
168
  version: '0'
168
169
  requirements: []
169
- rubygems_version: 3.4.21
170
+ rubygems_version: 3.5.11
170
171
  signing_key:
171
172
  specification_version: 4
172
173
  summary: An intelligent pure Ruby WHOIS client and parser.
173
- test_files:
174
- - spec/fixtures/referrals/afilias.bz.txt
175
- - spec/fixtures/referrals/arin_referral_apnic.txt
176
- - spec/fixtures/referrals/arin_referral_missing.txt
177
- - spec/fixtures/referrals/arin_referral_ripe.txt
178
- - spec/fixtures/referrals/arin_referral_rwhois.txt
179
- - spec/fixtures/referrals/arin_referral_servernap.txt
180
- - spec/fixtures/referrals/arin_referral_whois.txt
181
- - spec/fixtures/referrals/crsnic.com.txt
182
- - spec/fixtures/referrals/crsnic.com_referral.txt
183
- - spec/fixtures/referrals/crsnic.com_referral_missing.txt
184
- - spec/integration/whois_spec.rb
185
- - spec/spec_helper.rb
186
- - spec/support/helpers/connectivity_helper.rb
187
- - spec/support/helpers/spec_helper.rb
188
- - spec/whois/client_spec.rb
189
- - spec/whois/record/part_spec.rb
190
- - spec/whois/record_spec.rb
191
- - spec/whois/server/adapters/afilias_spec.rb
192
- - spec/whois/server/adapters/arin_spec.rb
193
- - spec/whois/server/adapters/arpa_spec.rb
194
- - spec/whois/server/adapters/base_spec.rb
195
- - spec/whois/server/adapters/formatted_spec.rb
196
- - spec/whois/server/adapters/none_spec.rb
197
- - spec/whois/server/adapters/not_implemented_spec.rb
198
- - spec/whois/server/adapters/standard_spec.rb
199
- - spec/whois/server/adapters/verisign_spec.rb
200
- - spec/whois/server/adapters/web_spec.rb
201
- - spec/whois/server/socket_handler_spec.rb
202
- - spec/whois/server_spec.rb
203
- - spec/whois/web_interface_error_spec.rb
204
- - spec/whois/whois_spec.rb
174
+ test_files: []