updated schemas

This commit is contained in:
Oleg Hasjanov 2021-06-04 15:54:30 +03:00
parent cd1f9c12c3
commit 177ddf0a72
5 changed files with 25 additions and 23 deletions

View file

@ -1,6 +1,6 @@
class EppConstraint class EppConstraint
OBJECT_TYPES = { OBJECT_TYPES = {
domain: { domain: Xsd::Schema.filename(for_prefix: 'domain-eis') }, domain: { domain: Xsd::Schema.filename(for_prefix: 'domain-ee') },
contact: { contact: Xsd::Schema.filename(for_prefix: 'contact-ee') }, contact: { contact: Xsd::Schema.filename(for_prefix: 'contact-ee') },
}.freeze }.freeze

View file

@ -4,8 +4,8 @@
This schema imports other schemas used for Estonian ccTLD This schema imports other schemas used for Estonian ccTLD
.ee EPP queries and responses. .ee EPP queries and responses.
--> -->
<schema targetNamespace="https://epp.tld.ee/schema/all-ee-1.0" <schema targetNamespace="https://epp.tld.ee/schema/all-ee-1.2"
xmlns:all="https://epp.tld.ee/schema/all-ee-1.0" xmlns:all="https://epp.tld.ee/schema/all-ee-1.2"
xmlns="http://www.w3.org/2001/XMLSchema" xmlns="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified"> elementFormDefault="qualified">
@ -30,8 +30,8 @@
schemaLocation="lib/schemas/eis-1.0.xsd"/> schemaLocation="lib/schemas/eis-1.0.xsd"/>
<import namespace="https://epp.tld.ee/schema/contact-ee-1.1" <import namespace="https://epp.tld.ee/schema/contact-ee-1.1"
schemaLocation="lib/schemas/contact-ee-1.1.xsd"/> schemaLocation="lib/schemas/contact-ee-1.1.xsd"/>
<import namespace="https://epp.tld.ee/schema/domain-eis-1.1" <import namespace="https://epp.tld.ee/schema/domain-ee-1.1"
schemaLocation="lib/schemas/domain-eis-1.1.xsd"/> schemaLocation="lib/schemas/domain-ee-1.1.xsd"/>
<annotation> <annotation>
<documentation> <documentation>

View file

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<schema targetNamespace="https://epp.tld.ee/schema/domain-eis-1.1.xsd" <schema targetNamespace="https://epp.tld.ee/schema/domain-ee-1.1.xsd"
xmlns:domain="https://epp.tld.ee/schema/domain-eis-1.1.xsd" xmlns:domain="https://epp.tld.ee/schema/domain-ee-1.1.xsd"
xmlns:host="urn:ietf:params:xml:ns:host-1.0" xmlns:host="urn:ietf:params:xml:ns:host-1.0"
xmlns:epp="https://epp.tld.ee/schema/epp-ee-1.0.xsd" xmlns:epp="https://epp.tld.ee/schema/epp-ee-1.0.xsd"
xmlns:eppcom="urn:ietf:params:xml:ns:eppcom-1.0" xmlns:eppcom="urn:ietf:params:xml:ns:eppcom-1.0"

View file

