epp-client-smallregistry 0.14.0 → 0.15.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Rakefile +4 -5
- data/epp-client-smallregistry.gemspec +6 -6
- data/lib/epp-client/smallregistry.rb +57 -56
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
|
4
|
-
|
3
|
+
metadata.gz: 9ce55839344414492ea52c18a156de42b11aeb72
|
4
|
+
data.tar.gz: 17511216caf0433573bd3e6943b55c07c4975b64
|
5
5
|
SHA512:
|
6
|
-
|
7
|
-
|
6
|
+
metadata.gz: fdf3af5bd4ab31b42768b41099f0cff5537a94a44affda477d976527c6114f1dfbc91c17b560a11860c9aa6f04c73380523d4114abfa3ffbddf13e2941401ca7
|
7
|
+
data.tar.gz: 2fe2395652253fa87170e4ff2c00013758d3f0c4e6001ffc0087aa364d2adb6d8ea85a7a59b8e5fbbf718a7864dbd76ef89b8b4cbb563bf952dc0b06697f5c83
|
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
|
-
|
@@ -8,12 +8,12 @@ Gem::Specification.new do |gem|
|
|
8
8
|
gem.email = ['m@absolight.fr']
|
9
9
|
gem.description = 'Smallregistry EPP client library.'
|
10
10
|
gem.summary = 'Smallregistry 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
|
'EXAMPLE.SMALLREGISTRY',
|
19
19
|
'Gemfile',
|
@@ -28,9 +28,9 @@ Gem::Specification.new do |gem|
|
|
28
28
|
gem.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
29
29
|
gem.require_paths = ['lib']
|
30
30
|
|
31
|
-
gem.add_development_dependency
|
31
|
+
gem.add_development_dependency 'bundler', '>= 1.0.0'
|
32
32
|
gem.add_dependency('nokogiri', '~> 1.4')
|
33
33
|
gem.add_dependency('builder', '>= 2.1.2')
|
34
|
-
gem.add_dependency('epp-client-base',
|
35
|
-
gem.add_dependency('epp-client-secdns',
|
34
|
+
gem.add_dependency('epp-client-base', EPPClient::VERSION.to_s)
|
35
|
+
gem.add_dependency('epp-client-secdns', EPPClient::VERSION.to_s)
|
36
36
|
end
|
@@ -2,13 +2,16 @@ require 'epp-client/base'
|
|
2
2
|
require 'epp-client/secdns'
|
3
3
|
|
4
4
|
module EPPClient
|
5
|
+
# This handles the Smallregistry specificites.
|
6
|
+
#
|
7
|
+
# See
|
8
|
+
# https://www.smallregistry.net/faqs/quelles-sont-les-specificites-du-serveur-epp
|
5
9
|
class SmallRegistry < Base
|
6
|
-
|
7
|
-
SCHEMAS_SR = %w[
|
10
|
+
SCHEMAS_SR = %w(
|
8
11
|
sr-1.0
|
9
|
-
|
12
|
+
).freeze
|
10
13
|
|
11
|
-
EPPClient::SCHEMAS_URL.merge!(SCHEMAS_SR.inject({}) do |a,s|
|
14
|
+
EPPClient::SCHEMAS_URL.merge!(SCHEMAS_SR.inject({}) do |a, s|
|
12
15
|
a[s.sub(/-1\.0$/, '')] = "https://www.smallregistry.net/schemas/#{s}.xsd" if s =~ /-1\.0$/
|
13
16
|
a[s] = "https://www.smallregistry.net/schemas/#{s}.xsd"
|
14
17
|
a
|
@@ -32,14 +35,14 @@ module EPPClient
|
|
32
35
|
# See EPPClient for other attributes.
|
33
36
|
def initialize(attrs)
|
34
37
|
unless attrs.key?(:client_id) && attrs.key?(:password) && attrs.key?(:ssl_cert) && attrs.key?(:ssl_key)
|
35
|
-
|
38
|
+
fail ArgumentError, 'client_id, password, ssl_cert and ssl_key are required'
|
36
39
|
end
|
37
40
|
if attrs.delete(:test) == true
|
38
|
-
|
39
|
-
|
41
|
+
attrs[:server] ||= 'epp.test.smallregistry.net'
|
42
|
+
attrs[:port] ||= 2700
|
40
43
|
else
|
41
|
-
|
42
|
-
|
44
|
+
attrs[:server] ||= 'epp.smallregistry.net'
|
45
|
+
attrs[:port] ||= 700
|
43
46
|
end
|
44
47
|
@services = EPPClient::SCHEMAS_URL.values_at('domain', 'contact')
|
45
48
|
super(attrs)
|
@@ -68,15 +71,15 @@ module EPPClient
|
|
68
71
|
def contact_info_process(xml) #:nodoc:
|
69
72
|
ret = super
|
70
73
|
if (contact = xml.xpath('epp:extension/sr:ext/sr:infData/sr:contact', EPPClient::SCHEMAS_URL)).size > 0
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
74
|
+
if (person = contact.xpath('sr:person', EPPClient::SCHEMAS_URL)).size > 0
|
75
|
+
ret[:person] = {
|
76
|
+
:birthDate => Date.parse(person.xpath('sr:birthDate', EPPClient::SCHEMAS_URL).text),
|
77
|
+
:birthPlace => person.xpath('sr:birthPlace', EPPClient::SCHEMAS_URL).text,
|
78
|
+
}
|
79
|
+
end
|
80
|
+
if (org = contact.xpath('sr:org', EPPClient::SCHEMAS_URL)).size > 0
|
81
|
+
ret[:org] = { :companySerial => org.xpath('sr:companySerial', EPPClient::SCHEMAS_URL).text }
|
82
|
+
end
|
80
83
|
end
|
81
84
|
ret
|
82
85
|
end
|
@@ -103,22 +106,22 @@ module EPPClient
|
|
103
106
|
ret = super
|
104
107
|
|
105
108
|
ext = extension do |xml|
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
109
|
+
xml.ext(:xmlns => EPPClient::SCHEMAS_URL['sr']) do
|
110
|
+
xml.create do
|
111
|
+
xml.contact do
|
112
|
+
if contact.key?(:org)
|
113
|
+
xml.org do
|
114
|
+
xml.companySerial(contact[:org][:companySerial])
|
115
|
+
end
|
116
|
+
elsif contact.key?(:person)
|
117
|
+
xml.person do
|
118
|
+
xml.birthDate(contact[:person][:birthDate])
|
119
|
+
xml.birthPlace(contact[:person][:birthPlace])
|
120
|
+
end
|
121
|
+
end
|
122
|
+
end
|
123
|
+
end
|
124
|
+
end
|
122
125
|
end
|
123
126
|
|
124
127
|
insert_extension(ret, ext)
|
@@ -127,30 +130,28 @@ module EPPClient
|
|
127
130
|
def contact_update_xml(args) #:nodoc:
|
128
131
|
ret = super
|
129
132
|
|
130
|
-
|
131
|
-
ext = extension do |xml|
|
132
|
-
xml.ext( :xmlns => EPPClient::SCHEMAS_URL['sr']) do
|
133
|
-
xml.update do
|
134
|
-
xml.contact do
|
135
|
-
if args[:chg].key?(:org)
|
136
|
-
xml.org do
|
137
|
-
xml.companySerial(args[:chg][:org][:companySerial])
|
138
|
-
end
|
139
|
-
elsif args[:chg].key?(:person)
|
140
|
-
xml.person do
|
141
|
-
xml.birthDate(args[:chg][:person][:birthDate])
|
142
|
-
xml.birthPlace(args[:chg][:person][:birthPlace])
|
143
|
-
end
|
144
|
-
end
|
145
|
-
end
|
146
|
-
end
|
147
|
-
end
|
148
|
-
end
|
133
|
+
return ret unless args.key?(:chg) && (args[:chg].key?(:org) || args[:chg].key?(:person))
|
149
134
|
|
150
|
-
|
151
|
-
|
152
|
-
|
135
|
+
ext = extension do |xml|
|
136
|
+
xml.ext(:xmlns => EPPClient::SCHEMAS_URL['sr']) do
|
137
|
+
xml.update do
|
138
|
+
xml.contact do
|
139
|
+
if args[:chg].key?(:org)
|
140
|
+
xml.org do
|
141
|
+
xml.companySerial(args[:chg][:org][:companySerial])
|
142
|
+
end
|
143
|
+
elsif args[:chg].key?(:person)
|
144
|
+
xml.person do
|
145
|
+
xml.birthDate(args[:chg][:person][:birthDate])
|
146
|
+
xml.birthPlace(args[:chg][:person][:birthPlace])
|
147
|
+
end
|
148
|
+
end
|
149
|
+
end
|
150
|
+
end
|
151
|
+
end
|
153
152
|
end
|
153
|
+
|
154
|
+
insert_extension(ret, ext)
|
154
155
|
end
|
155
156
|
|
156
157
|
# Extends the EPPClient::Contact#contact_update so that the specific afnic
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: epp-client-smallregistry
|
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
|
@@ -48,7 +48,7 @@ dependencies:
|
|
48
48
|
requirements:
|
49
49
|
- - "="
|
50
50
|
- !ruby/object:Gem::Version
|
51
|
-
version: 0.
|
51
|
+
version: 0.15.0
|
52
52
|
type: :runtime
|
53
53
|
version_requirements: *id004
|
54
54
|
- !ruby/object:Gem::Dependency
|
@@ -58,7 +58,7 @@ dependencies:
|
|
58
58
|
requirements:
|
59
59
|
- - "="
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: 0.
|
61
|
+
version: 0.15.0
|
62
62
|
type: :runtime
|
63
63
|
version_requirements: *id005
|
64
64
|
description: Smallregistry EPP client library.
|