Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for whois.corehub.net #80

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
65 changes: 65 additions & 0 deletions lib/whois/parsers/whois.corehub.net.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
#--
# Ruby Whois
#
# An intelligent pure Ruby WHOIS client and parser.
#
# Copyright (c) 2009-2018 Simone Carletti <[email protected]>
#++


require_relative 'base_icann_compliant'


module Whois
class Parsers

class WhoisCorehubNet < BaseIcannCompliant
self.scanner = Scanners::BaseIcannCompliant, {
pattern_available: /^No match for/
}

property_not_supported :updated_on

property_supported :registrant_contacts do
build_contact("Registrant", Parser::Contact::TYPE_REGISTRANT)
end

property_supported :admin_contacts do
build_contact("Admin", Parser::Contact::TYPE_ADMINISTRATIVE)
end

property_supported :technical_contacts do
build_contact("Tech", Parser::Contact::TYPE_TECHNICAL)
end

property_supported :nameservers do
Array.wrap(node("Name Server")).reject(&:empty?).map do |line|
server = line.match(/^(?<name>[^ ]+)(?: (?<ipv4>\d{1,3}(?:\.\d{1,3})+))?(?: (?<ipv6>[\da-fA-F:]+))?(?: (?<ipv4>\d{1,3}(?:\.\d{1,3})+))?$/)
Parser::Nameserver.new(name: server["name"].strip.downcase, ipv4: server["ipv4"], ipv6: server["ipv6"])
end
end

private

def build_contact(element, type)
node("#{element} Name") do
Parser::Contact.new(
type: type,
id: node("Registry #{element} ID").presence,
name: value_for_property(element, 'Name'),
organization: value_for_property(element, 'Organization'),
address: value_for_property(element, 'Street'),
city: value_for_property(element, 'City'),
zip: value_for_property(element, 'Postal Code'),
state: value_for_property(element, 'State/Province'),
country_code: value_for_property(element, 'Country'),
phone: value_for_phone_property(element, 'Phone'),
fax: value_for_phone_property(element, 'Fax'),
email: value_for_property(element, 'Email')
)
end
end

end
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
#domain
%s == nil

#domain_id
%s == nil

#status
%s == :available

#available?
%s == true

#registered?
%s == false

#created_on
%s == nil

#expires_on
%s == nil

#registrar
%s == nil

#registrant_contacts
%s %CLASS{array}
%s == []

#admin_contacts
%s %CLASS{array}
%s == []

#technical_contacts
%s %CLASS{array}
%s == []

#nameservers
%s %CLASS{array}
%s == []
74 changes: 74 additions & 0 deletions spec/fixtures/responses/whois.corehub.net/status_available.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
% The requested domain "u34jedzcq.net" is not registered through COREhub.
% Therefore the Whois server "whois.verisign-grs.com" is asked instead.
%
% **** Start of data fetched from referral whois ****

[whois.verisign-grs.com]
No match for domain "U34JEDZCQ.NET".
>>> Last update of whois database: 2018-05-03T13:23:46Z <<<

NOTICE: The expiration date displayed in this record is the date the
registrar's sponsorship of the domain name registration in the registry is
currently set to expire. This date does not necessarily reflect the expiration
date of the domain name registrant's agreement with the sponsoring
registrar. Users may consult the sponsoring registrar's Whois database to
view the registrar's reported date of expiration for this registration.

TERMS OF USE: You are not authorized to access or query our Whois
database through the use of electronic processes that are high-volume and
automated except as reasonably necessary to register domain names or
modify existing registrations; the Data in VeriSign Global Registry
Services' ("VeriSign") Whois database is provided by VeriSign for
information purposes only, and to assist persons in obtaining information
about or related to a domain name registration record. VeriSign does not
guarantee its accuracy. By submitting a Whois query, you agree to abide
by the following terms of use: You agree that you may use this Data only
for lawful purposes and that under no circumstances will you use this Data
to: (1) allow, enable, or otherwise support the transmission of mass
unsolicited, commercial advertising or solicitations via e-mail, telephone,
or facsimile; or (2) enable high volume, automated, electronic processes
that apply to VeriSign (or its computer systems). The compilation,
repackaging, dissemination or other use of this Data is expressly
prohibited without the prior written consent of VeriSign. You agree not to
use electronic processes that are automated and high-volume to access or
query the Whois database except as reasonably necessary to register
domain names or modify existing registrations. VeriSign reserves the right
to restrict your access to the Whois database in its sole discretion to ensure
operational stability. VeriSign may restrict or terminate your access to the
Whois database for failure to abide by these terms of use. VeriSign
reserves the right to modify these terms at any time.