@ -4,6 +4,7 @@ module Xsd
BASE_URL = 'https://epp.tld.ee/schema/'.freeze BASE_URL = 'https://epp.tld.ee/schema/'.freeze
PREFIXES = %w[ PREFIXES = %w[
domain-ee
domain-eis domain-eis
all-ee all-ee
changePoll changePoll

View file

@ -13,7 +13,7 @@ class EppDomainInfoBaseTest < EppTestCase
<epp xmlns="#{Xsd::Schema.filename(for_prefix: 'epp-ee')}"> <epp xmlns="#{Xsd::Schema.filename(for_prefix: 'epp-ee')}">
<command> <command>
<info> <info>
<domain:info xmlns:domain="#{Xsd::Schema.filename(for_prefix: 'domain-eis')}"> <domain:info xmlns:domain="#{Xsd::Schema.filename(for_prefix: 'domain-ee')}">
<domain:name>shop.test</domain:name> <domain:name>shop.test</domain:name>
</domain:info> </domain:info>
</info> </info>
@ -27,13 +27,13 @@ class EppDomainInfoBaseTest < EppTestCase
response_xml = Nokogiri::XML(response.body) response_xml = Nokogiri::XML(response.body)
assert_epp_response :completed_successfully assert_epp_response :completed_successfully
assert assert_schema_is_bigger(response_xml, 'domain-eis', 1.1) assert assert_schema_is_bigger(response_xml, 'domain-ee', 1.1)
assert_equal 'shop.test', response_xml.at_xpath('//domain:name', 'domain' => "#{Xsd::Schema.filename(for_prefix: 'domain-eis')}").text assert_equal 'shop.test', response_xml.at_xpath('//domain:name', 'domain' => "#{Xsd::Schema.filename(for_prefix: 'domain-ee')}").text
assert_equal 'ok', response_xml.at_xpath('//domain:status', 'domain' => "#{Xsd::Schema.filename(for_prefix: 'domain-eis')}")['s'] assert_equal 'ok', response_xml.at_xpath('//domain:status', 'domain' => "#{Xsd::Schema.filename(for_prefix: 'domain-ee')}")['s']
assert_equal 'john-001', response_xml.at_xpath('//domain:registrant', 'domain' => "#{Xsd::Schema.filename(for_prefix: 'domain-eis')}").text assert_equal 'john-001', response_xml.at_xpath('//domain:registrant', 'domain' => "#{Xsd::Schema.filename(for_prefix: 'domain-ee')}").text
assert_equal '2010-07-05T00:00:00+03:00', response_xml.at_xpath('//domain:crDate', 'domain' => "#{Xsd::Schema.filename(for_prefix: 'domain-eis')}").text assert_equal '2010-07-05T00:00:00+03:00', response_xml.at_xpath('//domain:crDate', 'domain' => "#{Xsd::Schema.filename(for_prefix: 'domain-ee')}").text
assert_equal '2010-07-06T00:00:00+03:00', response_xml.at_xpath('//domain:upDate', 'domain' => "#{Xsd::Schema.filename(for_prefix: 'domain-eis')}").text assert_equal '2010-07-06T00:00:00+03:00', response_xml.at_xpath('//domain:upDate', 'domain' => "#{Xsd::Schema.filename(for_prefix: 'domain-ee')}").text
assert_equal '2010-07-07T00:00:00+03:00', response_xml.at_xpath('//domain:exDate', 'domain' => "#{Xsd::Schema.filename(for_prefix: 'domain-eis')}").text assert_equal '2010-07-07T00:00:00+03:00', response_xml.at_xpath('//domain:exDate', 'domain' => "#{Xsd::Schema.filename(for_prefix: 'domain-ee')}").text
end end
def test_returns_valid_response_if_disputed def test_returns_valid_response_if_disputed
@ -54,7 +54,7 @@ class EppDomainInfoBaseTest < EppTestCase
<epp xmlns="#{Xsd::Schema.filename(for_prefix: 'epp-ee')}"> <epp xmlns="#{Xsd::Schema.filename(for_prefix: 'epp-ee')}">
<command> <command>
<info> <info>
<domain:info xmlns:domain="#{Xsd::Schema.filename(for_prefix: 'domain-eis')}"> <domain:info xmlns:domain="#{Xsd::Schema.filename(for_prefix: 'domain-ee')}">
<domain:name>shop.test</domain:name> <domain:name>shop.test</domain:name>
</domain:info> </domain:info>
</info> </info>
@ -70,6 +70,7 @@ class EppDomainInfoBaseTest < EppTestCase
schema = EPP_ALL_SCHEMA schema = EPP_ALL_SCHEMA
schema_validation_errors = schema.validate(response_xml) schema_validation_errors = schema.validate(response_xml)
p schema_validation_errors
assert_equal 0, schema_validation_errors.size assert_equal 0, schema_validation_errors.size
end end
@ -85,7 +86,7 @@ class EppDomainInfoBaseTest < EppTestCase
<epp xmlns="#{Xsd::Schema.filename(for_prefix: 'epp-ee')}"> <epp xmlns="#{Xsd::Schema.filename(for_prefix: 'epp-ee')}">
<command> <command>
<info> <info>
<domain:info xmlns:domain="#{Xsd::Schema.filename(for_prefix: 'domain-eis')}"> <domain:info xmlns:domain="#{Xsd::Schema.filename(for_prefix: 'domain-ee')}">
<domain:name>shop.test</domain:name> <domain:name>shop.test</domain:name>
</domain:info> </domain:info>
</info> </info>
@ -112,7 +113,7 @@ class EppDomainInfoBaseTest < EppTestCase
<epp xmlns="#{Xsd::Schema.filename(for_prefix: 'epp-ee')}"> <epp xmlns="#{Xsd::Schema.filename(for_prefix: 'epp-ee')}">
<command> <command>
<info> <info>
<domain:info xmlns:domain="#{Xsd::Schema.filename(for_prefix: 'domain-eis')}"> <domain:info xmlns:domain="#{Xsd::Schema.filename(for_prefix: 'domain-ee')}">
<domain:name>shop.test</domain:name> <domain:name>shop.test</domain:name>
</domain:info> </domain:info>
</info> </info>
@ -124,7 +125,7 @@ class EppDomainInfoBaseTest < EppTestCase
headers: { 'HTTP_COOKIE' => 'session=api_bestnames' } headers: { 'HTTP_COOKIE' => 'session=api_bestnames' }
response_xml = Nokogiri::XML(response.body) response_xml = Nokogiri::XML(response.body)
assert_equal '65078d5', response_xml.at_xpath('//domain:authInfo/domain:pw', 'domain' => "#{Xsd::Schema.filename(for_prefix: 'domain-eis')}").text assert_equal '65078d5', response_xml.at_xpath('//domain:authInfo/domain:pw', 'domain' => "#{Xsd::Schema.filename(for_prefix: 'domain-ee')}").text
end end
# Transfer code is the only info we conceal from other registrars, hence a bit oddly-looking # Transfer code is the only info we conceal from other registrars, hence a bit oddly-looking
@ -137,7 +138,7 @@ class EppDomainInfoBaseTest < EppTestCase
<epp xmlns="#{Xsd::Schema.filename(for_prefix: 'epp-ee')}"> <epp xmlns="#{Xsd::Schema.filename(for_prefix: 'epp-ee')}">
<command> <command>
<info> <info>
<domain:info xmlns:domain="#{Xsd::Schema.filename(for_prefix: 'domain-eis')}"> <domain:info xmlns:domain="#{Xsd::Schema.filename(for_prefix: 'domain-ee')}">
<domain:name>shop.test</domain:name> <domain:name>shop.test</domain:name>
<domain:authInfo> <domain:authInfo>
<domain:pw>65078d5</domain:pw> <domain:pw>65078d5</domain:pw>
@ -152,7 +153,7 @@ class EppDomainInfoBaseTest < EppTestCase
headers: { 'HTTP_COOKIE' => 'session=api_goodnames' } headers: { 'HTTP_COOKIE' => 'session=api_goodnames' }
response_xml = Nokogiri::XML(response.body) response_xml = Nokogiri::XML(response.body)
assert_equal '65078d5', response_xml.at_xpath('//domain:authInfo/domain:pw', 'domain' => "#{Xsd::Schema.filename(for_prefix: 'domain-eis')}").text assert_equal '65078d5', response_xml.at_xpath('//domain:authInfo/domain:pw', 'domain' => "#{Xsd::Schema.filename(for_prefix: 'domain-ee')}").text
end end
def test_conceals_transfer_code_when_domain_is_not_owned_by_current_user def test_conceals_transfer_code_when_domain_is_not_owned_by_current_user
@ -161,7 +162,7 @@ class EppDomainInfoBaseTest < EppTestCase
<epp xmlns="#{Xsd::Schema.filename(for_prefix: 'epp-ee')}"> <epp xmlns="#{Xsd::Schema.filename(for_prefix: 'epp-ee')}">
<command> <command>
<info> <info>
<domain:info xmlns:domain="#{Xsd::Schema.filename(for_prefix: 'domain-eis')}"> <domain:info xmlns:domain="#{Xsd::Schema.filename(for_prefix: 'domain-ee')}">
<domain:name>shop.test</domain:name> <domain:name>shop.test</domain:name>
<domain:authInfo> <domain:authInfo>
<domain:pw></domain:pw> <domain:pw></domain:pw>
@ -177,6 +178,6 @@ class EppDomainInfoBaseTest < EppTestCase
response_xml = Nokogiri::XML(response.body) response_xml = Nokogiri::XML(response.body)
assert_nil response_xml.at_xpath('//domain:authInfo/domain:pw', assert_nil response_xml.at_xpath('//domain:authInfo/domain:pw',
'domain' => "#{Xsd::Schema.filename(for_prefix: 'domain-eis')}") 'domain' => "#{Xsd::Schema.filename(for_prefix: 'domain-ee')}")
end end
end end