diff --git a/Gemfile b/Gemfile
index 5bcbd2bec..bd4bef176 100644
--- a/Gemfile
+++ b/Gemfile
@@ -62,7 +62,7 @@ gem 'omniauth-tara', github: 'internetee/omniauth-tara'
gem 'epp', github: 'internetee/epp', branch: :master
-gem 'epp-xml', '1.1.0', github: 'internetee/epp-xml'
+gem 'epp-xml', '1.2.0', github: 'internetee/epp-xml', branch: :master
gem 'que'
gem 'daemons-rails', '1.2.1'
gem 'que-web'
diff --git a/Gemfile.lock b/Gemfile.lock
index ecdb4605e..e24bae2f2 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -28,9 +28,10 @@ GIT
GIT
remote: https://github.com/internetee/epp-xml.git
- revision: 27959f8cb244ea5eabaeeee747984988b454e840
+ revision: cab8ba4d07b16e664b8ae6d3c6a6821e89a48b78
+ branch: master
specs:
- epp-xml (1.1.0)
+ epp-xml (1.2.0)
activesupport (>= 4.1)
builder (~> 3.2)
@@ -532,7 +533,7 @@ DEPENDENCIES
domain_name
e_invoice!
epp!
- epp-xml (= 1.1.0)!
+ epp-xml (= 1.2.0)!
figaro (~> 1.2)
haml (~> 5.0)
isikukood
@@ -575,4 +576,4 @@ DEPENDENCIES
wkhtmltopdf-binary (~> 0.12.5.1)
BUNDLED WITH
- 2.2.17
+ 2.2.20
diff --git a/app/controllers/epp/base_controller.rb b/app/controllers/epp/base_controller.rb
index 3230d3e70..4e9c7e9cf 100644
--- a/app/controllers/epp/base_controller.rb
+++ b/app/controllers/epp/base_controller.rb
@@ -127,6 +127,7 @@ module Epp
# VALIDATION
def validate_request
validation_method = "validate_#{params[:action]}"
+
return unless respond_to?(validation_method, true)
send(validation_method)
diff --git a/app/controllers/epp/errors_controller.rb b/app/controllers/epp/errors_controller.rb
index ab2e00b75..da1e27a9e 100644
--- a/app/controllers/epp/errors_controller.rb
+++ b/app/controllers/epp/errors_controller.rb
@@ -11,5 +11,10 @@ module Epp
epp_errors.add(:epp_errors, code: '2000', msg: 'Unknown command')
render_epp_response '/epp/error'
end
+
+ def wrong_schema
+ epp_errors.add(:epp_errors, code: '2100', msg: 'Wrong path')
+ render_epp_response '/epp/error'
+ end
end
end
diff --git a/app/controllers/registrar/xml_consoles_controller.rb b/app/controllers/registrar/xml_consoles_controller.rb
index b07b9cbee..fef6b33ad 100644
--- a/app/controllers/registrar/xml_consoles_controller.rb
+++ b/app/controllers/registrar/xml_consoles_controller.rb
@@ -1,14 +1,20 @@
class Registrar
class XmlConsolesController < DeppController
+ PREFS = %w[
+ domain-ee
+ contact-ee
+ eis
+ epp-ee
+ ].freeze
+
authorize_resource class: false
- def show
- end
+ def show; end
def create
begin
@result = depp_current_user.server.request(params[:payload])
- rescue
+ rescue StandardError
@result = 'CONNECTION ERROR - Is the EPP server running?'
end
render :show
@@ -18,8 +24,21 @@ class Registrar
cl_trid = "#{depp_current_user.tag}-#{Time.zone.now.to_i}"
xml_dir_path = Rails.root + 'app/views/registrar/xml_consoles/epp_requests'
xml = File.read("#{xml_dir_path}/#{params[:obj]}/#{params[:epp_action]}.xml")
- xml.gsub!('ABC-12345', "#{cl_trid}")
+ xml = prepare_payload(xml, cl_trid)
+
render plain: xml
end
+
+ protected
+
+ def prepare_payload(xml, cl_trid)
+ PREFS.map do |pref|
+ xml.gsub!('"' + pref.to_s + '"',
+ "\"#{Xsd::Schema.filename(for_prefix: pref.to_s)}\"")
+ end
+
+ xml.gsub!('ABC-12345', "#{cl_trid}")
+ xml
+ end
end
end
diff --git a/app/models/depp/domain.rb b/app/models/depp/domain.rb
index 3bb3b7473..f9e065241 100644
--- a/app/models/depp/domain.rb
+++ b/app/models/depp/domain.rb
@@ -6,13 +6,13 @@ module Depp
attr_accessor :name, :current_user, :epp_xml
- STATUSES = %w(
+ STATUSES = %w[
clientDeleteProhibited
clientHold
clientRenewProhibited
clientTransferProhibited
clientUpdateProhibited
- )
+ ].freeze
PERIODS = [
['3 months', '3m'],
@@ -28,11 +28,15 @@ module Depp
['8 years', '8y'],
['9 years', '9y'],
['10 years', '10y'],
- ]
+ ].freeze
def initialize(args = {})
self.current_user = args[:current_user]
- self.epp_xml = EppXml::Domain.new(cl_trid_prefix: current_user.tag)
+ self.epp_xml = EppXml::Domain.new(
+ cl_trid_prefix: current_user.tag,
+ schema_prefix: 'domain-ee',
+ schema_version: '1.1'
+ )
end
def info(domain_name)
@@ -49,6 +53,11 @@ module Depp
current_user.request(xml)
end
+ def hostname_present
+ domain_params[:nameservers_attributes]
+ .select { |_key, value| value['hostname'].present? }.any?
+ end
+
def create(domain_params)
dns_hash = {}
keys = Domain.create_dnskeys_hash(domain_params)
@@ -57,22 +66,22 @@ module Depp
period = domain_params[:period].to_i.to_s
period_unit = domain_params[:period][-1].to_s
- if domain_params[:nameservers_attributes].select { |key, value| value['hostname'].present? }.any?
- xml = epp_xml.create({
- name: { value: domain_params[:name] },
- period: { value: period, attrs: { unit: period_unit } },
- ns: Domain.create_nameservers_hash(domain_params),
- registrant: { value: domain_params[:registrant] },
- _anonymus: Domain.create_contacts_hash(domain_params)
- }, dns_hash, Domain.construct_custom_params_hash(domain_params))
- else
- xml = epp_xml.create({
- name: { value: domain_params[:name] },
- period: { value: period, attrs: { unit: period_unit } },
- registrant: { value: domain_params[:registrant] },
- _anonymus: Domain.create_contacts_hash(domain_params)
- }, dns_hash, Domain.construct_custom_params_hash(domain_params))
- end
+ xml = if hostname_present
+ epp_xml.create({
+ name: { value: domain_params[:name] },
+ period: { value: period, attrs: { unit: period_unit } },
+ ns: Domain.create_nameservers_hash(domain_params),
+ registrant: { value: domain_params[:registrant] },
+ _anonymus: Domain.create_contacts_hash(domain_params)
+ }, dns_hash, Domain.construct_custom_params_hash(domain_params))
+ else
+ epp_xml.create({
+ name: { value: domain_params[:name] },
+ period: { value: period, attrs: { unit: period_unit } },
+ registrant: { value: domain_params[:registrant] },
+ _anonymus: Domain.create_contacts_hash(domain_params)
+ }, dns_hash, Domain.construct_custom_params_hash(domain_params))
+ end
current_user.request(xml)
end
@@ -92,9 +101,10 @@ module Depp
def delete(domain_params)
xml = epp_xml.delete({
- name: { value: domain_params[:name] }},
- Depp::Domain.construct_custom_params_hash(domain_params),
- (domain_params[:verified].present? && 'yes'))
+ name: { value: domain_params[:name] },
+ },
+ Depp::Domain.construct_custom_params_hash(domain_params),
+ (domain_params[:verified].present? && 'yes'))
current_user.request(xml)
end
@@ -104,10 +114,10 @@ module Depp
period_unit = params[:period][-1].to_s
current_user.request(epp_xml.renew(
- name: { value: params[:domain_name] },
- curExpDate: { value: params[:cur_exp_date] },
- period: { value: period, attrs: { unit: period_unit } }
- ))
+ name: { value: params[:domain_name] },
+ curExpDate: { value: params[:cur_exp_date] },
+ period: { value: period, attrs: { unit: period_unit } }
+ ))
end
def transfer(params)
@@ -117,9 +127,9 @@ module Depp
op = params[:reject] ? 'reject' : op
current_user.request(epp_xml.transfer({
- name: { value: params[:domain_name] },
- authInfo: { pw: { value: params[:transfer_code] } }
- }, op, Domain.construct_custom_params_hash(params)))
+ name: { value: params[:domain_name] },
+ authInfo: { pw: { value: params[:transfer_code] } }
+ }, op, Domain.construct_custom_params_hash(params)))
end
def confirm_transfer(domain_params)
@@ -127,9 +137,9 @@ module Depp
pw = data.css('pw').text
xml = epp_xml.transfer({
- name: { value: domain_params[:name] },
- authInfo: { pw: { value: pw } }
- }, 'approve')
+ name: { value: domain_params[:name] },
+ authInfo: { pw: { value: pw } }
+ }, 'approve')
current_user.request(xml)
end
@@ -171,24 +181,25 @@ module Depp
hostname: x.css('hostName').text,
ipv4: Array(x.css('hostAddr[ip="v4"]')).map(&:text).join(','),
ipv6: Array(x.css('hostAddr[ip="v6"]')).map(&:text).join(',')
- }
+ }
end
data.css('keyData').each_with_index do |x, i|
ret[:dnskeys_attributes][i] = {
- flags: x.css('flags').text,
- protocol: x.css('protocol').text,
- alg: x.css('alg').text,
- public_key: x.css('pubKey').text,
- ds_key_tag: x.css('keyTag').first.try(:text),
- ds_alg: x.css('alg').first.try(:text),
- ds_digest_type: x.css('digestType').first.try(:text),
- ds_digest: x.css('digest').first.try(:text)
+ flags: x.css('flags').text,
+ protocol: x.css('protocol').text,
+ alg: x.css('alg').text,
+ public_key: x.css('pubKey').text,
+ ds_key_tag: x.css('keyTag').first.try(:text),
+ ds_alg: x.css('alg').first.try(:text),
+ ds_digest_type: x.css('digestType').first.try(:text),
+ ds_digest: x.css('digest').first.try(:text)
}
end
data.css('status').each_with_index do |x, i|
next unless STATUSES.include?(x['s'])
+
ret[:statuses_attributes][i] = {
code: x['s'],
description: x.text
@@ -203,7 +214,7 @@ module Depp
if domain_params[:legal_document].present?
type = domain_params[:legal_document].original_filename.split('.').last.downcase
custom_params[:_anonymus] << {
- legalDocument: { value: Base64.encode64(domain_params[:legal_document].read), attrs: { type: type } }
+ legalDocument: { value: Base64.encode64(domain_params[:legal_document].read), attrs: { type: type } }
}
end
@@ -231,9 +242,12 @@ module Depp
rem_arr << { ns: rem_ns } if rem_ns.any?
rem_arr << { _anonymus: rem_anon } if rem_anon.any?
- if domain_params[:registrant] != old_domain_params[:registrant]
- chg = [{ registrant: { value: domain_params[:registrant] } }] if !domain_params[:verified].present?
- chg = [{ registrant: { value: domain_params[:registrant], attrs: { verified: 'yes' } } }] if domain_params[:verified]
+ return if domain_params[:registrant] == old_domain_params[:registrant]
+
+ chg = [{ registrant: { value: domain_params[:registrant] } }]
+ if domain_params[:verified].blank? && (domain_params[:verified])
+ chg = [{ registrant: { value: domain_params[:registrant],
+ attrs: { verified: 'yes' } } }]
end
add_arr = nil if add_arr.none?
@@ -263,13 +277,17 @@ module Depp
host_attr = []
host_attr << { hostName: { value: v['hostname'] } }
- v['ipv4'].to_s.split(",").each do |ip|
- host_attr << { hostAddr: { value: ip, attrs: { ip: 'v4' } } }
- end if v['ipv4'].present?
+ if v['ipv4'].present?
+ v['ipv4'].to_s.split(',').each do |ip|
+ host_attr << { hostAddr: { value: ip, attrs: { ip: 'v4' } } }
+ end
+ end
- v['ipv6'].to_s.split(",").each do |ip|
- host_attr << { hostAddr: { value: ip, attrs: { ip: 'v6' } } }
- end if v['ipv6'].present?
+ if v['ipv6'].present?
+ v['ipv6'].to_s.split(',').each do |ip|
+ host_attr << { hostAddr: { value: ip, attrs: { ip: 'v6' } } }
+ end
+ end
ret << { hostAttr: host_attr }
end
@@ -281,6 +299,7 @@ module Depp
ret = []
domain_params[:contacts_attributes].each do |_k, v|
next if v['code'].blank?
+
ret << {
contact: { value: v['code'], attrs: { type: v['type'] } }
}
@@ -294,9 +313,11 @@ module Depp
domain_params[:dnskeys_attributes].each do |_k, v|
if v['ds_key_tag'].blank?
kd = create_key_data_hash(v)
- ret << {
- keyData: kd
- } if kd
+ if kd
+ ret << {
+ keyData: kd
+ }
+ end
else
ret << {
dsData: [
@@ -315,6 +336,7 @@ module Depp
def create_key_data_hash(key_data_params)
return nil if key_data_params['public_key'].blank?
+
{
flags: { value: key_data_params['flags'] },
protocol: { value: key_data_params['protocol'] },
@@ -331,6 +353,6 @@ module Depp
end
ret
end
- end
+ end
end
end
diff --git a/app/models/epp/response/result/code.rb b/app/models/epp/response/result/code.rb
index 10edf0a35..f2b1ccd3b 100644
--- a/app/models/epp/response/result/code.rb
+++ b/app/models/epp/response/result/code.rb
@@ -17,6 +17,7 @@ module Epp
required_parameter_missing: 2003,
parameter_value_range_error: 2004,
parameter_value_syntax_error: 2005,
+ wrong_schema: 2100,
unimplemented: 2101,
billing_failure: 2104,
object_is_not_eligible_for_renewal: 2105,
@@ -47,6 +48,7 @@ module Epp
2003 => 'Required parameter missing',
2004 => 'Parameter value range error',
2005 => 'Parameter value syntax error',
+ 2100 => 'Wrong schema',
2101 => 'Unimplemented command',
2104 => 'Billing failure',
2105 => 'Object is not eligible for renewal',
@@ -79,6 +81,7 @@ module Epp
def initialize(value)
value = value.to_i
raise ArgumentError, "Invalid value: #{value}" unless KEY_TO_VALUE.value?(value)
+
@value = value
end
diff --git a/app/views/epp/domains/check.xml.builder b/app/views/epp/domains/check.xml.builder
index f6f2fe831..7816ac909 100644
--- a/app/views/epp/domains/check.xml.builder
+++ b/app/views/epp/domains/check.xml.builder
@@ -5,7 +5,7 @@ xml.epp_head do
end
xml.resData do
- xml.tag!('domain:chkData', 'xmlns:domain' => Xsd::Schema.filename(for_prefix: 'domain-eis')) do
+ xml.tag!('domain:chkData', 'xmlns:domain' => Xsd::Schema.filename(for_prefix: 'domain-ee')) do
@domains.each do |x|
xml.tag!('domain:cd') do
xml.tag!('domain:name', x[:name], 'avail' => x[:avail])
diff --git a/app/views/epp/domains/create.xml.builder b/app/views/epp/domains/create.xml.builder
index e4f4d969b..7a907c4b7 100644
--- a/app/views/epp/domains/create.xml.builder
+++ b/app/views/epp/domains/create.xml.builder
@@ -5,7 +5,7 @@ xml.epp_head do
end
xml.resData do
- xml.tag!('domain:creData', 'xmlns:domain' => Xsd::Schema.filename(for_prefix: 'domain-eis')) do
+ xml.tag!('domain:creData', 'xmlns:domain' => Xsd::Schema.filename(for_prefix: 'domain-ee')) do
xml.tag!('domain:name', @domain.name)
xml.tag!('domain:crDate', @domain.created_at.try(:iso8601))
xml.tag!('domain:exDate', @domain.valid_to.iso8601)
diff --git a/app/views/epp/domains/info.xml.builder b/app/views/epp/domains/info.xml.builder
index a2079dbce..492248958 100644
--- a/app/views/epp/domains/info.xml.builder
+++ b/app/views/epp/domains/info.xml.builder
@@ -5,7 +5,7 @@ xml.epp_head do
end
xml.resData do
- xml.tag! 'domain:infData', 'xmlns:domain' => Xsd::Schema.filename(for_prefix: 'domain-eis') do
+ xml.tag! 'domain:infData', 'xmlns:domain' => Xsd::Schema.filename(for_prefix: 'domain-ee') do
xml.tag!('domain:name', @domain.name)
xml.tag!('domain:roid', @domain.roid)
@domain.statuses.each do |s|
diff --git a/app/views/epp/domains/partials/_transfer.xml.builder b/app/views/epp/domains/partials/_transfer.xml.builder
index 4e1569908..e9de73ce3 100644
--- a/app/views/epp/domains/partials/_transfer.xml.builder
+++ b/app/views/epp/domains/partials/_transfer.xml.builder
@@ -1,4 +1,4 @@
-builder.tag!('domain:trnData', 'xmlns:domain' => Xsd::Schema.filename(for_prefix: 'domain-eis')) do
+builder.tag!('domain:trnData', 'xmlns:domain' => Xsd::Schema.filename(for_prefix: 'domain-ee')) do
builder.tag!('domain:name', dt.domain_name)
builder.tag!('domain:trStatus', dt.status)
builder.tag!('domain:reID', dt.new_registrar.code)
diff --git a/app/views/epp/domains/renew.xml.builder b/app/views/epp/domains/renew.xml.builder
index 89a939af5..91fdbf1c9 100644
--- a/app/views/epp/domains/renew.xml.builder
+++ b/app/views/epp/domains/renew.xml.builder
@@ -5,7 +5,7 @@ xml.epp_head do
end
xml.resData do
- xml.tag!('domain:renData', 'xmlns:domain' => Xsd::Schema.filename(for_prefix: 'domain-eis')) do
+ xml.tag!('domain:renData', 'xmlns:domain' => Xsd::Schema.filename(for_prefix: 'domain-ee')) do
xml.tag!('domain:name', @domain[:name])
xml.tag!('domain:exDate', @domain.valid_to.iso8601)
end
diff --git a/app/views/epp/error.xml.builder b/app/views/epp/error.xml.builder
index f906a7e04..609c323ff 100644
--- a/app/views/epp/error.xml.builder
+++ b/app/views/epp/error.xml.builder
@@ -7,7 +7,7 @@ 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'
+ prefix = model_name == 'poll' ? 'changePoll' : model_name + '-ee'
xml.value("xmlns:#{model_name}" => Xsd::Schema.filename(for_prefix: prefix)) do
value = x[:value][:val]
diff --git a/app/views/epp/sessions/greeting.xml.builder b/app/views/epp/sessions/greeting.xml.builder
index c1461f2e2..054307652 100644
--- a/app/views/epp/sessions/greeting.xml.builder
+++ b/app/views/epp/sessions/greeting.xml.builder
@@ -5,7 +5,7 @@ xml.epp_head do
xml.svcMenu do
xml.version '1.0'
xml.lang 'en'
- xml.objURI Xsd::Schema.filename(for_prefix: 'domain-eis')
+ xml.objURI Xsd::Schema.filename(for_prefix: 'domain-ee')
xml.objURI Xsd::Schema.filename(for_prefix: 'contact-ee')
xml.objURI 'urn:ietf:params:xml:ns:host-1.0'
xml.svcExtension do
diff --git a/app/views/registrar/xml_consoles/epp_requests/contact/check.xml b/app/views/registrar/xml_consoles/epp_requests/contact/check.xml
index f8d6e05ce..f4c10d8bd 100644
--- a/app/views/registrar/xml_consoles/epp_requests/contact/check.xml
+++ b/app/views/registrar/xml_consoles/epp_requests/contact/check.xml
@@ -1,9 +1,9 @@
-
+
+ xmlns:contact="contact-ee">
sh8013
diff --git a/app/views/registrar/xml_consoles/epp_requests/contact/check_multiple.xml b/app/views/registrar/xml_consoles/epp_requests/contact/check_multiple.xml
index b71871ed1..bdcff03dd 100644
--- a/app/views/registrar/xml_consoles/epp_requests/contact/check_multiple.xml
+++ b/app/views/registrar/xml_consoles/epp_requests/contact/check_multiple.xml
@@ -1,9 +1,9 @@
-
+
+ xmlns:contact="contact-ee">
sh8013
sh13
vsdfvq
diff --git a/app/views/registrar/xml_consoles/epp_requests/contact/create.xml b/app/views/registrar/xml_consoles/epp_requests/contact/create.xml
index 2607a7582..fc60b8311 100644
--- a/app/views/registrar/xml_consoles/epp_requests/contact/create.xml
+++ b/app/views/registrar/xml_consoles/epp_requests/contact/create.xml
@@ -1,8 +1,8 @@
-
+
-
+
Sillius Soddus
@@ -20,7 +20,7 @@
-
+
123
dGVzdCBmYWlsCg==
diff --git a/app/views/registrar/xml_consoles/epp_requests/contact/delete.xml b/app/views/registrar/xml_consoles/epp_requests/contact/delete.xml
index 2d2e483a2..28b50af64 100644
--- a/app/views/registrar/xml_consoles/epp_requests/contact/delete.xml
+++ b/app/views/registrar/xml_consoles/epp_requests/contact/delete.xml
@@ -1,9 +1,9 @@
-
+
+ xmlns:contact="contact-ee">
sh8013
wrong-one
@@ -11,7 +11,7 @@
-
+
dGVzdCBmYWlsCg==
diff --git a/app/views/registrar/xml_consoles/epp_requests/contact/info.xml b/app/views/registrar/xml_consoles/epp_requests/contact/info.xml
index 01685a3a1..44e5d5a1e 100644
--- a/app/views/registrar/xml_consoles/epp_requests/contact/info.xml
+++ b/app/views/registrar/xml_consoles/epp_requests/contact/info.xml
@@ -1,8 +1,8 @@
-
+
-
+
sh8013
Aas34fq
diff --git a/app/views/registrar/xml_consoles/epp_requests/contact/update_chg.xml b/app/views/registrar/xml_consoles/epp_requests/contact/update_chg.xml
index e7fa45dde..61ea43202 100644
--- a/app/views/registrar/xml_consoles/epp_requests/contact/update_chg.xml
+++ b/app/views/registrar/xml_consoles/epp_requests/contact/update_chg.xml
@@ -1,8 +1,8 @@
-
+
-
+
sh8013
@@ -25,7 +25,7 @@
-
+
dGVzdCBmYWlsCg==
diff --git a/app/views/registrar/xml_consoles/epp_requests/domain/check.xml b/app/views/registrar/xml_consoles/epp_requests/domain/check.xml
index 4c03654cd..06492bcfe 100644
--- a/app/views/registrar/xml_consoles/epp_requests/domain/check.xml
+++ b/app/views/registrar/xml_consoles/epp_requests/domain/check.xml
@@ -1,9 +1,9 @@
-
+
+ xmlns:domain="domain-ee">
example.ee
diff --git a/app/views/registrar/xml_consoles/epp_requests/domain/client_hold.xml b/app/views/registrar/xml_consoles/epp_requests/domain/client_hold.xml
index 31c9c21af..68f0b778e 100644
--- a/app/views/registrar/xml_consoles/epp_requests/domain/client_hold.xml
+++ b/app/views/registrar/xml_consoles/epp_requests/domain/client_hold.xml
@@ -1,9 +1,9 @@
-
+
+ xmlns:domain="domain-ee">
example.ee
diff --git a/app/views/registrar/xml_consoles/epp_requests/domain/create.xml b/app/views/registrar/xml_consoles/epp_requests/domain/create.xml
index d962ef259..f57fcfe30 100644
--- a/app/views/registrar/xml_consoles/epp_requests/domain/create.xml
+++ b/app/views/registrar/xml_consoles/epp_requests/domain/create.xml
@@ -1,9 +1,9 @@
-
+
+ xmlns:domain="domain-ee">
example.ee
1
@@ -31,7 +31,7 @@
AwEAAddt2AkLfYGKgiEZB5SmIF8EvrjxNMH6HtxWEA4RJ9Ao6LCWheg8
-
+
dGVzdCBmYWlsCg==
diff --git a/app/views/registrar/xml_consoles/epp_requests/domain/delete.xml b/app/views/registrar/xml_consoles/epp_requests/domain/delete.xml
index f7a004982..f47bb79eb 100644
--- a/app/views/registrar/xml_consoles/epp_requests/domain/delete.xml
+++ b/app/views/registrar/xml_consoles/epp_requests/domain/delete.xml
@@ -1,14 +1,14 @@
-
+
+ xmlns:domain="domain-ee">
example.ee
-
+
dGVzdCBmYWlsCg==
diff --git a/app/views/registrar/xml_consoles/epp_requests/domain/info.xml b/app/views/registrar/xml_consoles/epp_requests/domain/info.xml
index c79100824..210396c3b 100644
--- a/app/views/registrar/xml_consoles/epp_requests/domain/info.xml
+++ b/app/views/registrar/xml_consoles/epp_requests/domain/info.xml
@@ -1,9 +1,9 @@
-
+
+ xmlns:domain="domain-ee">
example.ee
2fooBAR
diff --git a/app/views/registrar/xml_consoles/epp_requests/domain/renew.xml b/app/views/registrar/xml_consoles/epp_requests/domain/renew.xml
index 9993bc1e0..6ef479468 100644
--- a/app/views/registrar/xml_consoles/epp_requests/domain/renew.xml
+++ b/app/views/registrar/xml_consoles/epp_requests/domain/renew.xml
@@ -1,9 +1,9 @@
-
+
+ xmlns:domain="domain-ee">
example.ee
2014-08-07
1
diff --git a/app/views/registrar/xml_consoles/epp_requests/domain/transfer.xml b/app/views/registrar/xml_consoles/epp_requests/domain/transfer.xml
index 7f94ca60e..f6ee87b79 100644
--- a/app/views/registrar/xml_consoles/epp_requests/domain/transfer.xml
+++ b/app/views/registrar/xml_consoles/epp_requests/domain/transfer.xml
@@ -1,9 +1,9 @@
-
+
+ xmlns:domain="domain-ee">
example.ee
2BARfoo
@@ -11,7 +11,7 @@
-
+
dGVzdCBmYWlsCg==
diff --git a/app/views/registrar/xml_consoles/epp_requests/domain/update.xml b/app/views/registrar/xml_consoles/epp_requests/domain/update.xml
index 3318a7e51..c087245e7 100644
--- a/app/views/registrar/xml_consoles/epp_requests/domain/update.xml
+++ b/app/views/registrar/xml_consoles/epp_requests/domain/update.xml
@@ -1,9 +1,9 @@
-
+
+ xmlns:domain="domain-ee">
example.ee
@@ -43,7 +43,7 @@
-
+
dGVzdCBmYWlsCg==
diff --git a/app/views/registrar/xml_consoles/epp_requests/poll/poll.xml b/app/views/registrar/xml_consoles/epp_requests/poll/poll.xml
index abf77ae19..5ffed010e 100644
--- a/app/views/registrar/xml_consoles/epp_requests/poll/poll.xml
+++ b/app/views/registrar/xml_consoles/epp_requests/poll/poll.xml
@@ -1,5 +1,5 @@
-
+
ABC-12345
diff --git a/config/initializers/load_schemas.rb b/config/initializers/load_schemas.rb
index fa0150896..1f34d58df 100644
--- a/config/initializers/load_schemas.rb
+++ b/config/initializers/load_schemas.rb
@@ -1 +1 @@
-EPP_ALL_SCHEMA = Nokogiri::XML::Schema(File.read('lib/schemas/all-ee-1.1.xsd'))
+EPP_ALL_SCHEMA = Nokogiri::XML::Schema(File.read('lib/schemas/all-ee-1.2.xsd'))
diff --git a/config/routes.rb b/config/routes.rb
index 43cced0a0..0db226cf1 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -34,6 +34,18 @@ Rails.application.routes.draw do
end
end
+ constraints(EppConstraint.new(:error)) do
+ controller('errors') do
+ post 'command/create', to: 'errors#wrong_schema'
+ post 'command/update', to: 'errors#wrong_schema'
+ post 'command/info', to: 'errors#wrong_schema'
+ post 'command/check', to: 'errors#wrong_schema'
+ post 'command/transfer', to: 'errors#wrong_schema'
+ post 'command/renew', to: 'errors#wrong_schema'
+ post 'command/delete', to: 'errors#wrong_schema'
+ end
+ end
+
post 'command/poll', to: 'polls#poll', as: 'poll', constraints: EppConstraint.new(:poll)
get 'error/:command', to: 'errors#error'
get 'error', to: 'errors#command_handler'
diff --git a/lib/epp_constraint.rb b/lib/epp_constraint.rb
index 1720d3202..122be7593 100644
--- a/lib/epp_constraint.rb
+++ b/lib/epp_constraint.rb
@@ -1,6 +1,9 @@
class EppConstraint
OBJECT_TYPES = {
- domain: { domain: Xsd::Schema.filename(for_prefix: 'domain-eis') },
+ domain: [
+ { domain: Xsd::Schema.filename(for_prefix: 'domain-ee') },
+ { domain: Xsd::Schema.filename(for_prefix: 'domain-eis') },
+ ],
contact: { contact: Xsd::Schema.filename(for_prefix: 'contact-ee') },
}.freeze
@@ -11,16 +14,45 @@ class EppConstraint
# creates parsed_frame, detects epp request object
def matches?(request)
# TODO: Maybe move this to controller to keep params clean
- request.params[:raw_frame] = request.params[:raw_frame].gsub!(/(?<=>)(.*?)(?=<)/) { |s| s.strip} if request.params[:raw_frame]
- request.params[:nokogiri_frame] ||= Nokogiri::XML(request.params[:raw_frame] || request.params[:frame])
- request.params[:parsed_frame] ||= request.params[:nokogiri_frame].dup.remove_namespaces!
+ return redirect_to_error_controller(request) if request.params[:action] == 'wrong_schema'
+
+ request = parse_raw_frame(request) if request.params[:raw_frame]
+
+ request = parse_params(request)
unless %i[poll session].include?(@type)
element = "//#{@type}:#{request.params[:action]}"
- return false if request.params[:nokogiri_frame].xpath("#{element}", OBJECT_TYPES[@type]).none?
+
+ return enumerate_domain_object(request, element) if @type == :domain
+
+ return false if request.params[:nokogiri_frame].xpath(element.to_s, OBJECT_TYPES[@type]).none?
end
request.params[:epp_object_type] = @type
true
end
+
+ def parse_raw_frame(request)
+ request.params[:raw_frame] = request.params[:raw_frame].gsub!(/(?<=>)(.*?)(?=<)/, &:strip)
+ request
+ end
+
+ def enumerate_domain_object(request, element)
+ OBJECT_TYPES[@type].each do |obj|
+ return true unless request.params[:nokogiri_frame].xpath(element.to_s, obj).none?
+ end
+ false
+ end
+
+ def parse_params(request)
+ request.params[:nokogiri_frame] ||= Nokogiri::XML(request.params[:raw_frame] || request.params[:frame])
+ request.params[:parsed_frame] ||= request.params[:nokogiri_frame].dup.remove_namespaces!
+
+ request
+ end
+
+ def redirect_to_error_controller(request)
+ request.params[:epp_object_type] = @error
+ true
+ end
end
diff --git a/lib/schemas/all-ee-1.2.xsd b/lib/schemas/all-ee-1.2.xsd
new file mode 100644
index 000000000..5d9e3652a
--- /dev/null
+++ b/lib/schemas/all-ee-1.2.xsd
@@ -0,0 +1,43 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Extensible Provisioning Protocol v1.0
+ all schema's grouped together
+
+
+
+
diff --git a/lib/schemas/domain-ee-1.1.xsd b/lib/schemas/domain-ee-1.1.xsd
new file mode 100644
index 000000000..073986ac7
--- /dev/null
+++ b/lib/schemas/domain-ee-1.1.xsd
@@ -0,0 +1,472 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Extensible Provisioning Protocol v1.0
+ domain provisioning schema.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/lib/xsd/schema.rb b/lib/xsd/schema.rb
index 12a0cd6d9..2ac57fb3a 100644
--- a/lib/xsd/schema.rb
+++ b/lib/xsd/schema.rb
@@ -3,6 +3,22 @@ module Xsd
SCHEMA_PATH = 'lib/schemas/'.freeze
BASE_URL = 'https://epp.tld.ee/schema/'.freeze
+ PREFIXES = %w[
+ domain-ee
+ domain-eis
+ all-ee
+ changePoll
+ contact
+ contact-ee
+ contact-eis
+ eis
+ epp
+ epp-ee
+ eppcom
+ host
+ secDNS
+ ].freeze
+
attr_reader :xsd_schemas, :for_prefix
def initialize(params)
diff --git a/test/integration/admin_area/domain_update_confirms_test.rb b/test/integration/admin_area/domain_update_confirms_test.rb
index bf504983b..5d26a004a 100644
--- a/test/integration/admin_area/domain_update_confirms_test.rb
+++ b/test/integration/admin_area/domain_update_confirms_test.rb
@@ -18,7 +18,7 @@ class AdminAreaBlockedDomainsIntegrationTest < JavaScriptApplicationSystemTestCa
-
+
#{@domain.name}
#{new_registrant.code}
@@ -53,7 +53,7 @@ class AdminAreaBlockedDomainsIntegrationTest < JavaScriptApplicationSystemTestCa
-
+
#{@domain.name}
#{new_registrant.code}
diff --git a/test/integration/epp/base_test.rb b/test/integration/epp/base_test.rb
index 51f1f37a9..56ea3f2e8 100644
--- a/test/integration/epp/base_test.rb
+++ b/test/integration/epp/base_test.rb
@@ -18,25 +18,44 @@ class EppBaseTest < EppTestCase
def test_internal_error
Rails.application.routes.draw do
post 'epp/command/internal_error', to: 'dummy_epp#internal_error',
- constraints: EppConstraint.new(:poll)
+ constraints: EppConstraint.new(:poll)
end
begin
assert_difference 'ApiLog::EppLog.count' do
post '/epp/command/internal_error', params: { frame: valid_request_xml },
- headers: { 'HTTP_COOKIE' => 'session=api_bestnames' }
+ headers: { 'HTTP_COOKIE' => 'session=api_bestnames' }
end
assert_epp_response :command_failed
- rescue
+ rescue StandardError
raise
ensure
Rails.application.reload_routes!
end
end
+ def test_wrong_path_xml
+ wrong_path_xml = <<-XML
+
+
+
+
+
+ #{domains(:shop).name}
+
+
+
+
+ XML
+ post epp_info_path, params: { frame: wrong_path_xml },
+ headers: { 'HTTP_COOKIE' => 'session=api_bestnames' }
+
+ assert_epp_response :wrong_schema
+ end
+
def test_additional_error
get '/epp/error', params: { frame: valid_request_xml },
- headers: { 'HTTP_COOKIE' => 'session=api_bestnames' }
+ headers: { 'HTTP_COOKIE' => 'session=api_bestnames' }
assert_epp_response :unknown_command
end
@@ -49,7 +68,7 @@ class EppBaseTest < EppTestCase
XML
get '/epp/error', params: { frame: invalid_xml },
- headers: { 'HTTP_COOKIE' => 'session=api_bestnames' }
+ headers: { 'HTTP_COOKIE' => 'session=api_bestnames' }
assert_epp_response :unknown_command
end
@@ -61,7 +80,7 @@ class EppBaseTest < EppTestCase
XML
post valid_command_path, params: { frame: invalid_xml },
- headers: { 'HTTP_COOKIE' => 'session=api_bestnames' }
+ headers: { 'HTTP_COOKIE' => 'session=api_bestnames' }
assert_epp_response :required_parameter_missing
end
@@ -72,7 +91,7 @@ class EppBaseTest < EppTestCase
-
+
#{domains(:shop).name}
@@ -80,7 +99,7 @@ class EppBaseTest < EppTestCase
XML
post epp_info_path, params: { frame: xml_of_epp_command_that_requires_authentication },
- headers: { 'HTTP_COOKIE' => 'session=non-existent' }
+ headers: { 'HTTP_COOKIE' => 'session=non-existent' }
assert_epp_response :authorization_error
end
@@ -96,7 +115,7 @@ class EppBaseTest < EppTestCase
-
+
#{domains(:shop).name}
@@ -104,7 +123,7 @@ class EppBaseTest < EppTestCase
XML
post epp_info_path, params: { frame: xml_of_epp_command_that_requires_authorization },
- headers: { 'HTTP_COOKIE' => "session=#{session.session_id}" }
+ headers: { 'HTTP_COOKIE' => "session=#{session.session_id}" }
assert_epp_response :authorization_error
end
@@ -122,7 +141,7 @@ class EppBaseTest < EppTestCase
-
+
#{domains(:shop).name}
@@ -130,7 +149,7 @@ class EppBaseTest < EppTestCase
XML
post '/epp/command/info', params: { frame: authentication_enabled_epp_request_xml },
- headers: { 'HTTP_COOKIE' => "session=#{session.session_id}" }
+ headers: { 'HTTP_COOKIE' => "session=#{session.session_id}" }
assert_epp_response :authorization_error
assert_nil EppSession.find_by(session_id: session.session_id)
@@ -149,7 +168,7 @@ class EppBaseTest < EppTestCase
-
+
#{domains(:shop).name}
@@ -158,7 +177,7 @@ class EppBaseTest < EppTestCase
XML
post '/epp/command/info', params: { frame: authentication_enabled_epp_request_xml },
- headers: { 'HTTP_COOKIE' => "session=#{session.session_id}" }
+ headers: { 'HTTP_COOKIE' => "session=#{session.session_id}" }
session.reload
diff --git a/test/integration/epp/domain/base_test.rb b/test/integration/epp/domain/base_test.rb
index c13f49eef..e8c905062 100644
--- a/test/integration/epp/domain/base_test.rb
+++ b/test/integration/epp/domain/base_test.rb
@@ -7,7 +7,7 @@ class EppDomainBaseTest < EppTestCase
-
+
non-existent.test
@@ -15,8 +15,27 @@ class EppDomainBaseTest < EppTestCase
XML
post epp_info_path, params: { frame: request_xml },
- headers: { 'HTTP_COOKIE' => 'session=api_bestnames' }
+ headers: { 'HTTP_COOKIE' => 'session=api_bestnames' }
assert_epp_response :object_does_not_exist
end
+
+ def test_invalid_path
+ request_xml = <<-XML
+
+
+
+
+
+ non-existent.test
+
+
+
+
+ XML
+ post epp_info_path, params: { frame: request_xml },
+ headers: { 'HTTP_COOKIE' => 'session=api_bestnames' }
+
+ assert_epp_response :wrong_schema
+ end
end
diff --git a/test/integration/epp/domain/check/auction_test.rb b/test/integration/epp/domain/check/auction_test.rb
index 3447016e3..ece849b00 100644
--- a/test/integration/epp/domain/check/auction_test.rb
+++ b/test/integration/epp/domain/check/auction_test.rb
@@ -20,7 +20,7 @@ class EppDomainCheckAuctionTest < EppTestCase
-
+
auction.test
@@ -33,8 +33,8 @@ class EppDomainCheckAuctionTest < EppTestCase
response_xml = Nokogiri::XML(response.body)
assert_epp_response :completed_successfully
- assert_equal '0', response_xml.at_xpath('//domain:name', 'domain' => "#{Xsd::Schema.filename(for_prefix: 'domain-eis')}")['avail']
- assert_equal 'Domain is at auction', response_xml.at_xpath('//domain:reason', 'domain' => "#{Xsd::Schema.filename(for_prefix: 'domain-eis')}").text
+ assert_equal '0', response_xml.at_xpath('//domain:name', 'domain' => "#{Xsd::Schema.filename(for_prefix: 'domain-ee')}")['avail']
+ assert_equal 'Domain is at auction', response_xml.at_xpath('//domain:reason', 'domain' => "#{Xsd::Schema.filename(for_prefix: 'domain-ee')}").text
end
def test_idn_ascii_domain_is_unavailable_when_at_auction
@@ -45,7 +45,7 @@ class EppDomainCheckAuctionTest < EppTestCase
-
+
xn--pramiid-n2a.test
@@ -58,8 +58,8 @@ class EppDomainCheckAuctionTest < EppTestCase
response_xml = Nokogiri::XML(response.body)
assert_epp_response :completed_successfully
- assert_equal '0', response_xml.at_xpath('//domain:name', 'domain' => "#{Xsd::Schema.filename(for_prefix: 'domain-eis')}")['avail']
- assert_equal 'Domain is at auction', response_xml.at_xpath('//domain:reason', 'domain' => "#{Xsd::Schema.filename(for_prefix: 'domain-eis')}").text
+ assert_equal '0', response_xml.at_xpath('//domain:name', 'domain' => "#{Xsd::Schema.filename(for_prefix: 'domain-ee')}")['avail']
+ assert_equal 'Domain is at auction', response_xml.at_xpath('//domain:reason', 'domain' => "#{Xsd::Schema.filename(for_prefix: 'domain-ee')}").text
end
def test_idn_unicode_domain_is_unavailable_when_at_auction
@@ -70,7 +70,7 @@ class EppDomainCheckAuctionTest < EppTestCase
-
+
püramiid.test
@@ -83,8 +83,8 @@ class EppDomainCheckAuctionTest < EppTestCase
response_xml = Nokogiri::XML(response.body)
assert_epp_response :completed_successfully
- assert_equal '0', response_xml.at_xpath('//domain:name', 'domain' => "#{Xsd::Schema.filename(for_prefix: 'domain-eis')}")['avail']
- assert_equal 'Domain is at auction', response_xml.at_xpath('//domain:reason', 'domain' => "#{Xsd::Schema.filename(for_prefix: 'domain-eis')}").text
+ assert_equal '0', response_xml.at_xpath('//domain:name', 'domain' => "#{Xsd::Schema.filename(for_prefix: 'domain-ee')}")['avail']
+ assert_equal 'Domain is at auction', response_xml.at_xpath('//domain:reason', 'domain' => "#{Xsd::Schema.filename(for_prefix: 'domain-ee')}").text
end
def test_domain_is_unavailable_when_awaiting_payment
@@ -95,7 +95,7 @@ class EppDomainCheckAuctionTest < EppTestCase
-
+
auction.test
@@ -108,8 +108,8 @@ class EppDomainCheckAuctionTest < EppTestCase
response_xml = Nokogiri::XML(response.body)
assert_epp_response :completed_successfully
- assert_equal '0', response_xml.at_xpath('//domain:name', 'domain' => "#{Xsd::Schema.filename(for_prefix: 'domain-eis')}")['avail']
- assert_equal 'Awaiting payment', response_xml.at_xpath('//domain:reason', 'domain' => "#{Xsd::Schema.filename(for_prefix: 'domain-eis')}").text
+ assert_equal '0', response_xml.at_xpath('//domain:name', 'domain' => "#{Xsd::Schema.filename(for_prefix: 'domain-ee')}")['avail']
+ assert_equal 'Awaiting payment', response_xml.at_xpath('//domain:reason', 'domain' => "#{Xsd::Schema.filename(for_prefix: 'domain-ee')}").text
end
def test_domain_is_available_when_payment_received
@@ -120,7 +120,7 @@ class EppDomainCheckAuctionTest < EppTestCase
-
+
auction.test
@@ -133,7 +133,7 @@ class EppDomainCheckAuctionTest < EppTestCase
response_xml = Nokogiri::XML(response.body)
assert_epp_response :completed_successfully
- assert_equal '1', response_xml.at_xpath('//domain:name', 'domain' => "#{Xsd::Schema.filename(for_prefix: 'domain-eis')}")['avail']
- assert_nil response_xml.at_xpath('//domain:reason', 'domain' => "#{Xsd::Schema.filename(for_prefix: 'domain-eis')}")
+ assert_equal '1', response_xml.at_xpath('//domain:name', 'domain' => "#{Xsd::Schema.filename(for_prefix: 'domain-ee')}")['avail']
+ assert_nil response_xml.at_xpath('//domain:reason', 'domain' => "#{Xsd::Schema.filename(for_prefix: 'domain-ee')}")
end
end
diff --git a/test/integration/epp/domain/check/base_test.rb b/test/integration/epp/domain/check/base_test.rb
index f418fa8a2..07e1e2081 100644
--- a/test/integration/epp/domain/check/base_test.rb
+++ b/test/integration/epp/domain/check/base_test.rb
@@ -7,7 +7,7 @@ class EppDomainCheckBaseTest < EppTestCase
-
+
some.test
@@ -20,7 +20,7 @@ class EppDomainCheckBaseTest < EppTestCase
response_xml = Nokogiri::XML(response.body)
assert_epp_response :completed_successfully
- assert_equal 'some.test', response_xml.at_xpath('//domain:name', 'domain' => "#{Xsd::Schema.filename(for_prefix: 'domain-eis')}").text
+ assert_equal 'some.test', response_xml.at_xpath('//domain:name', 'domain' => "#{Xsd::Schema.filename(for_prefix: 'domain-ee')}").text
end
def test_domain_is_available_when_not_registered_or_blocked
@@ -29,7 +29,7 @@ class EppDomainCheckBaseTest < EppTestCase
-
+
available.test
@@ -41,8 +41,8 @@ class EppDomainCheckBaseTest < EppTestCase
headers: { 'HTTP_COOKIE' => 'session=api_bestnames' }
response_xml = Nokogiri::XML(response.body)
- assert_equal '1', response_xml.at_xpath('//domain:name', 'domain' => "#{Xsd::Schema.filename(for_prefix: 'domain-eis')}")['avail']
- assert_nil response_xml.at_xpath('//domain:reason', 'domain' => "#{Xsd::Schema.filename(for_prefix: 'domain-eis')}")
+ assert_equal '1', response_xml.at_xpath('//domain:name', 'domain' => "#{Xsd::Schema.filename(for_prefix: 'domain-ee')}")['avail']
+ assert_nil response_xml.at_xpath('//domain:reason', 'domain' => "#{Xsd::Schema.filename(for_prefix: 'domain-ee')}")
end
def test_domain_is_available_when_reserved
@@ -53,7 +53,7 @@ class EppDomainCheckBaseTest < EppTestCase
-
+
reserved.test
@@ -65,8 +65,8 @@ class EppDomainCheckBaseTest < EppTestCase
headers: { 'HTTP_COOKIE' => 'session=api_bestnames' }
response_xml = Nokogiri::XML(response.body)
- assert_equal '1', response_xml.at_xpath('//domain:name', 'domain' => "#{Xsd::Schema.filename(for_prefix: 'domain-eis')}")['avail']
- assert_nil response_xml.at_xpath('//domain:reason', 'domain' => "#{Xsd::Schema.filename(for_prefix: 'domain-eis')}")
+ assert_equal '1', response_xml.at_xpath('//domain:name', 'domain' => "#{Xsd::Schema.filename(for_prefix: 'domain-ee')}")['avail']
+ assert_nil response_xml.at_xpath('//domain:reason', 'domain' => "#{Xsd::Schema.filename(for_prefix: 'domain-ee')}")
end
def test_domain_is_unavailable_when_format_is_invalid
@@ -75,7 +75,7 @@ class EppDomainCheckBaseTest < EppTestCase
-
+
invalid
@@ -87,8 +87,8 @@ class EppDomainCheckBaseTest < EppTestCase
headers: { 'HTTP_COOKIE' => 'session=api_bestnames' }
response_xml = Nokogiri::XML(response.body)
- assert_equal '0', response_xml.at_xpath('//domain:name', 'domain' => "#{Xsd::Schema.filename(for_prefix: 'domain-eis')}")['avail']
- assert_equal 'invalid format', response_xml.at_xpath('//domain:reason', 'domain' => "#{Xsd::Schema.filename(for_prefix: 'domain-eis')}").text
+ assert_equal '0', response_xml.at_xpath('//domain:name', 'domain' => "#{Xsd::Schema.filename(for_prefix: 'domain-ee')}")['avail']
+ assert_equal 'invalid format', response_xml.at_xpath('//domain:reason', 'domain' => "#{Xsd::Schema.filename(for_prefix: 'domain-ee')}").text
end
def test_domain_is_unavailable_when_registered
@@ -99,7 +99,7 @@ class EppDomainCheckBaseTest < EppTestCase
-
+
shop.test
@@ -111,8 +111,8 @@ class EppDomainCheckBaseTest < EppTestCase
headers: { 'HTTP_COOKIE' => 'session=api_bestnames' }
response_xml = Nokogiri::XML(response.body)
- assert_equal '0', response_xml.at_xpath('//domain:name', 'domain' => "#{Xsd::Schema.filename(for_prefix: 'domain-eis')}")['avail']
- assert_equal 'in use', response_xml.at_xpath('//domain:reason', 'domain' => "#{Xsd::Schema.filename(for_prefix: 'domain-eis')}").text
+ assert_equal '0', response_xml.at_xpath('//domain:name', 'domain' => "#{Xsd::Schema.filename(for_prefix: 'domain-ee')}")['avail']
+ assert_equal 'in use', response_xml.at_xpath('//domain:reason', 'domain' => "#{Xsd::Schema.filename(for_prefix: 'domain-ee')}").text
end
def test_domain_is_unavailable_when_blocked
@@ -123,7 +123,7 @@ class EppDomainCheckBaseTest < EppTestCase
-
+
blocked.test
@@ -135,8 +135,8 @@ class EppDomainCheckBaseTest < EppTestCase
headers: { 'HTTP_COOKIE' => 'session=api_bestnames' }
response_xml = Nokogiri::XML(response.body)
- assert_equal '0', response_xml.at_xpath('//domain:name', 'domain' => "#{Xsd::Schema.filename(for_prefix: 'domain-eis')}")['avail']
- assert_equal 'Blocked', response_xml.at_xpath('//domain:reason', 'domain' => "#{Xsd::Schema.filename(for_prefix: 'domain-eis')}").text
+ assert_equal '0', response_xml.at_xpath('//domain:name', 'domain' => "#{Xsd::Schema.filename(for_prefix: 'domain-ee')}")['avail']
+ assert_equal 'Blocked', response_xml.at_xpath('//domain:reason', 'domain' => "#{Xsd::Schema.filename(for_prefix: 'domain-ee')}").text
end
def test_domain_is_unavailable_when_zone_with_the_same_origin_exists
@@ -147,7 +147,7 @@ class EppDomainCheckBaseTest < EppTestCase
-
+
test
@@ -159,8 +159,8 @@ class EppDomainCheckBaseTest < EppTestCase
headers: { 'HTTP_COOKIE' => 'session=api_bestnames' }
response_xml = Nokogiri::XML(response.body)
- assert_equal '0', response_xml.at_xpath('//domain:name', 'domain' => "#{Xsd::Schema.filename(for_prefix: 'domain-eis')}")['avail']
- assert_equal 'Zone with the same origin exists', response_xml.at_xpath('//domain:reason', 'domain' => "#{Xsd::Schema.filename(for_prefix: 'domain-eis')}").text
+ assert_equal '0', response_xml.at_xpath('//domain:name', 'domain' => "#{Xsd::Schema.filename(for_prefix: 'domain-ee')}")['avail']
+ assert_equal 'Zone with the same origin exists', response_xml.at_xpath('//domain:reason', 'domain' => "#{Xsd::Schema.filename(for_prefix: 'domain-ee')}").text
end
def test_multiple_domains
@@ -169,7 +169,7 @@ class EppDomainCheckBaseTest < EppTestCase
-
+
one.test
two.test
three.test
@@ -183,6 +183,6 @@ class EppDomainCheckBaseTest < EppTestCase
headers: { 'HTTP_COOKIE' => 'session=api_bestnames' }
response_xml = Nokogiri::XML(response.body)
- assert_equal 3, response_xml.xpath('//domain:cd', 'domain' => "#{Xsd::Schema.filename(for_prefix: 'domain-eis')}").size
+ assert_equal 3, response_xml.xpath('//domain:cd', 'domain' => "#{Xsd::Schema.filename(for_prefix: 'domain-ee')}").size
end
end
diff --git a/test/integration/epp/domain/create/auction_idn_test.rb b/test/integration/epp/domain/create/auction_idn_test.rb
index 170b4eb79..2f2fd6fd9 100644
--- a/test/integration/epp/domain/create/auction_idn_test.rb
+++ b/test/integration/epp/domain/create/auction_idn_test.rb
@@ -24,7 +24,7 @@ class EppDomainCreateAuctionIdnTest < EppTestCase
-
+
xn--pramiid-n2a.test
#{contacts(:john).code}
@@ -59,7 +59,7 @@ class EppDomainCreateAuctionIdnTest < EppTestCase
-
+
püramiid.test
#{contacts(:john).code}
@@ -93,7 +93,7 @@ class EppDomainCreateAuctionIdnTest < EppTestCase
-
+
xn--pramiid-n2a.test
#{contacts(:john).code}
@@ -127,7 +127,7 @@ class EppDomainCreateAuctionIdnTest < EppTestCase
-
+
püramiid.test
#{contacts(:john).code}
@@ -162,7 +162,7 @@ class EppDomainCreateAuctionIdnTest < EppTestCase
-
+
püramiid.test
#{contacts(:john).code}
@@ -199,7 +199,7 @@ class EppDomainCreateAuctionIdnTest < EppTestCase
-
+
xn--pramiid-n2a.test
#{contacts(:john).code}
diff --git a/test/integration/epp/domain/create/auction_test.rb b/test/integration/epp/domain/create/auction_test.rb
index 1e9d5fa32..3c2b14d5c 100644
--- a/test/integration/epp/domain/create/auction_test.rb
+++ b/test/integration/epp/domain/create/auction_test.rb
@@ -16,7 +16,7 @@ class EppDomainCreateAuctionTest < EppTestCase
-
+
not-at-auction.test
#{contacts(:john).code}
@@ -51,7 +51,7 @@ class EppDomainCreateAuctionTest < EppTestCase
-
+
auction.test
#{contacts(:john).code}
@@ -84,7 +84,7 @@ class EppDomainCreateAuctionTest < EppTestCase
-
+
auction.test
#{contacts(:john).code}
@@ -120,7 +120,7 @@ class EppDomainCreateAuctionTest < EppTestCase
-
+
auction.test
#{contacts(:john).code}
@@ -150,7 +150,7 @@ class EppDomainCreateAuctionTest < EppTestCase
-
+
auction.test
#{contacts(:john).code}
@@ -182,7 +182,7 @@ class EppDomainCreateAuctionTest < EppTestCase
-
+
auction.test
#{contacts(:john).code}
@@ -214,7 +214,7 @@ class EppDomainCreateAuctionTest < EppTestCase
-
+
auction.test
diff --git a/test/integration/epp/domain/create/base_test.rb b/test/integration/epp/domain/create/base_test.rb
index fbfd1e15b..914a6352a 100644
--- a/test/integration/epp/domain/create/base_test.rb
+++ b/test/integration/epp/domain/create/base_test.rb
@@ -17,7 +17,7 @@ class EppDomainCreateBaseTest < EppTestCase
-
+
#{name}
#{registrant.code}
@@ -56,7 +56,7 @@ class EppDomainCreateBaseTest < EppTestCase
-
+
#{name}
#{registrant.code}
@@ -89,7 +89,7 @@ class EppDomainCreateBaseTest < EppTestCase
-
+
#{name}
#{registrant.code}
@@ -125,7 +125,7 @@ class EppDomainCreateBaseTest < EppTestCase
-
+
#{name}
#{registrant.code}
@@ -161,7 +161,7 @@ class EppDomainCreateBaseTest < EppTestCase
-
+
#{name}
#{registrant.code}
@@ -190,7 +190,7 @@ class EppDomainCreateBaseTest < EppTestCase
-
+
#{name}
#{registrant.code}
#{contacts(:jane).code}
@@ -226,7 +226,7 @@ class EppDomainCreateBaseTest < EppTestCase
-
+
#{name}
#{registrant.code}
#{contact.code}
@@ -264,7 +264,7 @@ class EppDomainCreateBaseTest < EppTestCase
-
+
#{name}
#{registrant.code}
#{contact.code}
@@ -301,7 +301,7 @@ class EppDomainCreateBaseTest < EppTestCase
-
+
#{name}
#{registrant.code}
#{contact.code}
@@ -339,7 +339,7 @@ class EppDomainCreateBaseTest < EppTestCase
-
+
#{name}
#{registrant.code}
#{contact.code}
@@ -377,7 +377,7 @@ class EppDomainCreateBaseTest < EppTestCase
-
+
#{name}
#{registrant.code}
#{contact_two.code}
@@ -414,7 +414,7 @@ class EppDomainCreateBaseTest < EppTestCase
-
+
#{name}
#{registrant.code}
@@ -462,7 +462,7 @@ class EppDomainCreateBaseTest < EppTestCase
-
+
#{name}
#{registrant.code}
@@ -498,7 +498,7 @@ class EppDomainCreateBaseTest < EppTestCase
-
+
#{name}
#{registrant.code}
@@ -532,7 +532,7 @@ class EppDomainCreateBaseTest < EppTestCase
-
+
#{reserved_domain.name}
#{contacts(:john).code}
@@ -568,7 +568,7 @@ class EppDomainCreateBaseTest < EppTestCase
-
+
#{name}
#{contacts(:john).code}
@@ -601,7 +601,7 @@ class EppDomainCreateBaseTest < EppTestCase
-
+
#{blocked_domain}
#{contacts(:john).code}
@@ -631,7 +631,7 @@ class EppDomainCreateBaseTest < EppTestCase
-
+