epp-client-secdns 0.14.0 → 0.15.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Rakefile +4 -5
- data/epp-client-secdns.gemspec +4 -4
- data/lib/epp-client/secdns.rb +89 -88
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA512:
|
3
|
-
|
4
|
-
|
3
|
+
metadata.gz: 1650c6539c0e8047075211f9d8f934c521473d1657ffb7f300f1f8280ab003bdbe6843cb499453f0ffff6b1528edcfd002bff67512a5d36f16b081e4fa40bbcf
|
4
|
+
data.tar.gz: 48f56471cb4d15e7e42fa6783064d72ec266f177b7d132dbdf6c29dfa0cf41974a1171a8d7ec8c449e782853673dde6c4057436754d5541d281fcf42d09632a8
|
5
5
|
SHA1:
|
6
|
-
|
7
|
-
|
6
|
+
metadata.gz: 388f0b7cd8556735afc356474070191e4267da30
|
7
|
+
data.tar.gz: 9399f224290ad9532045070f0f2e3e108db4c0fc
|
data/Rakefile
CHANGED
@@ -2,9 +2,9 @@
|
|
2
2
|
require 'rake'
|
3
3
|
require 'rdoc/task'
|
4
4
|
require 'rubygems/package_task'
|
5
|
-
require
|
5
|
+
require 'bundler/gem_helper'
|
6
6
|
|
7
|
-
MY_GEMS = Dir['*.gemspec'].map {|g| g.sub(/.*-(.*)\.gemspec/, '\1')}
|
7
|
+
MY_GEMS = Dir['*.gemspec'].map { |g| g.sub(/.*-(.*)\.gemspec/, '\1') }
|
8
8
|
|
9
9
|
MY_GEMS.each do |g|
|
10
10
|
namespace g do
|
@@ -26,10 +26,10 @@ task :build => 'all:build'
|
|
26
26
|
task :install => 'all:install'
|
27
27
|
task :push => 'all:push'
|
28
28
|
|
29
|
-
desc
|
29
|
+
desc 'Generate documentation for the Rails framework'
|
30
30
|
Rake::RDocTask.new do |rdoc|
|
31
31
|
rdoc.rdoc_dir = 'doc/rdoc'
|
32
|
-
rdoc.title =
|
32
|
+
rdoc.title = 'Documentation'
|
33
33
|
|
34
34
|
rdoc.options << '--line-numbers' << '--inline-source'
|
35
35
|
rdoc.options << '--charset' << 'utf-8'
|
@@ -38,4 +38,3 @@ Rake::RDocTask.new do |rdoc|
|
|
38
38
|
rdoc.rdoc_files.include('ChangeLog')
|
39
39
|
rdoc.rdoc_files.include('lib/**/*.rb')
|
40
40
|
end
|
41
|
-
|
data/epp-client-secdns.gemspec
CHANGED
@@ -8,12 +8,12 @@ Gem::Specification.new do |gem|
|
|
8
8
|
gem.email = ['m@absolight.fr']
|
9
9
|
gem.description = 'SecDNS EPP client library.'
|
10
10
|
gem.summary = 'SecDNS EPP client library'
|
11
|
-
gem.homepage
|
11
|
+
gem.homepage = 'https://github.com/Absolight/epp-client'
|
12
12
|
|
13
13
|
gem.required_ruby_version = '>= 1.8.7'
|
14
|
-
gem.required_rubygems_version =
|
14
|
+
gem.required_rubygems_version = '>= 1.3.6'
|
15
15
|
|
16
|
-
gem.files
|
16
|
+
gem.files = [
|
17
17
|
'ChangeLog',
|
18
18
|
'Gemfile',
|
19
19
|
'MIT-LICENSE',
|
@@ -30,7 +30,7 @@ Gem::Specification.new do |gem|
|
|
30
30
|
gem.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
31
31
|
gem.require_paths = ['lib']
|
32
32
|
|
33
|
-
gem.add_development_dependency
|
33
|
+
gem.add_development_dependency 'bundler', '>= 1.0.0'
|
34
34
|
gem.add_dependency('nokogiri', '~> 1.4')
|
35
35
|
gem.add_dependency('builder', '>= 2.1.2')
|
36
36
|
end
|
data/lib/epp-client/secdns.rb
CHANGED
@@ -1,10 +1,11 @@
|
|
1
1
|
module EPPClient
|
2
|
+
# This implements the DNSSEC bits.
|
2
3
|
module SecDNS
|
3
|
-
SCHEMAS_SECDNS = %w
|
4
|
+
SCHEMAS_SECDNS = %w(
|
4
5
|
secDNS-1.1
|
5
|
-
|
6
|
+
).freeze
|
6
7
|
|
7
|
-
EPPClient::SCHEMAS_URL.merge!(SCHEMAS_SECDNS.inject({}) do |a,s|
|
8
|
+
EPPClient::SCHEMAS_URL.merge!(SCHEMAS_SECDNS.inject({}) do |a, s|
|
8
9
|
a[s.sub(/-1\.1$/, '')] = "urn:ietf:params:xml:ns:#{s}" if s =~ /-1\.1$/
|
9
10
|
a[s] = "urn:ietf:params:xml:ns:#{s}"
|
10
11
|
a
|
@@ -65,16 +66,16 @@ module EPPClient
|
|
65
66
|
ret = super
|
66
67
|
ret_secdns = {}
|
67
68
|
if (maxSigLife = xml.xpath('epp:extension/secDNS:infData/secDNS:maxSigLife', EPPClient::SCHEMAS_URL)).size > 0
|
68
|
-
|
69
|
+
ret_secdns[:maxSigLife] = maxSigLife.text
|
69
70
|
end
|
70
71
|
ret_secdns[:dsData] = xml.xpath('epp:extension/secDNS:infData/secDNS:dsData', EPPClient::SCHEMAS_URL).map do |s|
|
71
|
-
|
72
|
+
parse_ds_data(s)
|
72
73
|
end
|
73
74
|
ret_secdns[:keyData] = xml.xpath('epp:extension/secDNS:infData/secDNS:keyData', EPPClient::SCHEMAS_URL).map do |s|
|
74
|
-
|
75
|
+
parse_key_data(s)
|
75
76
|
end
|
76
77
|
|
77
|
-
ret[:secDNS] = ret_secdns unless ret_secdns.values.
|
78
|
+
ret[:secDNS] = ret_secdns unless ret_secdns.values.count(&:nil?) == 0
|
78
79
|
ret
|
79
80
|
end
|
80
81
|
|
@@ -97,27 +98,24 @@ module EPPClient
|
|
97
98
|
def domain_create_xml(domain) #:nodoc:
|
98
99
|
ret = super
|
99
100
|
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
end
|
116
|
-
end
|
117
|
-
return insert_extension(ret, ext)
|
118
|
-
else
|
119
|
-
return ret
|
101
|
+
return ret unless domain.key?(:maxSigLife) || domain.key?(:dsData) || domain.key?(:keyData)
|
102
|
+
|
103
|
+
ext = extension do |xml|
|
104
|
+
xml.create(:xmlns => EPPClient::SCHEMAS_URL['secDNS']) do
|
105
|
+
xml.maxSigLife(domain[:maxSigLife]) if domain.key?(:maxSigLife)
|
106
|
+
if domain.key?(:dsData)
|
107
|
+
domain[:dsData].each do |ds|
|
108
|
+
make_ds_data(xml, ds)
|
109
|
+
end
|
110
|
+
elsif domain.key?(:keyData)
|
111
|
+
domain[:keyData].each do |key|
|
112
|
+
make_key_data(xml, key)
|
113
|
+
end
|
114
|
+
end
|
115
|
+
end
|
120
116
|
end
|
117
|
+
|
118
|
+
insert_extension(ret, ext)
|
121
119
|
end
|
122
120
|
|
123
121
|
# Extends the EPPClient::Domain#domain_update so that secDNS informations
|
@@ -156,89 +154,92 @@ module EPPClient
|
|
156
154
|
def domain_update_xml(domain) #:nodoc:
|
157
155
|
ret = super
|
158
156
|
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
else
|
200
|
-
return ret
|
157
|
+
return ret unless domain.key?(:secDNS)
|
158
|
+
|
159
|
+
sd = domain[:secDNS]
|
160
|
+
|
161
|
+
ext = extension do |xml|
|
162
|
+
xml.update(sd[:urgent] == true ? { :urgent => true } : {}, :xmlns => EPPClient::SCHEMAS_URL['secDNS']) do
|
163
|
+
if sd.key?(:rem)
|
164
|
+
xml.rem do
|
165
|
+
if sd[:rem].key?(:all) && sd[:rem][:all] == true
|
166
|
+
xml.all true
|
167
|
+
elsif sd[:rem].key?(:dsData)
|
168
|
+
sd[:rem][:dsData].each do |ds|
|
169
|
+
make_ds_data(xml, ds)
|
170
|
+
end
|
171
|
+
elsif sd[:rem].key?(:keyData)
|
172
|
+
sd[:rem][:keyData].each do |key|
|
173
|
+
make_key_data(xml, key)
|
174
|
+
end
|
175
|
+
end
|
176
|
+
end
|
177
|
+
end
|
178
|
+
if sd.key?(:add)
|
179
|
+
xml.add do
|
180
|
+
if sd[:add].key?(:dsData)
|
181
|
+
sd[:add][:dsData].each do |ds|
|
182
|
+
make_ds_data(xml, ds)
|
183
|
+
end
|
184
|
+
elsif sd[:add].key?(:keyData)
|
185
|
+
sd[:add][:keyData].each do |key|
|
186
|
+
make_key_data(xml, key)
|
187
|
+
end
|
188
|
+
end
|
189
|
+
end
|
190
|
+
end
|
191
|
+
if sd.key?(:chg) && sd[:chg].key?(:maxSigLife)
|
192
|
+
xml.chg do
|
193
|
+
xml.maxSigLife sd[:chg][:maxSigLife]
|
194
|
+
end
|
195
|
+
end
|
196
|
+
end
|
201
197
|
end
|
198
|
+
|
199
|
+
insert_extension(ret, ext)
|
202
200
|
end
|
203
201
|
|
204
202
|
private
|
203
|
+
|
205
204
|
def make_key_data(xml, key)
|
206
205
|
xml.keyData do
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
206
|
+
xml.flags key[:flags]
|
207
|
+
xml.protocol key[:protocol]
|
208
|
+
xml.alg key[:alg]
|
209
|
+
xml.pubKey key[:pubKey]
|
211
210
|
end
|
212
211
|
end
|
212
|
+
|
213
213
|
def make_ds_data(xml, ds)
|
214
214
|
xml.dsData do
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
215
|
+
xml.keyTag ds[:keyTag]
|
216
|
+
xml.alg ds[:alg]
|
217
|
+
xml.digestType ds[:digestType]
|
218
|
+
xml.digest ds[:digest]
|
219
|
+
make_key_data(xml, ds[:keyData]) if ds.key?(:keyData)
|
220
220
|
end
|
221
221
|
end
|
222
|
+
|
222
223
|
def parse_key_data(xml)
|
223
224
|
{
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
225
|
+
:flags => xml.xpath('secDNS:flags', EPPClient::SCHEMAS_URL).text.to_i,
|
226
|
+
:protocol => xml.xpath('secDNS:protocol', EPPClient::SCHEMAS_URL).text.to_i,
|
227
|
+
:alg => xml.xpath('secDNS:alg', EPPClient::SCHEMAS_URL).text.to_i,
|
228
|
+
:pubKey => xml.xpath('secDNS:pubKey', EPPClient::SCHEMAS_URL).text,
|
228
229
|
}
|
229
230
|
end
|
231
|
+
|
230
232
|
def parse_ds_data(xml)
|
231
233
|
ret = {
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
234
|
+
:keyTag => xml.xpath('secDNS:keyTag', EPPClient::SCHEMAS_URL).text.to_i,
|
235
|
+
:alg => xml.xpath('secDNS:alg', EPPClient::SCHEMAS_URL).text.to_i,
|
236
|
+
:digestType => xml.xpath('secDNS:digestType', EPPClient::SCHEMAS_URL).text.to_i,
|
237
|
+
:digest => xml.xpath('secDNS:digest', EPPClient::SCHEMAS_URL).text,
|
236
238
|
}
|
237
239
|
if (keyData = xml.xpath('secDNS:keyData', EPPClient::SCHEMAS_URL)).size > 0
|
238
|
-
|
240
|
+
ret[:keyData] = parse_key_data(keyData)
|
239
241
|
end
|
240
242
|
ret
|
241
243
|
end
|
242
|
-
|
243
244
|
end
|
244
245
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: epp-client-secdns
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.15.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mathieu Arnold
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2016-02-
|
12
|
+
date: 2016-02-17 00:00:00 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|