nominet-epp 0.0.12 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +24 -0
- data/.travis.yml +14 -0
- data/.yardopts +8 -2
- data/Gemfile +22 -0
- data/Gemfile.lock +64 -0
- data/HISTORY.md +78 -0
- data/LICENSE +1 -1
- data/README.md +23 -0
- data/Rakefile +2 -37
- data/gemfiles/Gemfile.ruby18 +13 -0
- data/lib/nominet-epp/client.rb +364 -0
- data/lib/nominet-epp/notification.rb +346 -0
- data/lib/nominet-epp/operations.rb +2 -7
- data/lib/nominet-epp/request.rb +165 -0
- data/lib/nominet-epp/requests/contact/check.rb +9 -0
- data/lib/nominet-epp/requests/contact/create.rb +60 -0
- data/lib/nominet-epp/requests/contact/delete.rb +9 -0
- data/lib/nominet-epp/requests/contact/info.rb +9 -0
- data/lib/nominet-epp/requests/contact/release.rb +33 -0
- data/lib/nominet-epp/requests/contact/update.rb +63 -0
- data/lib/nominet-epp/requests/custom/handshake.rb +36 -0
- data/lib/nominet-epp/requests/custom/list.rb +38 -0
- data/lib/nominet-epp/requests/custom/tag_list.rb +25 -0
- data/lib/nominet-epp/requests/domain/check.rb +98 -0
- data/lib/nominet-epp/requests/domain/create.rb +97 -0
- data/lib/nominet-epp/requests/domain/delete.rb +9 -0
- data/lib/nominet-epp/requests/domain/info.rb +9 -0
- data/lib/nominet-epp/requests/domain/release.rb +33 -0
- data/lib/nominet-epp/requests/domain/renew.rb +9 -0
- data/lib/nominet-epp/requests/domain/unrenew.rb +33 -0
- data/lib/nominet-epp/requests/domain/update.rb +134 -0
- data/lib/nominet-epp/requests/host/check.rb +9 -0
- data/lib/nominet-epp/requests/host/create.rb +9 -0
- data/lib/nominet-epp/requests/host/delete.rb +9 -0
- data/lib/nominet-epp/requests/host/info.rb +9 -0
- data/lib/nominet-epp/requests/host/update.rb +9 -0
- data/lib/nominet-epp/responses/contact/check_response.rb +10 -0
- data/lib/nominet-epp/responses/contact/create_response.rb +14 -0
- data/lib/nominet-epp/responses/contact/delete_response.rb +10 -0
- data/lib/nominet-epp/responses/contact/info_response.rb +89 -0
- data/lib/nominet-epp/responses/contact/release_response.rb +10 -0
- data/lib/nominet-epp/responses/contact/update_response.rb +10 -0
- data/lib/nominet-epp/responses/custom/handshake_response.rb +33 -0
- data/lib/nominet-epp/responses/custom/list_response.rb +29 -0
- data/lib/nominet-epp/responses/custom/tag_list_response.rb +37 -0
- data/lib/nominet-epp/responses/domain/check_response.rb +40 -0
- data/lib/nominet-epp/responses/domain/create_response.rb +10 -0
- data/lib/nominet-epp/responses/domain/delete_response.rb +10 -0
- data/lib/nominet-epp/responses/domain/info_response.rb +128 -0
- data/lib/nominet-epp/responses/domain/release_response.rb +10 -0
- data/lib/nominet-epp/responses/domain/renew_response.rb +10 -0
- data/lib/nominet-epp/responses/domain/unrenew_response.rb +26 -0
- data/lib/nominet-epp/responses/domain/update_response.rb +10 -0
- data/lib/nominet-epp/responses/host/check_response.rb +10 -0
- data/lib/nominet-epp/responses/host/create_response.rb +14 -0
- data/lib/nominet-epp/responses/host/delete_response.rb +10 -0
- data/lib/nominet-epp/responses/host/info_response.rb +14 -0
- data/lib/nominet-epp/responses/host/update_response.rb +10 -0
- data/lib/nominet-epp/responses/response.rb +27 -0
- data/lib/nominet-epp/version.rb +4 -0
- data/lib/nominet-epp.rb +60 -161
- data/nominet-epp.gemspec +15 -65
- data/test/helper.rb +57 -0
- data/test/notifications/test_contact_deleted_notification.rb +23 -0
- data/test/notifications/test_domain_cancelled_notification.rb +23 -0
- data/test/notifications/test_domains_released_notification.rb +34 -0
- data/test/notifications/test_domains_suspended_notification.rb +30 -0
- data/test/notifications/test_handshake_rejected_notification.rb +34 -0
- data/test/notifications/test_registrant_transfer_notification.rb +78 -0
- data/test/notifications/test_registrar_change_notification.rb +119 -0
- data/test/requests/contact/test_contact_check_request.rb +25 -0
- data/test/requests/contact/test_contact_create_request.rb +104 -0
- data/test/requests/contact/test_contact_delete_request.rb +20 -0
- data/test/requests/contact/test_contact_info_request.rb +20 -0
- data/test/requests/contact/test_contact_release_request.rb +29 -0
- data/test/requests/contact/test_contact_update_request.rb +111 -0
- data/test/requests/custom/test_custom_handshake_request.rb +42 -0
- data/test/requests/custom/test_custom_list_request.rb +44 -0
- data/test/requests/custom/test_custom_tag_list_request.rb +21 -0
- data/test/requests/domain/test_domain_check_request.rb +140 -0
- data/test/requests/domain/test_domain_create_request.rb +136 -0
- data/test/requests/domain/test_domain_delete_request.rb +20 -0
- data/test/requests/domain/test_domain_info_request.rb +20 -0
- data/test/requests/domain/test_domain_release_request.rb +29 -0
- data/test/requests/domain/test_domain_renew_request.rb +15 -0
- data/test/requests/domain/test_domain_unrenew_request.rb +32 -0
- data/test/requests/domain/test_domain_update_request.rb +163 -0
- data/test/requests/host/test_host_check_request.rb +25 -0
- data/test/requests/host/test_host_create_request.rb +33 -0
- data/test/requests/host/test_host_delete_request.rb +20 -0
- data/test/requests/host/test_host_info_request.rb +20 -0
- data/test/requests/host/test_host_update_request.rb +55 -0
- data/test/responses/contact/test_contact_check_response.rb +28 -0
- data/test/responses/contact/test_contact_create_response.rb +28 -0
- data/test/responses/contact/test_contact_delete_response.rb +18 -0
- data/test/responses/contact/test_contact_info_response.rb +79 -0
- data/test/responses/contact/test_contact_release_response.rb +18 -0
- data/test/responses/contact/test_contact_update_response.rb +18 -0
- data/test/responses/custom/test_custom_handshake_response.rb +27 -0
- data/test/responses/custom/test_custom_list_response.rb +44 -0
- data/test/responses/custom/test_custom_tag_list_response.rb +43 -0
- data/test/responses/domain/test_domain_check_response.rb +56 -0
- data/test/responses/domain/test_domain_create_response.rb +34 -0
- data/test/responses/domain/test_domain_delete_response.rb +18 -0
- data/test/responses/domain/test_domain_info_response.rb +76 -0
- data/test/responses/domain/test_domain_release_response.rb +18 -0
- data/test/responses/domain/test_domain_renew_response.rb +27 -0
- data/test/responses/domain/test_domain_unrenew_response.rb +32 -0
- data/test/responses/domain/test_domain_update_response.rb +18 -0
- data/test/responses/host/test_host_check_response.rb +28 -0
- data/test/responses/host/test_host_create_response.rb +28 -0
- data/test/responses/host/test_host_delete_response.rb +18 -0
- data/test/responses/host/test_host_info_response.rb +28 -0
- data/test/responses/host/test_host_update_response.rb +18 -0
- data/test/support/responses/contact/check.xml +23 -0
- data/test/support/responses/contact/create.xml +23 -0
- data/test/support/responses/contact/delete.xml +12 -0
- data/test/support/responses/contact/info.xml +46 -0
- data/test/support/responses/contact/release.xml +12 -0
- data/test/support/responses/contact/update.xml +12 -0
- data/test/support/responses/custom/handshake.xml +24 -0
- data/test/support/responses/custom/list.xml +28 -0
- data/test/support/responses/custom/list_empty.xml +21 -0
- data/test/support/responses/custom/tag_list.xml +28 -0
- data/test/support/responses/domain/check-direct-rights.xml +1 -0
- data/test/support/responses/domain/check.xml +25 -0
- data/test/support/responses/domain/create.xml +24 -0
- data/test/support/responses/domain/delete.xml +12 -0
- data/test/support/responses/domain/info.xml +45 -0
- data/test/support/responses/domain/release.xml +12 -0
- data/test/support/responses/domain/renew.xml +24 -0
- data/test/support/responses/domain/unrenew.xml +26 -0
- data/test/support/responses/domain/update.xml +12 -0
- data/test/support/responses/host/check.xml +23 -0
- data/test/support/responses/host/create.xml +18 -0
- data/test/support/responses/host/delete.xml +12 -0
- data/test/support/responses/host/info.xml +25 -0
- data/test/support/responses/host/update.xml +12 -0
- data/test/support/responses/notifications/abuse-feed.xml +31 -0
- data/test/support/responses/notifications/account-change.xml +39 -0
- data/test/support/responses/notifications/contact-deleted.xml +22 -0
- data/test/support/responses/notifications/data-quality.xml +53 -0
- data/test/support/responses/notifications/domain-cancelled.xml +22 -0
- data/test/support/responses/notifications/domains-released.xml +31 -0
- data/test/support/responses/notifications/domains-suspended.xml +26 -0
- data/test/support/responses/notifications/handshake-rejected.xml +31 -0
- data/test/support/responses/notifications/handshake-request.xml +65 -0
- data/test/support/responses/notifications/hosts-cancelled.xml +28 -0
- data/test/support/responses/notifications/referral-accepted.xml +23 -0
- data/test/support/responses/notifications/referral-rejected.xml +22 -0
- data/test/support/responses/notifications/registrant-transfer.xml +54 -0
- data/test/support/responses/notifications/registrar-change.xml +67 -0
- data/test/support/schemas/README +12 -0
- data/test/support/schemas/RELEASENOTES +54 -0
- data/test/support/schemas/contact-1.0.xsd +387 -0
- data/test/support/schemas/contact-nom-ext-1.0.xsd +144 -0
- data/test/support/schemas/domain-1.0.xsd +432 -0
- data/test/support/schemas/domain-nom-ext-1.2.xsd +215 -0
- data/test/support/schemas/epp-1.0.xsd +403 -0
- data/test/support/schemas/eppcom-1.0.xsd +93 -0
- data/test/support/schemas/host-1.0.xsd +240 -0
- data/test/support/schemas/nom-abuse-feed-1.0.xsd +46 -0
- data/test/support/schemas/nom-direct-rights-1.0.xsd +48 -0
- data/test/support/schemas/nom-root-std-1.0.7.xsd +47 -0
- data/test/support/schemas/nom-root-tag-1.0.xsd +31 -0
- data/test/support/schemas/nom-tag-1.0.xsd +71 -0
- data/test/support/schemas/secDNS-1.1.xsd +127 -0
- data/test/support/schemas/std-contact-id-1.0.xsd +35 -0
- data/test/support/schemas/std-fork-1.0.xsd +31 -0
- data/test/support/schemas/std-handshake-1.0.xsd +61 -0
- data/test/support/schemas/std-list-1.0.xsd +55 -0
- data/test/support/schemas/std-locks-1.0.xsd +53 -0
- data/test/support/schemas/std-notifications-1.2.xsd +197 -0
- data/test/support/schemas/std-release-1.0.xsd +39 -0
- data/test/support/schemas/std-unrenew-1.0.xsd +26 -0
- data/test/support/schemas/std-warning-1.1.xsd +145 -0
- data/test/test_nominet-epp.rb +3 -3
- metadata +324 -104
- data/History.rdoc +0 -78
- data/README.rdoc +0 -23
- data/VERSION +0 -1
- data/lib/nominet-epp/operations/check.rb +0 -39
- data/lib/nominet-epp/operations/create.rb +0 -138
- data/lib/nominet-epp/operations/delete.rb +0 -20
- data/lib/nominet-epp/operations/fork.rb +0 -53
- data/lib/nominet-epp/operations/hello.rb +0 -11
- data/lib/nominet-epp/operations/info.rb +0 -93
- data/lib/nominet-epp/operations/list.rb +0 -83
- data/lib/nominet-epp/operations/lock.rb +0 -56
- data/lib/nominet-epp/operations/merge.rb +0 -41
- data/lib/nominet-epp/operations/poll.rb +0 -64
- data/lib/nominet-epp/operations/renew.rb +0 -40
- data/lib/nominet-epp/operations/transfer.rb +0 -84
- data/lib/nominet-epp/operations/unlock.rb +0 -56
- data/lib/nominet-epp/operations/unrenew.rb +0 -36
- data/lib/nominet-epp/operations/update.rb +0 -176
@@ -0,0 +1,89 @@
|
|
1
|
+
module NominetEPP
|
2
|
+
module Contact
|
3
|
+
class InfoResponse < BasicResponse
|
4
|
+
def initialize(response)
|
5
|
+
raise ArgumentError, "must be an EPP::Response" unless response.kind_of?(EPP::Response)
|
6
|
+
super EPP::Contact::InfoResponse.new(response)
|
7
|
+
|
8
|
+
parse_truncated
|
9
|
+
ext_inf_data
|
10
|
+
end
|
11
|
+
|
12
|
+
def id
|
13
|
+
@response.id
|
14
|
+
end
|
15
|
+
|
16
|
+
def name
|
17
|
+
@response.id
|
18
|
+
end
|
19
|
+
|
20
|
+
def type
|
21
|
+
@contact_infData['type']
|
22
|
+
end
|
23
|
+
def trad_name
|
24
|
+
@contact_infData['trad_name']
|
25
|
+
end
|
26
|
+
def co_no
|
27
|
+
@contact_infData['co_no']
|
28
|
+
end
|
29
|
+
def opt_out
|
30
|
+
@contact_infData['opt_out']
|
31
|
+
end
|
32
|
+
|
33
|
+
def client_id
|
34
|
+
@truncated['clID'] || @response.client_id
|
35
|
+
end
|
36
|
+
def creator_id
|
37
|
+
@truncated['crID'] || @response.creator_id
|
38
|
+
end
|
39
|
+
def updator_id
|
40
|
+
@truncated['upID'] || @response.updator_id
|
41
|
+
end
|
42
|
+
|
43
|
+
def method_missing(method, *args, &block)
|
44
|
+
return super unless @response.respond_to?(method)
|
45
|
+
return @truncated[method.to_s] if @truncated.has_key?(method.to_s) # only do truncated if response would handle it
|
46
|
+
@response.send(method, *args, &block)
|
47
|
+
end
|
48
|
+
|
49
|
+
def namespaces
|
50
|
+
{ 'warning' => 'http://www.nominet.org.uk/epp/xml/std-warning-1.1',
|
51
|
+
'contact-ext' => 'http://www.nominet.org.uk/epp/xml/contact-nom-ext-1.0' }
|
52
|
+
end
|
53
|
+
|
54
|
+
protected
|
55
|
+
def ext_inf_data
|
56
|
+
@contact_infData = {}
|
57
|
+
[@response.extension].flatten.compact.each do |node|
|
58
|
+
next unless node.name == 'infData'
|
59
|
+
node.find('//contact-ext:infData', namespaces).each do |infData|
|
60
|
+
infData.children.each do |child|
|
61
|
+
next if child.empty?
|
62
|
+
|
63
|
+
key = child.name.gsub('-', '_')
|
64
|
+
case key
|
65
|
+
when 'opt_out'
|
66
|
+
@contact_infData['opt_out'] = child.content.strip == 'Y'
|
67
|
+
else
|
68
|
+
@contact_infData[key] = child.content.strip
|
69
|
+
end
|
70
|
+
end
|
71
|
+
end
|
72
|
+
end
|
73
|
+
end
|
74
|
+
def parse_truncated
|
75
|
+
@truncated = {}
|
76
|
+
[@response.extension].flatten.compact.each do |node|
|
77
|
+
next unless node.name == 'truncated-field'
|
78
|
+
fieldName = node.attributes["field-name"]
|
79
|
+
ns, field = fieldName.split(":", 2)
|
80
|
+
content = node.content.strip
|
81
|
+
content =~ /Full entry is '([^']*)'/
|
82
|
+
content = $1
|
83
|
+
|
84
|
+
@truncated[field.gsub('-','_')] = content
|
85
|
+
end
|
86
|
+
end
|
87
|
+
end
|
88
|
+
end
|
89
|
+
end
|
@@ -0,0 +1,10 @@
|
|
1
|
+
module NominetEPP
|
2
|
+
module Contact
|
3
|
+
class UpdateResponse < BasicResponse
|
4
|
+
def initialize(response)
|
5
|
+
raise ArgumentError, "must be an EPP::Response" unless response.kind_of?(EPP::Response)
|
6
|
+
super EPP::Contact::UpdateResponse.new(response)
|
7
|
+
end
|
8
|
+
end
|
9
|
+
end
|
10
|
+
end
|
@@ -0,0 +1,33 @@
|
|
1
|
+
module NominetEPP
|
2
|
+
module Custom
|
3
|
+
class HandshakeResponse < BasicResponse
|
4
|
+
def initialize(response)
|
5
|
+
raise ArgumentError, "must be an EPP::Response" unless response.kind_of?(EPP::Response)
|
6
|
+
super
|
7
|
+
end
|
8
|
+
|
9
|
+
def case_id
|
10
|
+
@case_id ||= @response.data.find('//h:caseId', namespaces).first.content.strip
|
11
|
+
end
|
12
|
+
|
13
|
+
def domains
|
14
|
+
@domains ||= parse_domainList
|
15
|
+
end
|
16
|
+
|
17
|
+
def namespaces
|
18
|
+
{ 'h' => 'http://www.nominet.org.uk/epp/xml/std-handshake-1.0' }
|
19
|
+
end
|
20
|
+
|
21
|
+
protected
|
22
|
+
def parse_domainList
|
23
|
+
domains = []
|
24
|
+
|
25
|
+
@response.data.find('//h:domainName', namespaces).each do |node|
|
26
|
+
domains << node.content.strip
|
27
|
+
end
|
28
|
+
|
29
|
+
domains
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
@@ -0,0 +1,29 @@
|
|
1
|
+
module NominetEPP
|
2
|
+
module Custom
|
3
|
+
class ListResponse < BasicResponse
|
4
|
+
def initialize(response)
|
5
|
+
raise ArgumentError, "must be an EPP::Response" unless response.kind_of?(EPP::Response)
|
6
|
+
super
|
7
|
+
end
|
8
|
+
|
9
|
+
def domains
|
10
|
+
@domains ||= parse_listData
|
11
|
+
end
|
12
|
+
|
13
|
+
def namespaces
|
14
|
+
{ 'list' => 'http://www.nominet.org.uk/epp/xml/std-list-1.0' }
|
15
|
+
end
|
16
|
+
|
17
|
+
protected
|
18
|
+
def parse_listData
|
19
|
+
domains = []
|
20
|
+
|
21
|
+
@response.data.find('//list:domainName', namespaces).each do |node|
|
22
|
+
domains << node.content.strip
|
23
|
+
end
|
24
|
+
|
25
|
+
domains
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
@@ -0,0 +1,37 @@
|
|
1
|
+
module NominetEPP
|
2
|
+
module Custom
|
3
|
+
class TagListResponse < BasicResponse
|
4
|
+
def initialize(response)
|
5
|
+
raise ArgumentError, "must be an EPP::Response" unless response.kind_of?(EPP::Response)
|
6
|
+
super
|
7
|
+
end
|
8
|
+
|
9
|
+
def tags
|
10
|
+
@tags ||= parse_infdata
|
11
|
+
end
|
12
|
+
|
13
|
+
def namespaces
|
14
|
+
{ 'tag' => 'http://www.nominet.org.uk/epp/xml/nom-tag-1.0' }
|
15
|
+
end
|
16
|
+
|
17
|
+
protected
|
18
|
+
def parse_infdata
|
19
|
+
tags = {}
|
20
|
+
|
21
|
+
@response.data.find('//tag:infData', namespaces).each do |node|
|
22
|
+
tag = node.find('tag:registrar-tag').first.content.strip
|
23
|
+
name = node.find('tag:name').first.content.strip
|
24
|
+
handshake = node.find('tag:handshake').first.content.strip
|
25
|
+
|
26
|
+
trad = node.find('tag:trad-name').first
|
27
|
+
trad = trad && trad.content.strip
|
28
|
+
|
29
|
+
tags[tag] = { 'name' => name, 'handshake' => handshake == 'Y' }
|
30
|
+
tags[tag]['trad_name'] = trad if trad
|
31
|
+
end
|
32
|
+
|
33
|
+
tags
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
@@ -0,0 +1,40 @@
|
|
1
|
+
module NominetEPP
|
2
|
+
module Domain
|
3
|
+
class CheckResponse < BasicResponse
|
4
|
+
def initialize(response)
|
5
|
+
raise ArgumentError, "must be an EPP::Response" unless response.kind_of?(EPP::Response)
|
6
|
+
super EPP::Domain::CheckResponse.new(response)
|
7
|
+
|
8
|
+
ext_chk_data
|
9
|
+
end
|
10
|
+
|
11
|
+
def namespaces
|
12
|
+
{ 'domain-ext' => 'http://www.nominet.org.uk/epp/xml/domain-nom-ext-1.2',
|
13
|
+
'nom-direct-rights' => 'http://www.nominet.org.uk/epp/xml/nom-direct-rights-1.0' }
|
14
|
+
end
|
15
|
+
|
16
|
+
def abuse_limit
|
17
|
+
@abuse_limit
|
18
|
+
end
|
19
|
+
|
20
|
+
def right_of_registration
|
21
|
+
@right_of_registration
|
22
|
+
end
|
23
|
+
|
24
|
+
protected
|
25
|
+
def ext_chk_data
|
26
|
+
[@response.extension].flatten.compact.each do |node|
|
27
|
+
next unless node.name == 'chkData'
|
28
|
+
|
29
|
+
node.find('//domain-ext:chkData', namespaces).each do |chkData|
|
30
|
+
@abuse_limit = chkData['abuse-limit'].to_i
|
31
|
+
end
|
32
|
+
|
33
|
+
node.find('//nom-direct-rights:chkData', namespaces).each do |chkData|
|
34
|
+
@right_of_registration = chkData.find('nom-direct-rights:ror').first.content.strip
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
@@ -0,0 +1,10 @@
|
|
1
|
+
module NominetEPP
|
2
|
+
module Domain
|
3
|
+
class CreateResponse < BasicResponse
|
4
|
+
def initialize(response)
|
5
|
+
raise ArgumentError, "must be an EPP::Response" unless response.kind_of?(EPP::Response)
|
6
|
+
super EPP::Domain::CreateResponse.new(response)
|
7
|
+
end
|
8
|
+
end
|
9
|
+
end
|
10
|
+
end
|
@@ -0,0 +1,10 @@
|
|
1
|
+
module NominetEPP
|
2
|
+
module Domain
|
3
|
+
class DeleteResponse < BasicResponse
|
4
|
+
def initialize(response)
|
5
|
+
raise ArgumentError, "must be an EPP::Response" unless response.kind_of?(EPP::Response)
|
6
|
+
super EPP::Domain::DeleteResponse.new(response)
|
7
|
+
end
|
8
|
+
end
|
9
|
+
end
|
10
|
+
end
|
@@ -0,0 +1,128 @@
|
|
1
|
+
module NominetEPP
|
2
|
+
module Domain
|
3
|
+
class InfoResponse < BasicResponse
|
4
|
+
def initialize(response)
|
5
|
+
raise ArgumentError, "must be an EPP::Response" unless response.kind_of?(EPP::Response)
|
6
|
+
super EPP::Domain::InfoResponse.new(response)
|
7
|
+
|
8
|
+
parse_truncated
|
9
|
+
ext_inf_data
|
10
|
+
end
|
11
|
+
|
12
|
+
def nameservers
|
13
|
+
@nameservers ||= @response.nameservers.each do |ns|
|
14
|
+
ns['name'] = ns['name'].sub(/\.$/,'')
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
def hosts
|
19
|
+
@hosts ||= @response.hosts.map { |ns| ns.sub(/\.$/,'') }
|
20
|
+
end
|
21
|
+
|
22
|
+
def reg_status
|
23
|
+
@domain_infData['reg-status']
|
24
|
+
end
|
25
|
+
|
26
|
+
def first_bill
|
27
|
+
@domain_infData['first_bill']
|
28
|
+
end
|
29
|
+
def recur_bill
|
30
|
+
@domain_infData['recur_bill']
|
31
|
+
end
|
32
|
+
def auto_bill
|
33
|
+
@domain_infData['auto-bill']
|
34
|
+
end
|
35
|
+
def auto_period
|
36
|
+
@domain_infData['auto-period']
|
37
|
+
end
|
38
|
+
def next_bill
|
39
|
+
@domain_infData['next-bill']
|
40
|
+
end
|
41
|
+
def next_period
|
42
|
+
@domain_infData['next-period']
|
43
|
+
end
|
44
|
+
def renew_not_required
|
45
|
+
@domain_infData['renew-not-required']
|
46
|
+
end
|
47
|
+
def notes
|
48
|
+
@domain_infData['notes']
|
49
|
+
end
|
50
|
+
def reseller
|
51
|
+
@domain_infData['reseller']
|
52
|
+
end
|
53
|
+
|
54
|
+
def client_id
|
55
|
+
@truncated['clID'] || @response.client_id
|
56
|
+
end
|
57
|
+
def creator_id
|
58
|
+
@truncated['crID'] || @response.creator_id
|
59
|
+
end
|
60
|
+
def updator_id
|
61
|
+
@truncated['upID'] || @response.updator_id
|
62
|
+
end
|
63
|
+
|
64
|
+
def ds
|
65
|
+
@secDNS_infData
|
66
|
+
end
|
67
|
+
|
68
|
+
def method_missing(method, *args, &block)
|
69
|
+
return super unless @response.respond_to?(method)
|
70
|
+
return @truncated[method.to_s] if @truncated.has_key?(method.to_s) # only do truncated if response would handle it
|
71
|
+
@response.send(method, *args, &block)
|
72
|
+
end
|
73
|
+
|
74
|
+
def namespaces
|
75
|
+
{ 'secDNS' => 'urn:ietf:params:xml:ns:secDNS-1.1',
|
76
|
+
'warning' => 'http://www.nominet.org.uk/epp/xml/std-warning-1.1',
|
77
|
+
'domain-ext' => 'http://www.nominet.org.uk/epp/xml/domain-nom-ext-1.2' }
|
78
|
+
end
|
79
|
+
|
80
|
+
protected
|
81
|
+
def ext_inf_data
|
82
|
+
@secDNS_infData = []
|
83
|
+
@domain_infData = {}
|
84
|
+
[@response.extension].flatten.compact.each do |node|
|
85
|
+
next unless node.name == 'infData'
|
86
|
+
node.find('//domain-ext:infData', namespaces).each do |infData|
|
87
|
+
infData.children.each do |child|
|
88
|
+
next if child.empty?
|
89
|
+
|
90
|
+
key = child.name.gsub('-', '_')
|
91
|
+
case key
|
92
|
+
when 'notes'
|
93
|
+
@domain_infData['notes'] ||= Array.new
|
94
|
+
@domain_infData['notes'] << child.content.strip
|
95
|
+
else
|
96
|
+
@domain_infData[key] = child.content.strip
|
97
|
+
end
|
98
|
+
end
|
99
|
+
end
|
100
|
+
|
101
|
+
node.find('//secDNS:infData', namespaces).each do |infData|
|
102
|
+
next if infData.empty?
|
103
|
+
|
104
|
+
@secDNS_infData = infData.find('secDNS:dsData', namespaces).map do |dsData|
|
105
|
+
{ :key_tag => dsData.find('secDNS:keyTag', namespaces).first.content.strip,
|
106
|
+
:alg => dsData.find('secDNS:alg', namespaces).first.content.strip,
|
107
|
+
:digest_type => dsData.find('secDNS:digestType', namespaces).first.content.strip,
|
108
|
+
:digest => dsData.find('secDNS:digest', namespaces).first.content.strip}
|
109
|
+
end
|
110
|
+
end
|
111
|
+
end
|
112
|
+
end
|
113
|
+
def parse_truncated
|
114
|
+
@truncated = {}
|
115
|
+
[@response.extension].flatten.compact.each do |node|
|
116
|
+
next unless node.name == 'truncated-field'
|
117
|
+
fieldName = node.attributes["field-name"]
|
118
|
+
ns, field = fieldName.split(":", 2)
|
119
|
+
content = node.content.strip
|
120
|
+
content =~ /Full entry is '([^']*)'/
|
121
|
+
content = $1
|
122
|
+
|
123
|
+
@truncated[field.gsub('-','_')] = content
|
124
|
+
end
|
125
|
+
end
|
126
|
+
end
|
127
|
+
end
|
128
|
+
end
|
@@ -0,0 +1,10 @@
|
|
1
|
+
module NominetEPP
|
2
|
+
module Domain
|
3
|
+
class RenewResponse < BasicResponse
|
4
|
+
def initialize(response)
|
5
|
+
raise ArgumentError, "must be an EPP::Response" unless response.kind_of?(EPP::Response)
|
6
|
+
super EPP::Domain::RenewResponse.new(response)
|
7
|
+
end
|
8
|
+
end
|
9
|
+
end
|
10
|
+
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
module NominetEPP
|
2
|
+
module Domain
|
3
|
+
class UnrenewResponse < BasicResponse
|
4
|
+
def initialize(response)
|
5
|
+
raise ArgumentError, "must be an EPP::Response" unless response.kind_of?(EPP::Response)
|
6
|
+
super
|
7
|
+
end
|
8
|
+
|
9
|
+
def expires?(name)
|
10
|
+
expired[name]
|
11
|
+
end
|
12
|
+
|
13
|
+
protected
|
14
|
+
def expired
|
15
|
+
@expired ||= [@response.data].flatten.compact.inject({}) do |hash, renData|
|
16
|
+
name = renData.find('domain:name').first.content.strip
|
17
|
+
exDate = renData.find('domain:exDate').first.content.strip
|
18
|
+
exDate = Time.parse(exDate)
|
19
|
+
|
20
|
+
hash[name] = exDate
|
21
|
+
hash
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
@@ -0,0 +1,10 @@
|
|
1
|
+
module NominetEPP
|
2
|
+
module Domain
|
3
|
+
class UpdateResponse < BasicResponse
|
4
|
+
def initialize(response)
|
5
|
+
raise ArgumentError, "must be an EPP::Response" unless response.kind_of?(EPP::Response)
|
6
|
+
super EPP::Domain::UpdateResponse.new(response)
|
7
|
+
end
|
8
|
+
end
|
9
|
+
end
|
10
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
module NominetEPP
|
2
|
+
module Host
|
3
|
+
class CreateResponse < BasicResponse
|
4
|
+
def initialize(response)
|
5
|
+
raise ArgumentError, "must be an EPP::Response" unless response.kind_of?(EPP::Response)
|
6
|
+
super EPP::Host::CreateResponse.new(response)
|
7
|
+
end
|
8
|
+
|
9
|
+
def name
|
10
|
+
@name ||= @response.name.sub(/\.$/, '')
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
module NominetEPP
|
2
|
+
module Host
|
3
|
+
class InfoResponse < BasicResponse
|
4
|
+
def initialize(response)
|
5
|
+
raise ArgumentError, "must be an EPP::Response" unless response.kind_of?(EPP::Response)
|
6
|
+
super EPP::Host::InfoResponse.new(response)
|
7
|
+
end
|
8
|
+
|
9
|
+
def name
|
10
|
+
@name ||= @response.name.sub(/\.$/, '')
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
module NominetEPP
|
2
|
+
class BasicResponse
|
3
|
+
def initialize(response)
|
4
|
+
@response = response
|
5
|
+
end
|
6
|
+
|
7
|
+
undef to_s
|
8
|
+
|
9
|
+
def method_missing(method, *args, &block)
|
10
|
+
return super unless @response.respond_to?(method)
|
11
|
+
@response.send(method, *args, &block)
|
12
|
+
end
|
13
|
+
|
14
|
+
def respond_to_missing?(method, include_private)
|
15
|
+
@response.respond_to?(method, include_private)
|
16
|
+
end
|
17
|
+
|
18
|
+
unless RUBY_VERSION >= "1.9.2"
|
19
|
+
def respond_to?(method, include_private = false)
|
20
|
+
respond_to_missing?(method, include_private) || super
|
21
|
+
end
|
22
|
+
def method(sym)
|
23
|
+
respond_to_missing?(sym, true) ? @response.method(sym) : super
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|