Replace some hardcoded schema paths for method calls

This commit is contained in:
Alex Sherman 2021-05-21 15:14:31 +05:00
parent a0d0ce3e00
commit 00a0be2341
59 changed files with 481 additions and 480 deletions

View file

@ -5,7 +5,7 @@ xml.epp_head do
end
xml.resData do
xml.tag!('contact:chkData', 'xmlns:contact' => 'https://epp.tld.ee/schema/contact-ee-1.1.xsd') do
xml.tag!('contact:chkData', 'xmlns:contact' => Xsd::Schema.filename(for_prefix: 'contact-ee')) do
@results.each do |result|
xml.tag!('contact:cd') do
xml.tag! "contact:id", result[:code], avail: result[:avail]

View file

@ -5,7 +5,7 @@ xml.epp_head do
end
xml.resData do
xml.tag!('contact:infData', 'xmlns:contact' => 'https://epp.tld.ee/schema/contact-ee-1.1.xsd') do
xml.tag!('contact:infData', 'xmlns:contact' => Xsd::Schema.filename(for_prefix: 'contact-ee')) do
xml.tag!('contact:id', @contact.code)
xml.tag!('contact:roid', @contact.roid)
@ -78,7 +78,7 @@ xml.epp_head do
end
if can? :view_full_info, @contact, @password
xml.tag!('extension') do
xml.tag!('eis:extdata', 'xmlns:eis' => 'https://epp.tld.ee/schema/eis-1.0.xsd') do
xml.tag!('eis:extdata', 'xmlns:eis' => Xsd::Schema.filename(for_prefix: 'eis')) do
xml.tag!('eis:ident', @contact.ident,
type: @contact.ident_type, cc: @contact.ident_country_code)
end

View file

@ -5,7 +5,7 @@ xml.epp_head do
end
xml.resData do
xml.tag!('contact:creData', 'xmlns:contact' => 'https://epp.tld.ee/schema/contact-ee-1.1.xsd') do
xml.tag!('contact:creData', 'xmlns:contact' => Xsd::Schema.filename(for_prefix: 'contact-ee')) do
xml.tag!('contact:id', @contact.code)
xml.tag!('contact:crDate', @contact.created_at.try(:iso8601))
end

View file

@ -5,7 +5,7 @@ xml.epp_head do
end
xml.resData do
xml.tag!('domain:chkData', 'xmlns:domain' => 'https://epp.tld.ee/schema/domain-eis-1.0.xsd') do
xml.tag!('domain:chkData', 'xmlns:domain' => Xsd::Schema.filename(for_prefix: 'domain-eis')) do
@domains.each do |x|
xml.tag!('domain:cd') do
xml.tag!('domain:name', x[:name], 'avail' => x[:avail])

View file

@ -5,7 +5,7 @@ xml.epp_head do
end
xml.resData do
xml.tag!('domain:creData', 'xmlns:domain' => 'https://epp.tld.ee/schema/domain-eis-1.0.xsd') do
xml.tag!('domain:creData', 'xmlns:domain' => Xsd::Schema.filename(for_prefix: 'domain-eis')) do
xml.tag!('domain:name', @domain.name)
xml.tag!('domain:crDate', @domain.created_at.try(:iso8601))
xml.tag!('domain:exDate', @domain.valid_to.iso8601)

View file

@ -5,7 +5,7 @@ xml.epp_head do
end
xml.resData do
xml.tag! 'domain:infData', 'xmlns:domain' => 'https://epp.tld.ee/schema/domain-eis-1.0.xsd' do
xml.tag! 'domain:infData', 'xmlns:domain' => Xsd::Schema.filename(for_prefix: 'domain-eis') do
xml.tag!('domain:name', @domain.name)
xml.tag!('domain:roid', @domain.roid)
@domain.statuses.each do |s|

View file

@ -1,4 +1,4 @@
builder.tag!('domain:trnData', 'xmlns:domain' => 'https://epp.tld.ee/schema/domain-eis-1.0.xsd') do
builder.tag!('domain:trnData', 'xmlns:domain' => Xsd::Schema.filename(for_prefix: 'domain-eis')) do
builder.tag!('domain:name', dt.domain_name)
builder.tag!('domain:trStatus', dt.status)
builder.tag!('domain:reID', dt.new_registrar.code)

View file

@ -5,7 +5,7 @@ xml.epp_head do
end
xml.resData do
xml.tag!('domain:renData', 'xmlns:domain' => 'https://epp.tld.ee/schema/domain-eis-1.0.xsd') do
xml.tag!('domain:renData', 'xmlns:domain' => Xsd::Schema.filename(for_prefix: 'domain-eis')) do
xml.tag!('domain:name', @domain[:name])
xml.tag!('domain:exDate', @domain.valid_to.iso8601)
end