The Registry database contains ONLY .COM, .NET, .EDU domains and
Registrars.

% **** End of data fetched from referral whois ****
%
% (c) 2014 COREhub S.R.L.U. ("COREhub"). All rights reserved.
%
% NOTICE: Access to the domains information is provided to assist in
% determining the contents of a domain name registration record in the
% COREhub database. The data in this record is provided by COREhub for
% informational purposes only, and COREhub does not guarantee its
% accuracy. This service is intended only for query-based access. You
% are not authorized to access or query our Whois database through the
% use of electronic processes that are high-volume and automated except
% as reasonably necessary to register domain names or modify existing
% registrations.
%
% By submitting a Whois query, you agree that you will use this data
% only for lawful purposes and that, under no circumstances, will you
% use this data (i) to allow, enable, or otherwise support the
% transmission by e-mail, telephone, postal mail, facsimile or other
% means of mass unsolicited, commercial advertising or solicitations to
% entities other than the data recipient's own existing customers;
% and/or (ii) to enable high volume, automated, electronic processes
% that send queries or data to the COREhub systems, except as reasonably
% necessary to register domain names or modify existing registrations.
%
% The compilation, repackaging, dissemination or other use of the data
% in the COREhub Whois database is expressly prohibited without the
% prior written consent of COREhub. COREhub reserves the right to
% restrict your access to the Whois database in its sole discretion to
% ensure operational stability. COREhub may restrict or terminate your
% access to the Whois database for failure to abide by these terms of
% use. COREhub reserves the right to modify these terms at any time.
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
#domain
%s == "corehub.net"

#domain_id
%s == "D-179116748-CONE"

#status
%s == :registered

#available?
%s == false

#registered?
%s == true

#created_on
%s %CLASS{time}
%s %TIME{2012-07-14 16:04:42 UTC}

#expires_on
%s %CLASS{time}
%s %TIME{2018-07-14 16:04:42 UTC}

#registrar
%s %CLASS{registrar}
%s.id == "15"
%s.name == "CORE-901 (Axone/Secretariat Maintenance Account)"
%s.organization == "CORE-901 (Axone/Secretariat Maintenance Account)"
%s.url == "http://corehub.net"

#registrant_contacts
%s %CLASS{array}
%s %SIZE{1}
%s[0] %CLASS{contact}
%s[0].type == Whois::Parser::Contact::TYPE_REGISTRANT
%s[0].name == "CORE ASSOCIATION"
%s[0].organization == ""
%s[0].address == ""
%s[0].city == "Geneva"
%s[0].zip == "CH-1215"
%s[0].state == "GE"
%s[0].country_code == "CH"
%s[0].phone == "+41.229295744"
%s[0].fax == "+41.229295745"
%s[0].email == "[email protected]"

#admin_contacts
%s %CLASS{array}
%s %SIZE{1}
%s[0] %CLASS{contact}
%s[0].type == Whois::Parser::Contact::TYPE_ADMINISTRATIVE
%s[0].name == "CORE Secretariat"
%s[0].organization == "CORE Association"
%s[0].address == "cour de Rive 2"
%s[0].city == "Geneve"
%s[0].zip == "1204"
%s[0].state == "GE"
%s[0].country_code == "CH"
%s[0].phone == "+41.223125610"
%s[0].fax == ""
%s[0].email == "[email protected]"

#technical_contacts
%s %CLASS{array}
%s %SIZE{1}
%s[0] %CLASS{contact}
%s[0].type == Whois::Parser::Contact::TYPE_TECHNICAL
%s[0].name == "CORE Secretariat"
%s[0].organization == "CORE Association"
%s[0].address == "cour de Rive 2"
%s[0].city == "Geneve"
%s[0].zip == "1204"
%s[0].state == "GE"
%s[0].country_code == "CH"
%s[0].phone == "+41.223125610"
%s[0].fax == ""
%s[0].email == "[email protected]"

#nameservers
%s %CLASS{array}
%s %SIZE{3}
%s[0] %CLASS{nameserver}
%s[0].name == "us20-west.irondns.net"
%s[0].ipv4 == "104.225.5.66"
%s[0].ipv6 == "2607:fc50:2000:2001::2"
%s[1] %CLASS{nameserver}
%s[1].name == "hk21.irondns.net"
%s[1].ipv4 == "103.6.86.97"
%s[1].ipv6 == "2403:2500:8000:1::9f9"
%s[2] %CLASS{nameserver}
%s[2].name == "us19-east.irondns.net"
%s[2].ipv4 == "4.71.215.210"
%s[2].ipv6 == "2001:1900:2236::d2"
89 changes: 89 additions & 0 deletions spec/fixtures/responses/whois.corehub.net/status_registered.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
Domain Name: corehub.net
Registry Domain ID: D-179116748-CONE
Registrar WHOIS Server: whois.corehub.net
Registrar URL: http://corehub.net
Creation Date: 2012-07-14T16:04:42.0Z
Registrar Registration Expiration Date: 2018-07-14T16:04:42.0Z
Registrar: CORE-901 (Axone/Secretariat Maintenance Account)
Registrar IANA ID: 15
Registrar Abuse Contact Email: [email protected]
Registrar Abuse Contact Phone: +34.935275235
Domain Status: ok https://www.icann.org/epp#ok
Registry Registrant ID: COCO-1883998
Registrant Name: CORE ASSOCIATION
Registrant Organization:
Registrant Street:
Registrant City: Geneva
Registrant State/Province: GE
Registrant Postal Code: CH-1215
Registrant Country: CH
Registrant Phone: +41.229295744
Registrant Phone Ext:
Registrant Fax: +41.229295745
Registrant Fax Ext:
Registrant Email: [email protected]
Registry Admin ID: COCO-354
Admin Name: CORE Secretariat
Admin Organization: CORE Association
Admin Street: cour de Rive 2
Admin City: Geneve
Admin State/Province: GE
Admin Postal Code: 1204
Admin Country: CH
Admin Phone: +41.223125610
Admin Phone Ext:
Admin Fax:
Admin Fax Ext:
Admin Email: [email protected]
Registry Tech ID: COCO-354
Tech Name: CORE Secretariat
Tech Organization: CORE Association
Tech Street: cour de Rive 2
Tech City: Geneve
Tech State/Province: GE
Tech Postal Code: 1204
Tech Country: CH
Tech Phone: +41.223125610
Tech Phone Ext:
Tech Fax:
Tech Fax Ext:
Tech Email: [email protected]
Name Server: us20-west.irondns.net 104.225.5.66 2607:fc50:2000:2001::2
Name Server: hk21.irondns.net 2403:2500:8000:1::9f9 103.6.86.97
Name Server: us19-east.irondns.net 4.71.215.210 2001:1900:2236::d2
DNSSEC: unsigned
URL of the ICANN WHOIS Data Problem Reporting System: http://wdprs.internic.net
>>> Last update of WHOIS database: 2018-05-03T13:22:13.239Z <<<

% (c) 2014 COREhub S.R.L.U. ("COREhub"). All rights reserved.
%
% NOTICE: Access to the domains information is provided to assist in
% determining the contents of a domain name registration record in the
% COREhub database. The data in this record is provided by COREhub for
% informational purposes only, and COREhub does not guarantee its
% accuracy. This service is intended only for query-based access. You
% are not authorized to access or query our Whois database through the
% use of electronic processes that are high-volume and automated except
% as reasonably necessary to register domain names or modify existing
% registrations.
%
% By submitting a Whois query, you agree that you will use this data
% only for lawful purposes and that, under no circumstances, will you
% use this data (i) to allow, enable, or otherwise support the
% transmission by e-mail, telephone, postal mail, facsimile or other
% means of mass unsolicited, commercial advertising or solicitations to
% entities other than the data recipient's own existing customers;
% and/or (ii) to enable high volume, automated, electronic processes
% that send queries or data to the COREhub systems, except as reasonably
% necessary to register domain names or modify existing registrations.
%
% The compilation, repackaging, dissemination or other use of the data
% in the COREhub Whois database is expressly prohibited without the
% prior written consent of COREhub. COREhub reserves the right to
% restrict your access to the Whois database in its sole discretion to
% ensure operational stability. COREhub may restrict or terminate your
% access to the Whois database for failure to abide by these terms of
% use. COREhub reserves the right to modify these terms at any time.
%
% For more information on Whois status codes, please visit
% https://icann.org/epp
Loading