epp-xml 0.9.0 → 0.10.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/lib/epp-xml/contact.rb +6 -4
- data/lib/epp-xml/domain.rb +8 -6
- data/lib/epp-xml/keyrelay.rb +5 -3
- data/lib/epp-xml/session.rb +6 -4
- data/lib/epp-xml.rb +8 -17
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e8ecdf055fc60d2165333b26890a4468e2cca8eb
|
4
|
+
data.tar.gz: c3cedc145e9b3cc61eb0ee54594baf0d826ffeb8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f001b44e7ab189e32449e9bdf3026e047a40fea22cdfccf3c242730917b842d27b62f50fb2cc7e0df011e94147a16068017334470f457f3916d996eed00af942
|
7
|
+
data.tar.gz: cf25c49ae2c099f185dec83f03da77510d8009f9a37e9278185398cd780ba2ae127044c87bde4abd9b073537c5ce485a14d8f8cc9793647d937571a82a85588f
|
data/lib/epp-xml/contact.rb
CHANGED
@@ -1,5 +1,7 @@
|
|
1
|
-
module
|
2
|
-
|
1
|
+
module EppXml
|
2
|
+
class Contact
|
3
|
+
include EppXml
|
4
|
+
|
3
5
|
def create(xml_params = {})
|
4
6
|
build('create', xml_params)
|
5
7
|
end
|
@@ -31,7 +33,7 @@ module EppXmlCore
|
|
31
33
|
EppXml.generate_xml_from_hash(xml_params, xml, 'contact:')
|
32
34
|
end
|
33
35
|
end
|
34
|
-
xml.clTRID(
|
36
|
+
xml.clTRID(clTRID)
|
35
37
|
end
|
36
38
|
end
|
37
39
|
end
|
@@ -49,7 +51,7 @@ module EppXmlCore
|
|
49
51
|
EppXml.generate_xml_from_hash(xml_params, xml, 'contact:')
|
50
52
|
end
|
51
53
|
end
|
52
|
-
xml.clTRID(
|
54
|
+
xml.clTRID(clTRID)
|
53
55
|
end
|
54
56
|
end
|
55
57
|
end
|
data/lib/epp-xml/domain.rb
CHANGED
@@ -1,5 +1,7 @@
|
|
1
|
-
module
|
2
|
-
|
1
|
+
module EppXml
|
2
|
+
class Domain
|
3
|
+
include EppXml
|
4
|
+
|
3
5
|
def info(xml_params = {})
|
4
6
|
build('info', xml_params)
|
5
7
|
end
|
@@ -32,7 +34,7 @@ module EppXmlCore
|
|
32
34
|
EppXml.generate_xml_from_hash(dnssec_params, xml, 'secDNS:')
|
33
35
|
end
|
34
36
|
end if dnssec_params != false
|
35
|
-
xml.clTRID(
|
37
|
+
xml.clTRID(clTRID)
|
36
38
|
end
|
37
39
|
end
|
38
40
|
end
|
@@ -54,7 +56,7 @@ module EppXmlCore
|
|
54
56
|
EppXml.generate_xml_from_hash(dnssec_params, xml, 'secDNS:')
|
55
57
|
end
|
56
58
|
end if dnssec_params != false
|
57
|
-
xml.clTRID(
|
59
|
+
xml.clTRID(clTRID)
|
58
60
|
end
|
59
61
|
end
|
60
62
|
end
|
@@ -70,7 +72,7 @@ module EppXmlCore
|
|
70
72
|
EppXml.generate_xml_from_hash(xml_params, xml, 'domain:')
|
71
73
|
end
|
72
74
|
end
|
73
|
-
xml.clTRID(
|
75
|
+
xml.clTRID(clTRID)
|
74
76
|
end
|
75
77
|
end
|
76
78
|
end
|
@@ -88,7 +90,7 @@ module EppXmlCore
|
|
88
90
|
EppXml.generate_xml_from_hash(xml_params, xml, 'domain:')
|
89
91
|
end
|
90
92
|
end
|
91
|
-
xml.clTRID(
|
93
|
+
xml.clTRID(clTRID)
|
92
94
|
end
|
93
95
|
end
|
94
96
|
end
|
data/lib/epp-xml/keyrelay.rb
CHANGED
@@ -1,5 +1,7 @@
|
|
1
|
-
module
|
2
|
-
|
1
|
+
module EppXml
|
2
|
+
class Keyrelay
|
3
|
+
include EppXml
|
4
|
+
|
3
5
|
def keyrelay(xml_params = {})
|
4
6
|
xml = Builder::XmlMarkup.new
|
5
7
|
|
@@ -28,7 +30,7 @@ module EppXmlCore
|
|
28
30
|
end if xml_params[:expiry]
|
29
31
|
|
30
32
|
end
|
31
|
-
xml.tag!('ext:clTRID',
|
33
|
+
xml.tag!('ext:clTRID', clTRID)
|
32
34
|
end
|
33
35
|
end
|
34
36
|
end
|
data/lib/epp-xml/session.rb
CHANGED
@@ -1,5 +1,7 @@
|
|
1
|
-
module
|
2
|
-
|
1
|
+
module EppXml
|
2
|
+
class Session
|
3
|
+
include EppXml
|
4
|
+
|
3
5
|
def login(xml_params = {})
|
4
6
|
defaults = {
|
5
7
|
clID: { value: 'user' },
|
@@ -29,7 +31,7 @@ module EppXmlCore
|
|
29
31
|
xml.login do
|
30
32
|
EppXml.generate_xml_from_hash(xml_params, xml)
|
31
33
|
end
|
32
|
-
xml.clTRID(
|
34
|
+
xml.clTRID(clTRID)
|
33
35
|
end
|
34
36
|
end
|
35
37
|
end
|
@@ -47,7 +49,7 @@ module EppXmlCore
|
|
47
49
|
xml.epp('xmlns' => 'urn:ietf:params:xml:ns:epp-1.0') do
|
48
50
|
xml.command do
|
49
51
|
EppXml.generate_xml_from_hash(xml_params, xml)
|
50
|
-
xml.clTRID(
|
52
|
+
xml.clTRID(clTRID)
|
51
53
|
end
|
52
54
|
end
|
53
55
|
|
data/lib/epp-xml.rb
CHANGED
@@ -6,29 +6,20 @@ require 'epp-xml/contact'
|
|
6
6
|
require 'epp-xml/keyrelay'
|
7
7
|
|
8
8
|
module EppXml
|
9
|
-
|
10
|
-
extend ::EppXmlCore::Session
|
11
|
-
end
|
12
|
-
|
13
|
-
class Domain
|
14
|
-
extend ::EppXmlCore::Domain
|
15
|
-
end
|
9
|
+
attr_accessor :cl_trid_prefix, :cl_trid
|
16
10
|
|
17
|
-
|
18
|
-
|
11
|
+
def initialize(args = {})
|
12
|
+
self.cl_trid = args[:cl_trid]
|
13
|
+
self.cl_trid_prefix = args[:cl_trid_prefix]
|
19
14
|
end
|
20
15
|
|
21
|
-
|
22
|
-
|
16
|
+
def clTRID
|
17
|
+
return cl_trid if cl_trid
|
18
|
+
return "#{cl_trid_prefix}-#{Time.now.to_i}" if cl_trid_prefix
|
19
|
+
Time.now.to_i
|
23
20
|
end
|
24
21
|
|
25
22
|
class << self
|
26
|
-
attr_accessor :cl_trid_prefix, :cl_trid
|
27
|
-
|
28
|
-
def clTRID
|
29
|
-
cl_trid || "#{cl_trid_prefix}-#{Time.now.to_i}"
|
30
|
-
end
|
31
|
-
|
32
23
|
def generate_xml_from_hash(xml_params, xml, ns = '')
|
33
24
|
xml_params.each do |k, v|
|
34
25
|
# Value is a hash which has string type value
|