View file

@ -7,8 +7,9 @@ xml.epp_head do
xml.result('code' => x[:code]) do
xml.msg(x[:msg], 'lang' => 'en')
model_name = resource ? resource.model_name.singular.sub('epp_','') : controller.controller_name.singularize
prefix = model_name == 'poll' ? 'changePoll' : model_name + '-eis'
xml.value("xmlns:#{model_name}" => "https://epp.tld.ee/schema/#{model_name}-eis-1.0.xsd") do
xml.value("xmlns:#{model_name}" => Xsd::Schema.filename(for_prefix: prefix)) do
value = x[:value][:val]
attrs = {}
attrs["s"] = value if x[:value][:obj] == "status"

View file

@ -1,9 +1,9 @@
builder.extension do
builder.tag!('changePoll:changeData',
'xmlns:changePoll' => 'https://epp.tld.ee/schema/changePoll-1.0.xsd') do
'xmlns:changePoll' => Xsd::Schema.filename(for_prefix: 'changePoll')) do
builder.tag!('changePoll:operation', action.operation)
builder.tag!('changePoll:date', action.created_at.utc.xmlschema)
builder.tag!('changePoll:svTRID', action.id)
builder.tag!('changePoll:who', action.user)
end
end
end

View file

@ -20,7 +20,7 @@ xml.epp_head do
state = @notification.text.include?('unlocked') ? 'unlock' : 'lock'
xml.extension do
xml.tag!('changePoll:changeData',
'xmlns:changePoll': 'https://epp.tld.ee/schema/changePoll-1.0.xsd') do
'xmlns:changePoll': Xsd::Schema.filename(for_prefix: 'changePoll')) do
xml.tag!('changePoll:operation', state)
end
end

View file

@ -5,12 +5,12 @@ xml.epp_head do
xml.svcMenu do
xml.version '1.0'
xml.lang 'en'
xml.objURI 'https://epp.tld.ee/schema/domain-eis-1.0.xsd'
xml.objURI 'https://epp.tld.ee/schema/contact-ee-1.1.xsd'
xml.objURI Xsd::Schema.filename(for_prefix: 'domain-eis')
xml.objURI Xsd::Schema.filename(for_prefix: 'contact-ee')
xml.objURI 'urn:ietf:params:xml:ns:host-1.0'
xml.svcExtension do
xml.extURI 'urn:ietf:params:xml:ns:secDNS-1.1'
xml.extURI 'https://epp.tld.ee/schema/eis-1.0.xsd'
xml.extURI Xsd::Schema.filename(for_prefix: 'eis')
end
end

View file

@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<epp xmlns="https://epp.tld.ee/schema/epp-ee-1.0.xsd">
<epp xmlns="#{Xsd::Schema.filename(for_prefix: 'epp-ee')}">
<command>
<check>
<contact:check
xmlns:contact="https://epp.tld.ee/schema/contact-ee-1.1.xsd">
xmlns:contact="#{Xsd::Schema.filename(for_prefix: 'contact-ee')}">
<contact:id>sh8013</contact:id>
</contact:check>
</check>

View file

@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<epp xmlns="https://epp.tld.ee/schema/epp-ee-1.0.xsd">
<epp xmlns="#{Xsd::Schema.filename(for_prefix: 'epp-ee')}">
<command>
<check>
<contact:check
xmlns:contact="https://epp.tld.ee/schema/contact-ee-1.1.xsd">
xmlns:contact="#{Xsd::Schema.filename(for_prefix: 'contact-ee')}">
<contact:id>sh8013</contact:id>
<contact:id>sh13</contact:id>
<contact:id>vsdfvq</contact:id>

View file

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<epp xmlns="https://epp.tld.ee/schema/epp-ee-1.0.xsd">
<epp xmlns="#{Xsd::Schema.filename(for_prefix: 'epp-ee')}">
<command>
<create>
<contact:create xmlns:contact="https://epp.tld.ee/schema/contact-ee-1.1.xsd">
<contact:create xmlns:contact="#{Xsd::Schema.filename(for_prefix: 'contact-ee')}">
<contact:postalInfo>
<contact:name>Sillius Soddus</contact:name>
<contact:addr>
@ -20,7 +20,7 @@
</contact:create>
</create>
<extension>
<eis:extdata xmlns:eis="https://epp.tld.ee/schema/eis-1.0.xsd">
<eis:extdata xmlns:eis="#{Xsd::Schema.filename(for_prefix: 'eis')}">
<eis:ident type="org" cc="EE">123</eis:ident>
<eis:legalDocument type="pdf">
dGVzdCBmYWlsCg==

