mirror of
https://github.com/internetee/registry.git
synced 2025-07-22 02:35:57 +02:00
Refactor
This commit is contained in:
parent
c9a01f5d11
commit
2574bb9329
2 changed files with 0 additions and 229 deletions
|
@ -52,92 +52,6 @@ module Epp
|
|||
|
||||
### REQUEST TEMPLATES ###
|
||||
|
||||
def login_xml(xml_params = {})
|
||||
defaults = {
|
||||
clID: { value: 'gitlab' },
|
||||
pw: { value: 'ghyt9e4fu' },
|
||||
options: {
|
||||
version: { value: '1.0' },
|
||||
lang: { value: 'en' }
|
||||
},
|
||||
svcs: {
|
||||
_objURIs: [
|
||||
objURI: { value: 'urn:ietf:params:xml:ns:contact-1.0' }
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
xml_params = defaults.deep_merge(xml_params)
|
||||
|
||||
xml = Builder::XmlMarkup.new
|
||||
|
||||
xml.instruct!(:xml, standalone: 'no')
|
||||
xml.epp(
|
||||
'xmlns' => 'urn:ietf:params:xml:ns:epp-1.0',
|
||||
'xmlns:xsi' => 'http://www.w3.org/2001/XMLSchema-instance',
|
||||
'xsi:schemaLocation' => 'urn:ietf:params:xml:ns:epp-1.0 epp-1.0.xsd'
|
||||
) do
|
||||
xml.command do
|
||||
xml.login do
|
||||
generate_xml_from_hash(xml_params, xml)
|
||||
end
|
||||
xml.clTRID 'ABC-12345'
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def domain_create_xml(xml_params = {}, dnssec_params = {})
|
||||
|
||||
defaults = {
|
||||
name: { value: 'example.ee' },
|
||||
period: { value: '1', attrs: { unit: 'y' } },
|
||||
ns: [
|
||||
{ hostObj: { value: 'ns1.example.net' } },
|
||||
{ hostObj: { value: 'ns2.example.net' } }
|
||||
],
|
||||
registrant: { value: 'jd1234' },
|
||||
_other: [
|
||||
{ contact: { value: 'sh8013', attrs: { type: 'admin' } } },
|
||||
{ contact: { value: 'sh8013', attrs: { type: 'tech' } } },
|
||||
{ contact: { value: 'sh801333', attrs: { type: 'tech' } } }
|
||||
]
|
||||
}
|
||||
|
||||
xml_params = defaults.deep_merge(xml_params)
|
||||
|
||||
dsnsec_defaults = {
|
||||
_other: [
|
||||
{ keyData: {
|
||||
flags: { value: '257' },
|
||||
protocol: { value: '3' },
|
||||
alg: { value: '5' },
|
||||
pubKey: { value: 'AwEAAddt2AkLfYGKgiEZB5SmIF8EvrjxNMH6HtxWEA4RJ9Ao6LCWheg8' }
|
||||
}
|
||||
}]
|
||||
}
|
||||
|
||||
dnssec_params = dsnsec_defaults.deep_merge(dnssec_params) if dnssec_params != false
|
||||
|
||||
xml = Builder::XmlMarkup.new
|
||||
|
||||
xml.instruct!(:xml, standalone: 'no')
|
||||
xml.epp('xmlns' => 'urn:ietf:params:xml:ns:epp-1.0') do
|
||||
xml.command do
|
||||
xml.create do
|
||||
xml.tag!('domain:create', 'xmlns:domain' => 'urn:ietf:params:xml:ns:domain-1.0') do
|
||||
generate_xml_from_hash(xml_params, xml, 'domain:')
|
||||
end
|
||||
end
|
||||
xml.extension do
|
||||
xml.tag!('secDNS:create', 'xmlns:secDNS' => 'urn:ietf:params:xml:ns:secDNS-1.1') do
|
||||
generate_xml_from_hash(dnssec_params, xml, 'secDNS:')
|
||||
end
|
||||
end if dnssec_params != false
|
||||
xml.clTRID 'ABC-12345'
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def domain_renew_xml(xml_params = {})
|
||||
xml = Builder::XmlMarkup.new
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue