epp-client-base 0.15.0 → 0.15.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -7
- data/lib/epp-client/base.rb +2 -2
- data/lib/epp-client/connection.rb +2 -2
- data/lib/epp-client/contact.rb +8 -8
- data/lib/epp-client/domain.rb +13 -13
- data/lib/epp-client/poll.rb +6 -6
- data/lib/epp-client/ssl.rb +2 -2
- data/lib/epp-client/version.rb +1 -1
- data/lib/epp-client/xml.rb +4 -4
- metadata +48 -45
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
|
-
---
|
2
|
-
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
5
|
-
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 3a8737d266d40e79a2c24d6903a8287637277c89
|
4
|
+
data.tar.gz: cd1d622b7eb0e909d44952d036366d541e88d1d7
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 4f7791548ea4f79def0b5b15cb06b8466c927241bb69e60cb2ed85c093fd2f9f3ade1dd1746bbeb4996d66aa7e58fe31272d8dcf7f645d438ef1a4afcc00825c
|
7
|
+
data.tar.gz: 07eb74a60e32711fa3709a59a5d5a1aaf53b1e0b3224f9d877554debb556a5ed03f0a162f9dcd7bc0b6f7a91d5aac55aa49aa364f2dfa51ba798e2d527c589a0
|
data/lib/epp-client/base.rb
CHANGED
@@ -81,7 +81,7 @@ module EPPClient
|
|
81
81
|
# [<tt>:ssl_key</tt>] The file containing the key of the certificate.
|
82
82
|
def initialize(attrs)
|
83
83
|
unless attrs.key?(:server) && attrs.key?(:client_id) && attrs.key?(:password)
|
84
|
-
|
84
|
+
raise ArgumentError, 'server, client_id and password are required'
|
85
85
|
end
|
86
86
|
|
87
87
|
attrs.each do |k, v|
|
@@ -111,7 +111,7 @@ module EPPClient
|
|
111
111
|
end
|
112
112
|
|
113
113
|
def debug
|
114
|
-
$DEBUG || ENV['EPP_CLIENT_DEBUG']
|
114
|
+
@debug ||= $DEBUG || ENV['EPP_CLIENT_DEBUG']
|
115
115
|
end
|
116
116
|
end
|
117
117
|
end
|
@@ -23,7 +23,7 @@ module EPPClient
|
|
23
23
|
@srv_version = xml.xpath('epp:epp/epp:greeting/epp:svcMenu/epp:version', EPPClient::SCHEMAS_URL).map(&:text)
|
24
24
|
@srv_lang = xml.xpath('epp:epp/epp:greeting/epp:svcMenu/epp:lang', EPPClient::SCHEMAS_URL).map(&:text)
|
25
25
|
@srv_ns = xml.xpath('epp:epp/epp:greeting/epp:svcMenu/epp:objURI', EPPClient::SCHEMAS_URL).map(&:text)
|
26
|
-
|
26
|
+
unless (ext = xml.xpath('epp:epp/epp:greeting/epp:svcMenu/epp:svcExtension/epp:extURI', EPPClient::SCHEMAS_URL)).empty?
|
27
27
|
@srv_ext = ext.map(&:text)
|
28
28
|
end
|
29
29
|
|
@@ -61,7 +61,7 @@ module EPPClient
|
|
61
61
|
# gets a frame from the socket and returns the parsed response.
|
62
62
|
def one_frame
|
63
63
|
size = @socket.read(4)
|
64
|
-
|
64
|
+
raise SocketError, @socket.eof? ? 'Connection closed by remote server' : 'Error reading frame from remote server' if size.nil?
|
65
65
|
size = size.unpack('N')[0]
|
66
66
|
@recv_frame = @socket.read(size - 4)
|
67
67
|
recv_frame_to_xml
|
data/lib/epp-client/contact.rb
CHANGED
@@ -132,15 +132,15 @@ module EPPClient
|
|
132
132
|
:id => contact.xpath('contact:id', EPPClient::SCHEMAS_URL).text,
|
133
133
|
:roid => contact.xpath('contact:roid', EPPClient::SCHEMAS_URL).text,
|
134
134
|
}
|
135
|
-
|
135
|
+
unless (status = contact.xpath('contact:status', EPPClient::SCHEMAS_URL)).empty?
|
136
136
|
ret[:status] = status.map { |s| s.attr('s') }
|
137
137
|
end
|
138
138
|
|
139
|
-
|
139
|
+
unless (postalInfo = contact.xpath('contact:postalInfo', EPPClient::SCHEMAS_URL)).empty?
|
140
140
|
ret[:postalInfo] = postalInfo.inject({}) do |acc, p|
|
141
141
|
type = p.attr('type').to_sym
|
142
142
|
acc[type] = { :name => p.xpath('contact:name', EPPClient::SCHEMAS_URL).text, :addr => {} }
|
143
|
-
|
143
|
+
unless (org = p.xpath('contact:org', EPPClient::SCHEMAS_URL)).empty?
|
144
144
|
acc[type][:org] = org.text
|
145
145
|
end
|
146
146
|
addr = p.xpath('contact:addr', EPPClient::SCHEMAS_URL)
|
@@ -150,7 +150,7 @@ module EPPClient
|
|
150
150
|
acc[type][:addr][val.to_sym] = addr.xpath("contact:#{val}", EPPClient::SCHEMAS_URL).text
|
151
151
|
end
|
152
152
|
%w(sp pc).each do |val|
|
153
|
-
|
153
|
+
unless (r = addr.xpath("contact:#{val}", EPPClient::SCHEMAS_URL)).empty?
|
154
154
|
acc[type][:addr][val.to_sym] = r.text
|
155
155
|
end
|
156
156
|
end
|
@@ -160,19 +160,19 @@ module EPPClient
|
|
160
160
|
end
|
161
161
|
|
162
162
|
%w(voice fax email clID crID upID).each do |val|
|
163
|
-
|
163
|
+
unless (value = contact.xpath("contact:#{val}", EPPClient::SCHEMAS_URL)).empty?
|
164
164
|
ret[val.to_sym] = value.text
|
165
165
|
end
|
166
166
|
end
|
167
167
|
%w(crDate upDate trDate).each do |val|
|
168
|
-
|
168
|
+
unless (date = contact.xpath("contact:#{val}", EPPClient::SCHEMAS_URL)).empty?
|
169
169
|
ret[val.to_sym] = DateTime.parse(date.text)
|
170
170
|
end
|
171
171
|
end
|
172
|
-
|
172
|
+
unless (authInfo = contact.xpath('contact:authInfo', EPPClient::SCHEMAS_URL)).empty?
|
173
173
|
ret[:authInfo] = authInfo.xpath('contact:pw', EPPClient::SCHEMAS_URL).text
|
174
174
|
end
|
175
|
-
|
175
|
+
unless (disclose = contact.xpath('contact:disclose', EPPClient::SCHEMAS_URL)).empty?
|
176
176
|
ret[:disclose] = { :flag => disclose.attr('flag').value == '1', :elements => [] }
|
177
177
|
disclose.children.each do |c|
|
178
178
|
r = { :name => c.name }
|
data/lib/epp-client/domain.rb
CHANGED
@@ -128,13 +128,13 @@ module EPPClient
|
|
128
128
|
:name => dom.xpath('domain:name', EPPClient::SCHEMAS_URL).text,
|
129
129
|
:roid => dom.xpath('domain:roid', EPPClient::SCHEMAS_URL).text,
|
130
130
|
}
|
131
|
-
|
131
|
+
unless (status = dom.xpath('domain:status', EPPClient::SCHEMAS_URL)).empty?
|
132
132
|
ret[:status] = status.map { |s| s.attr('s') }
|
133
133
|
end
|
134
|
-
|
134
|
+
unless (registrant = dom.xpath('domain:registrant', EPPClient::SCHEMAS_URL)).empty?
|
135
135
|
ret[:registrant] = registrant.text
|
136
136
|
end
|
137
|
-
|
137
|
+
unless (contact = dom.xpath('domain:contact', EPPClient::SCHEMAS_URL)).empty?
|
138
138
|
ret[:contacts] = contact.inject({}) do |a, c|
|
139
139
|
s = c.attr('type').to_sym
|
140
140
|
a[s] ||= []
|
@@ -142,36 +142,36 @@ module EPPClient
|
|
142
142
|
a
|
143
143
|
end
|
144
144
|
end
|
145
|
-
|
146
|
-
if (hostObj = ns.xpath('domain:hostObj', EPPClient::SCHEMAS_URL)).
|
145
|
+
unless (ns = dom.xpath('domain:ns', EPPClient::SCHEMAS_URL)).empty?
|
146
|
+
if !(hostObj = ns.xpath('domain:hostObj', EPPClient::SCHEMAS_URL)).empty?
|
147
147
|
ret[:ns] = hostObj.map(&:text)
|
148
|
-
elsif (hostAttr = ns.xpath('domain:hostAttr', EPPClient::SCHEMAS_URL)).
|
148
|
+
elsif !(hostAttr = ns.xpath('domain:hostAttr', EPPClient::SCHEMAS_URL)).empty?
|
149
149
|
ret[:ns] = hostAttr.map do |h|
|
150
150
|
r = { :hostName => h.xpath('domain:hostName', EPPClient::SCHEMAS_URL).text }
|
151
|
-
|
151
|
+
unless (v4 = h.xpath('domain:hostAddr[@ip="v4"]', EPPClient::SCHEMAS_URL)).empty?
|
152
152
|
r[:hostAddrv4] = v4.map(&:text)
|
153
153
|
end
|
154
|
-
|
154
|
+
unless (v6 = h.xpath('domain:hostAddr[@ip="v6"]', EPPClient::SCHEMAS_URL)).empty?
|
155
155
|
r[:hostAddrv6] = v6.map(&:text)
|
156
156
|
end
|
157
157
|
r
|
158
158
|
end
|
159
159
|
end
|
160
160
|
end
|
161
|
-
|
161
|
+
unless (host = dom.xpath('domain:host', EPPClient::SCHEMAS_URL)).empty?
|
162
162
|
ret[:host] = host.map(&:text)
|
163
163
|
end
|
164
164
|
%w(clID upID).each do |val|
|
165
|
-
|
165
|
+
unless (r = dom.xpath("domain:#{val}", EPPClient::SCHEMAS_URL)).empty?
|
166
166
|
ret[val.to_sym] = r.text
|
167
167
|
end
|
168
168
|
end
|
169
169
|
%w(crDate exDate upDate trDate).each do |val|
|
170
|
-
|
170
|
+
unless (r = dom.xpath("domain:#{val}", EPPClient::SCHEMAS_URL)).empty?
|
171
171
|
ret[val.to_sym] = DateTime.parse(r.text)
|
172
172
|
end
|
173
173
|
end
|
174
|
-
|
174
|
+
unless (authInfo = dom.xpath('domain:authInfo', EPPClient::SCHEMAS_URL)).empty?
|
175
175
|
ret[:authInfo] = authInfo.xpath('domain:pw', EPPClient::SCHEMAS_URL).text
|
176
176
|
end
|
177
177
|
ret
|
@@ -399,7 +399,7 @@ module EPPClient
|
|
399
399
|
:acID => dom.xpath('domain:acID', EPPClient::SCHEMAS_URL).text,
|
400
400
|
:acDate => DateTime.parse(dom.xpath('domain:acDate', EPPClient::SCHEMAS_URL).text),
|
401
401
|
}
|
402
|
-
|
402
|
+
unless (exDate = dom.xpath('domain:exDate', EPPClient::SCHEMAS_URL)).empty?
|
403
403
|
ret[:exDate] = DateTime.parse(exDate)
|
404
404
|
end
|
405
405
|
ret
|
data/lib/epp-client/poll.rb
CHANGED
@@ -29,23 +29,23 @@ module EPPClient
|
|
29
29
|
|
30
30
|
def poll_req_process(xml) #:nodoc:
|
31
31
|
ret = {}
|
32
|
-
|
32
|
+
unless (date = xml.xpath('epp:msgQ/epp:qDate', EPPClient::SCHEMAS_URL)).empty?
|
33
33
|
ret[:qDate] = DateTime.parse(date.text)
|
34
34
|
end
|
35
|
-
|
35
|
+
unless (msg = xml.xpath('epp:msgQ/epp:msg', EPPClient::SCHEMAS_URL)).empty?
|
36
36
|
ret[:msg] = msg.text
|
37
37
|
ret[:msg_xml] = msg.to_s
|
38
38
|
end
|
39
|
-
if (obj = xml.xpath('epp:resData', EPPClient::SCHEMAS_URL)).
|
40
|
-
(obj = xml.xpath('epp:extension', EPPClient::SCHEMAS_URL)).
|
39
|
+
if !(obj = xml.xpath('epp:resData', EPPClient::SCHEMAS_URL)).empty? ||
|
40
|
+
!(obj = xml.xpath('epp:extension', EPPClient::SCHEMAS_URL)).empty?
|
41
41
|
ret[:obj_xml] = obj.to_s
|
42
42
|
PARSERS.each do |xpath, parser|
|
43
|
-
next
|
43
|
+
next if obj.xpath(xpath, EPPClient::SCHEMAS_URL).empty?
|
44
44
|
ret[:obj] = case parser
|
45
45
|
when Symbol
|
46
46
|
send(parser, xml)
|
47
47
|
else
|
48
|
-
|
48
|
+
raise NotImplementedError
|
49
49
|
end
|
50
50
|
end
|
51
51
|
end
|
data/lib/epp-client/ssl.rb
CHANGED
@@ -11,7 +11,7 @@ module EPPClient
|
|
11
11
|
key = File.read(key) unless key =~ /-----BEGIN RSA PRIVATE KEY-----/
|
12
12
|
@ssl_key = OpenSSL::PKey::RSA.new(key)
|
13
13
|
else
|
14
|
-
|
14
|
+
raise ArgumentError, 'Must either be an OpenSSL::PKey::RSA object, a filename or a key'
|
15
15
|
end
|
16
16
|
end
|
17
17
|
|
@@ -23,7 +23,7 @@ module EPPClient
|
|
23
23
|
cert = File.read(cert) unless cert =~ /-----BEGIN CERTIFICATE-----/
|
24
24
|
@ssl_cert = OpenSSL::X509::Certificate.new(cert)
|
25
25
|
else
|
26
|
-
|
26
|
+
raise ArgumentError, 'Must either be an OpenSSL::X509::Certificate object, a filename or a certificate'
|
27
27
|
end
|
28
28
|
end
|
29
29
|
|
data/lib/epp-client/version.rb
CHANGED
data/lib/epp-client/xml.rb
CHANGED
@@ -59,7 +59,7 @@ module EPPClient
|
|
59
59
|
|
60
60
|
args[:range] ||= 1000..1999
|
61
61
|
|
62
|
-
if (mq = xml.xpath('epp:epp/epp:response/epp:msgQ', EPPClient::SCHEMAS_URL)).
|
62
|
+
if !(mq = xml.xpath('epp:epp/epp:response/epp:msgQ', EPPClient::SCHEMAS_URL)).empty?
|
63
63
|
@msgQ_count = mq.attribute('count').value.to_i
|
64
64
|
@msgQ_id = mq.attribute('id').value
|
65
65
|
puts "DEBUG: MSGQ : count=#{@msgQ_count}, id=#{@msgQ_id}\n" if debug
|
@@ -68,14 +68,14 @@ module EPPClient
|
|
68
68
|
@msgQ_id = nil
|
69
69
|
end
|
70
70
|
|
71
|
-
|
71
|
+
unless (trID = xml.xpath('epp:epp/epp:response/epp:trID', EPPClient::SCHEMAS_URL)).empty?
|
72
72
|
@trID = get_trid(trID)
|
73
73
|
end
|
74
74
|
|
75
75
|
res = xml.xpath('epp:epp/epp:response/epp:result', EPPClient::SCHEMAS_URL)
|
76
76
|
code = res.attribute('code').value.to_i
|
77
77
|
|
78
|
-
|
78
|
+
raise EPPClient::EPPErrorResponse.new(:xml => xml, :code => code, :message => res.xpath('epp:msg', EPPClient::SCHEMAS_URL).text) unless args[:range].include?(code)
|
79
79
|
|
80
80
|
return true unless args.key?(:callback)
|
81
81
|
|
@@ -83,7 +83,7 @@ module EPPClient
|
|
83
83
|
when Symbol
|
84
84
|
return send(cb, xml.xpath('epp:epp/epp:response', EPPClient::SCHEMAS_URL))
|
85
85
|
else
|
86
|
-
|
86
|
+
raise ArgumentError, 'Invalid callback type'
|
87
87
|
end
|
88
88
|
end
|
89
89
|
|
metadata
CHANGED
@@ -1,56 +1,64 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: epp-client-base
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.15.
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.15.1
|
5
5
|
platform: ruby
|
6
|
-
authors:
|
6
|
+
authors:
|
7
7
|
- Mathieu Arnold
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
- !ruby/object:Gem::Dependency
|
11
|
+
date: 2016-02-29 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
15
14
|
name: bundler
|
16
|
-
|
17
|
-
|
18
|
-
requirements:
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
19
17
|
- - ">="
|
20
|
-
- !ruby/object:Gem::Version
|
18
|
+
- !ruby/object:Gem::Version
|
21
19
|
version: 1.0.0
|
22
20
|
type: :development
|
23
|
-
version_requirements: *id001
|
24
|
-
- !ruby/object:Gem::Dependency
|
25
|
-
name: nokogiri
|
26
21
|
prerelease: false
|
27
|
-
|
28
|
-
requirements:
|
29
|
-
- -
|
30
|
-
- !ruby/object:Gem::Version
|
31
|
-
version:
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: 1.0.0
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: nokogiri
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '1.4'
|
32
34
|
type: :runtime
|
33
|
-
version_requirements: *id002
|
34
|
-
- !ruby/object:Gem::Dependency
|
35
|
-
name: builder
|
36
35
|
prerelease: false
|
37
|
-
|
38
|
-
requirements:
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '1.4'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: builder
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
39
45
|
- - ">="
|
40
|
-
- !ruby/object:Gem::Version
|
46
|
+
- !ruby/object:Gem::Version
|
41
47
|
version: 2.1.2
|
42
48
|
type: :runtime
|
43
|
-
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: 2.1.2
|
44
55
|
description: An extensible EPP client library.
|
45
|
-
email:
|
56
|
+
email:
|
46
57
|
- m@absolight.fr
|
47
58
|
executables: []
|
48
|
-
|
49
59
|
extensions: []
|
50
|
-
|
51
60
|
extra_rdoc_files: []
|
52
|
-
|
53
|
-
files:
|
61
|
+
files:
|
54
62
|
- ChangeLog
|
55
63
|
- Gemfile
|
56
64
|
- MIT-LICENSE
|
@@ -81,30 +89,25 @@ files:
|
|
81
89
|
- vendor/ietf/rfc5910.txt
|
82
90
|
homepage: https://github.com/Absolight/epp-client
|
83
91
|
licenses: []
|
84
|
-
|
85
92
|
metadata: {}
|
86
|
-
|
87
93
|
post_install_message:
|
88
94
|
rdoc_options: []
|
89
|
-
|
90
|
-
require_paths:
|
95
|
+
require_paths:
|
91
96
|
- lib
|
92
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
93
|
-
requirements:
|
97
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
98
|
+
requirements:
|
94
99
|
- - ">="
|
95
|
-
- !ruby/object:Gem::Version
|
100
|
+
- !ruby/object:Gem::Version
|
96
101
|
version: 1.8.7
|
97
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
98
|
-
requirements:
|
102
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
103
|
+
requirements:
|
99
104
|
- - ">="
|
100
|
-
- !ruby/object:Gem::Version
|
105
|
+
- !ruby/object:Gem::Version
|
101
106
|
version: 1.3.6
|
102
107
|
requirements: []
|
103
|
-
|
104
108
|
rubyforge_project:
|
105
|
-
rubygems_version: 2.
|
109
|
+
rubygems_version: 2.4.8
|
106
110
|
signing_key:
|
107
111
|
specification_version: 4
|
108
112
|
summary: An extensible EPP client library
|
109
113
|
test_files: []
|
110
|
-
|