View file

@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<epp xmlns="https://epp.tld.ee/schema/epp-ee-1.0.xsd">
<epp xmlns="#{Xsd::Schema.filename(for_prefix: 'epp-ee')}">
<command>
<delete>
<contact:delete
xmlns:contact="https://epp.tld.ee/schema/contact-ee-1.1.xsd">
xmlns:contact="#{Xsd::Schema.filename(for_prefix: 'contact-ee')}">
<contact:id>sh8013</contact:id>
<contact:authInfo>
<contact:pw>wrong-one</contact:pw>
@ -11,7 +11,7 @@
</contact:delete>
</delete>
<extension>
<eis:extdata xmlns:eis="https://epp.tld.ee/schema/eis-1.0.xsd">
<eis:extdata xmlns:eis="#{Xsd::Schema.filename(for_prefix: 'eis')}">
<eis:legalDocument type="pdf">
dGVzdCBmYWlsCg==
</eis:legalDocument>

View file

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<epp xmlns="https://epp.tld.ee/schema/epp-ee-1.0.xsd">
<epp xmlns="#{Xsd::Schema.filename(for_prefix: 'epp-ee')}">
<command>
<info>
<contact:info xmlns:contact="https://epp.tld.ee/schema/contact-ee-1.1.xsd">
<contact:info xmlns:contact="#{Xsd::Schema.filename(for_prefix: 'contact-ee')}">
<contact:id>sh8013</contact:id>
<contact:authInfo>
<contact:pw>Aas34fq</contact:pw>

View file

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<epp xmlns="https://epp.tld.ee/schema/epp-ee-1.0.xsd">
<epp xmlns="#{Xsd::Schema.filename(for_prefix: 'epp-ee')}">
<command>
<update>
<contact:update xmlns:contact="https://epp.tld.ee/schema/contact-ee-1.1.xsd">
<contact:update xmlns:contact="#{Xsd::Schema.filename(for_prefix: 'contact-ee')}">
<contact:id>sh8013</contact:id>
<contact:chg>
<contact:postalInfo>
@ -25,7 +25,7 @@
</contact:update>
</update>
<extension>
<eis:extdata xmlns:eis="https://epp.tld.ee/schema/eis-1.0.xsd">
<eis:extdata xmlns:eis="#{Xsd::Schema.filename(for_prefix: 'eis')}">
<eis:legalDocument type="pdf">
dGVzdCBmYWlsCg==
</eis:legalDocument>

View file

@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<epp xmlns="https://epp.tld.ee/schema/epp-ee-1.0.xsd">
<epp xmlns="#{Xsd::Schema.filename(for_prefix: 'epp-ee')}">
<command>
<check>
<domain:check
xmlns:domain="https://epp.tld.ee/schema/domain-eis-1.0.xsd">
xmlns:domain="#{Xsd::Schema.filename(for_prefix: 'domain-eis')}">
<domain:name>example.ee</domain:name>
</domain:check>
</check>

View file

@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<epp xmlns="https://epp.tld.ee/schema/epp-ee-1.0.xsd">
<epp xmlns="#{Xsd::Schema.filename(for_prefix: 'epp-ee')}">
<command>
<update>
<domain:update
xmlns:domain="https://epp.tld.ee/schema/domain-eis-1.0.xsd">
xmlns:domain="#{Xsd::Schema.filename(for_prefix: 'domain-eis')}">
<domain:name>example.ee</domain:name>
<domain:rem>
<domain:status s="clientHold"/>

View file

@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<epp xmlns="https://epp.tld.ee/schema/epp-ee-1.0.xsd">
<epp xmlns="#{Xsd::Schema.filename(for_prefix: 'epp-ee')}">
<command>
<create>
<domain:create
xmlns:domain="https://epp.tld.ee/schema/domain-eis-1.0.xsd">
xmlns:domain="#{Xsd::Schema.filename(for_prefix: 'domain-eis')}">
<domain:name>example.ee</domain:name>
<domain:period unit="y">1</domain:period>
<domain:ns>
@ -31,7 +31,7 @@
<secDNS:pubKey>AwEAAddt2AkLfYGKgiEZB5SmIF8EvrjxNMH6HtxWEA4RJ9Ao6LCWheg8</secDNS:pubKey>
</secDNS:keyData>
</secDNS:create>
<eis:extdata xmlns:eis="https://epp.tld.ee/schema/eis-1.0.xsd">
<eis:extdata xmlns:eis="#{Xsd::Schema.filename(for_prefix: 'eis')}">
<eis:legalDocument type="pdf">
dGVzdCBmYWlsCg==
</eis:legalDocument>

