Class: MonoVM::Whois::Registry::Sources::IanaBootstrap

Inherits:
Base
  • Object
show all
Defined in:
lib/monovm/whois/registry/sources/iana_bootstrap.rb

Overview

The IANA RDAP bootstrap registry (RFC 7484).

IANA publishes the authoritative TLD -> RDAP base URL map at https://data.iana.org/rdap/dns.json. A snapshot ships with the gem, which is why this library can answer for far more TLDs than a hand-maintained port 43 list covers, and why those answers are structured JSON instead of registry prose.

The file looks like:

{
"version": "1.0",
"publication": "2026-07-23T02:00:03Z",
"services": [
  [ ["com", "net"], ["https://rdap.verisign.com/com/v1/"] ]
]
}

Reading is deliberately offline. Fetching at load time would put a network round trip in front of every process boot and make the library's own startup depend on IANA being reachable; rake data:refresh_rdap updates the snapshot instead.

Constant Summary collapse

BOOTSTRAP_URL =
"https://data.iana.org/rdap/dns.json"
DOMAIN_PATH =

RDAP domain lookups live under {base}/domain/{name} (RFC 7482 §3.1.3).

"domain/"

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(path: Paths::RDAP_BOOTSTRAP, optional: true) ⇒ IanaBootstrap

Returns a new instance of IanaBootstrap.



41
42
43
44
45
# File 'lib/monovm/whois/registry/sources/iana_bootstrap.rb', line 41

def initialize(path: Paths::RDAP_BOOTSTRAP, optional: true)
  @path = path
  @optional = optional
  super()
end

Instance Attribute Details

#pathObject (readonly)

Returns the value of attribute path.



39
40
41
# File 'lib/monovm/whois/registry/sources/iana_bootstrap.rb', line 39

def path
  @path
end

Instance Method Details

#loadHash{String => Definition}

Returns:



61
62
63
64
65
66
67
68
69
70
71
72
73
# File 'lib/monovm/whois/registry/sources/iana_bootstrap.rb', line 61

def load
  services = document&.fetch("services", nil)
  return {} unless services.is_a?(Array)

  services.each_with_object({}) do |service, definitions|
    endpoint = endpoint_for(service)
    next if endpoint.nil?

    tlds_in(service).each do |tld|
      definitions[tld] ||= Definition.new(tld: tld, rdap_endpoint: endpoint, sources: [name])
    end
  end
end

#nameObject



47
48
49
# File 'lib/monovm/whois/registry/sources/iana_bootstrap.rb', line 47

def name
  "iana-rdap"
end

#optional?Boolean

Returns:

  • (Boolean)


51
52
53
# File 'lib/monovm/whois/registry/sources/iana_bootstrap.rb', line 51

def optional?
  @optional
end

#published_atString?

Returns the snapshot's publication timestamp.

Returns:

  • (String, nil)

    the snapshot's publication timestamp



56
57
58
# File 'lib/monovm/whois/registry/sources/iana_bootstrap.rb', line 56

def published_at
  document&.fetch("publication", nil)
end