made support test schema domain version 1.2

This commit is contained in:
Oleg Hasjanov 2021-06-28 12:47:24 +03:00
parent ae6bad3e73
commit 4c5e4d7898
41 changed files with 967 additions and 451 deletions

View file

@ -29,16 +29,34 @@ class Registrar
render plain: xml
end
protected
private
def prepare_payload(xml, cl_trid)
PREFS.map do |pref|
xml.gsub!('"' + pref.to_s + '"',
"\"#{Xsd::Schema.filename(for_prefix: pref.to_s)}\"")
xml = load_schema_by_prefix(pref, xml)
end
xml.gsub!('<clTRID>ABC-12345</clTRID>', "<clTRID>#{cl_trid}</clTRID>")
xml
end
def load_schema_by_prefix(pref, xml)
case pref
when 'epp-ee'
insert_prefix_and_version(xml, pref, '1.0')
when 'eis'
insert_prefix_and_version(xml, pref, '1.0')
when 'contact-ee'
insert_prefix_and_version(xml, pref, '1.1')
else
insert_prefix_and_version(xml, pref, '1.1')
end
end
def insert_prefix_and_version(xml, pref, version)
xml.gsub!('"' + pref.to_s + '"',
"\"#{Xsd::Schema.filename(for_prefix: pref.to_s, for_version: version)}\"")
xml
end
end
end

View file

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

View file

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

View file

@ -5,9 +5,10 @@ xml.epp_head do
end
xml.resData 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))
xml.tag!('contact:creData', 'xmlns:contact' =>
Xsd::Schema.filename(for_prefix: 'contact-ee', for_version: '1.1')) do
xml.tag!('contact:id', @contact.code)
xml.tag!('contact:crDate', @contact.created_at.try(:iso8601))
end
end

View file

@ -1,4 +1,5 @@
builder.tag!('domain:trnData', 'xmlns:domain' => Xsd::Schema.filename(for_prefix: 'domain-ee', for_version: @schema_version)) do
builder.tag!('domain:trnData', 'xmlns:domain' =>
Xsd::Schema.filename(for_prefix: 'domain-ee', for_version: @schema_version)) 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,12 +5,12 @@ xml.epp_head do
xml.svcMenu do
xml.version '1.0'
xml.lang 'en'
xml.objURI Xsd::Schema.filename(for_prefix: 'domain-ee')
xml.objURI Xsd::Schema.filename(for_prefix: 'contact-ee')
xml.objURI Xsd::Schema.filename(for_prefix: 'domain-ee', for_version: @schema_version)
xml.objURI Xsd::Schema.filename(for_prefix: 'contact-ee', for_version: @schema_version)
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 Xsd::Schema.filename(for_prefix: 'eis')
xml.extURI Xsd::Schema.filename(for_prefix: 'eis', for_version: @schema_version)
end
end