View file

@ -1,14 +1,14 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<epp xmlns="https://epp.tld.ee/schema/epp-ee-1.0.xsd">
<epp xmlns="#{Xsd::Schema.filename(for_prefix: 'epp-ee')}">
<command>
<delete>
<domain:delete
xmlns:domain="https://epp.tld.ee/schema/domain-eis-1.0.xsd">
xmlns:domain="#{Xsd::Schema.filename(for_prefix: 'domain-eis')}">
<domain:name>example.ee</domain:name>
</domain:delete>
</delete>
<extension>
<eis:extdata xmlns:eis="https://epp.tld.ee/schema/eis-1.0.xsd">
<eis:extdata xmlns:eis="#{Xsd::Schema.filename(for_prefix: 'eis')}">
<eis:legalDocument type="pdf">
dGVzdCBmYWlsCg==
</eis:legalDocument>

View file

@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<epp xmlns="https://epp.tld.ee/schema/epp-ee-1.0.xsd">
<epp xmlns="#{Xsd::Schema.filename(for_prefix: 'epp-ee')}">
<command>
<info>
<domain:info
xmlns:domain="https://epp.tld.ee/schema/domain-eis-1.0.xsd">
xmlns:domain="#{Xsd::Schema.filename(for_prefix: 'domain-eis')}">
<domain:name hosts="all">example.ee</domain:name>
<domain:authInfo>
<domain:pw>2fooBAR</domain:pw>

View file

@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<epp xmlns="https://epp.tld.ee/schema/epp-ee-1.0.xsd">
<epp xmlns="#{Xsd::Schema.filename(for_prefix: 'epp-ee')}">
<command>
<renew>
<domain:renew
xmlns:domain="https://epp.tld.ee/schema/domain-eis-1.0.xsd">
xmlns:domain="#{Xsd::Schema.filename(for_prefix: 'domain-eis')}">
<domain:name>example.ee</domain:name>
<domain:curExpDate>2014-08-07</domain:curExpDate>
<domain:period unit="y">1</domain:period>

View file

@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<epp xmlns="https://epp.tld.ee/schema/epp-ee-1.0.xsd">
<epp xmlns="#{Xsd::Schema.filename(for_prefix: 'epp-ee')}">
<command>
<transfer op="request">
<domain:transfer
xmlns:domain="https://epp.tld.ee/schema/domain-eis-1.0.xsd">
xmlns:domain="#{Xsd::Schema.filename(for_prefix: 'domain-eis')}">
<domain:name>example.ee</domain:name>
<domain:authInfo>
<domain:pw roid="JD1234-REP">2BARfoo</domain:pw>
@ -11,7 +11,7 @@
</domain:transfer>
</transfer>
<extension>
<eis:extdata xmlns:eis="https://epp.tld.ee/schema/eis-1.0.xsd">
<eis:extdata xmlns:eis="#{Xsd::Schema.filename(for_prefix: 'eis')}">
<eis:legalDocument type="pdf">
dGVzdCBmYWlsCg==
</eis:legalDocument>

View file

@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<epp xmlns="https://epp.tld.ee/schema/epp-ee-1.0.xsd">
<epp xmlns="#{Xsd::Schema.filename(for_prefix: 'epp-ee')}">
<command>
<update>
<domain:update
xmlns:domain="https://epp.tld.ee/schema/domain-eis-1.0.xsd">
xmlns:domain="#{Xsd::Schema.filename(for_prefix: 'domain-eis')}">
<domain:name>example.ee</domain:name>
<domain:add>
<domain:ns>
@ -43,7 +43,7 @@
</secDNS:keyData>
</secDNS:rem>
</secDNS:update>
<eis:extdata xmlns:eis="https://epp.tld.ee/schema/eis-1.0.xsd">
<eis:extdata xmlns:eis="#{Xsd::Schema.filename(for_prefix: 'eis')}">
<eis:legalDocument type="pdf">
dGVzdCBmYWlsCg==
</eis:legalDocument>

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<epp xmlns="https://epp.tld.ee/schema/epp-ee-1.0.xsd">
<epp xmlns="#{Xsd::Schema.filename(for_prefix: 'epp-ee')}">
<command>
<poll op="req"/>
<clTRID>ABC-12345</clTRID>