mirror of
https://github.com/internetee/registry.git
synced 2025-05-17 17:59:47 +02:00
Merge branch 'experimental-live-schema-support'
This commit is contained in:
commit
48af3e77cd
65 changed files with 1346 additions and 1205 deletions
2
Gemfile
2
Gemfile
|
@ -82,7 +82,7 @@ gem 'digidoc_client', '~> 0.2.1'
|
|||
|
||||
# epp
|
||||
gem 'epp', '~> 1.4.2', github: 'internetee/epp'
|
||||
gem 'epp-xml', '~> 1.0.3' # EIS EPP XMLs
|
||||
gem 'epp-xml', '~> 1.0.4' # EIS EPP XMLs
|
||||
gem 'uuidtools', '~> 2.1.4' # For unique IDs (used by the epp gem)
|
||||
|
||||
# que
|
||||
|
|
|
@ -177,7 +177,7 @@ GEM
|
|||
nokogiri (>= 1.4.0)
|
||||
savon (>= 2.4.0)
|
||||
docile (1.1.5)
|
||||
epp-xml (1.0.3)
|
||||
epp-xml (1.0.4)
|
||||
activesupport (~> 4.1)
|
||||
builder (~> 3.2)
|
||||
equalizer (0.0.11)
|
||||
|
@ -564,7 +564,7 @@ DEPENDENCIES
|
|||
devise (~> 3.5.1)
|
||||
digidoc_client (~> 0.2.1)
|
||||
epp (~> 1.4.2)!
|
||||
epp-xml (~> 1.0.3)
|
||||
epp-xml (~> 1.0.4)
|
||||
fabrication (~> 2.13.2)
|
||||
faker (~> 1.4.3)
|
||||
figaro (~> 1.1.1)
|
||||
|
|
|
@ -75,8 +75,8 @@ class Epp::SessionsController < EppController
|
|||
end
|
||||
|
||||
if success
|
||||
if parsed_frame.css('newPW').first
|
||||
unless @api_user.update(password: parsed_frame.css('newPW').first.text)
|
||||
if params[:parsed_frame].css('newPW').first
|
||||
unless @api_user.update(password: params[:parsed_frame].css('newPW').first.text)
|
||||
response.headers['X-EPP-Returncode'] = '2500'
|
||||
handle_errors(@api_user) and return
|
||||
end
|
||||
|
@ -124,11 +124,8 @@ class Epp::SessionsController < EppController
|
|||
### HELPER METHODS ###
|
||||
|
||||
def login_params
|
||||
ph = params_hash['epp']['command']['login']
|
||||
{ username: ph[:clID], password: ph[:pw] }
|
||||
end
|
||||
|
||||
def parsed_frame
|
||||
@parsed_frame ||= Nokogiri::XML(request.params[:raw_frame]).remove_namespaces!
|
||||
user = params[:parsed_frame].css('clID').first.text
|
||||
pw = params[:parsed_frame].css('pw').first.text
|
||||
{ username: user, password: pw }
|
||||
end
|
||||
end
|
||||
|
|
|
@ -6,6 +6,20 @@ class EppController < ApplicationController
|
|||
|
||||
before_action :generate_svtrid
|
||||
before_action :latin_only
|
||||
|
||||
before_action :validate_against_schema
|
||||
def validate_against_schema
|
||||
return if ['hello', 'error', 'keyrelay'].include?(params[:action])
|
||||
schema.validate(params[:nokogiri_frame]).each do |error|
|
||||
epp_errors << {
|
||||
code: 2001,
|
||||
msg: error
|
||||
}
|
||||
end
|
||||
|
||||
handle_errors and return if epp_errors.any?
|
||||
end
|
||||
|
||||
before_action :validate_request
|
||||
before_action :update_epp_session
|
||||
|
||||
|
@ -58,6 +72,13 @@ class EppController < ApplicationController
|
|||
render_epp_response '/epp/error'
|
||||
end
|
||||
|
||||
def schema
|
||||
# TODO: Support multiple schemas
|
||||
return DOMAIN_SCHEMA if params[:epp_object_type] == :domain
|
||||
return CONTACT_SCHEMA if params[:epp_object_type] == :contact
|
||||
EPP_SCHEMA
|
||||
end
|
||||
|
||||
def generate_svtrid
|
||||
# rubocop: disable Style/VariableName
|
||||
@svTRID = "ccReg-#{format('%010d', rand(10**10))}"
|
||||
|
|
|
@ -16,6 +16,7 @@ class ApiUser < User
|
|||
has_many :certificates
|
||||
|
||||
validates :username, :password, :registrar, :roles, presence: true
|
||||
validates :password, length: { minimum: 6 }
|
||||
validates :username, uniqueness: true
|
||||
|
||||
# TODO: probably cache, because it's requested on every EPP
|
||||
|
|
|
@ -145,25 +145,26 @@ module Depp
|
|||
end
|
||||
|
||||
def save
|
||||
create_xml = Depp::Contact.epp_xml.create(
|
||||
{
|
||||
id: { value: code },
|
||||
email: { value: email },
|
||||
voice: { value: phone },
|
||||
postalInfo: {
|
||||
name: { value: name },
|
||||
org: { value: org_name },
|
||||
addr: {
|
||||
street: { value: street },
|
||||
city: { value: city },
|
||||
pc: { value: zip },
|
||||
sp: { value: state },
|
||||
cc: { value: country_code }
|
||||
}
|
||||
hash = {
|
||||
id: { value: code },
|
||||
postalInfo: {
|
||||
name: { value: name },
|
||||
org: { value: org_name },
|
||||
addr: {
|
||||
street: { value: street },
|
||||
city: { value: city },
|
||||
sp: { value: state },
|
||||
pc: { value: zip },
|
||||
cc: { value: country_code }
|
||||
}
|
||||
},
|
||||
extension_xml
|
||||
)
|
||||
voice: { value: phone },
|
||||
email: { value: email }
|
||||
}
|
||||
|
||||
hash[:id] = nil if code.blank?
|
||||
create_xml = Depp::Contact.epp_xml.create(hash, extension_xml)
|
||||
|
||||
data = Depp::Contact.user.request(create_xml)
|
||||
self.id = data.css('id').text
|
||||
handle_errors(data)
|
||||
|
@ -191,23 +192,23 @@ module Depp
|
|||
{
|
||||
id: { value: id },
|
||||
chg: {
|
||||
voice: { value: phone },
|
||||
email: { value: email },
|
||||
postalInfo: {
|
||||
name: { value: name },
|
||||
org: { value: org_name },
|
||||
addr: {
|
||||
street: { value: street },
|
||||
city: { value: city },
|
||||
pc: { value: zip },
|
||||
sp: { value: state },
|
||||
pc: { value: zip },
|
||||
cc: { value: country_code }
|
||||
}
|
||||
},
|
||||
voice: { value: phone },
|
||||
email: { value: email },
|
||||
authInfo: {
|
||||
pw: { value: password }
|
||||
}
|
||||
},
|
||||
authInfo: {
|
||||
pw: { value: password }
|
||||
}
|
||||
},
|
||||
extension_xml
|
||||
)
|
||||
|
|
|
@ -36,15 +36,17 @@ module Depp
|
|||
end
|
||||
|
||||
def create(domain_params)
|
||||
dns_hash = {}
|
||||
keys = Domain.create_dnskeys_hash(domain_params)
|
||||
dns_hash[:_anonymus] = keys if keys.any?
|
||||
|
||||
xml = epp_xml.create({
|
||||
name: { value: domain_params[:name] },
|
||||
registrant: { value: domain_params[:registrant] },
|
||||
period: { value: domain_params[:period].to_s[0], attrs: { unit: domain_params[:period].to_s[1] } },
|
||||
ns: Domain.create_nameservers_hash(domain_params),
|
||||
registrant: { value: domain_params[:registrant] },
|
||||
_anonymus: Domain.create_contacts_hash(domain_params)
|
||||
}, {
|
||||
_anonymus: Domain.create_dnskeys_hash(domain_params)
|
||||
}, Domain.construct_custom_params_hash(domain_params))
|
||||
}, dns_hash, Domain.construct_custom_params_hash(domain_params))
|
||||
|
||||
current_user.request(xml)
|
||||
end
|
||||
|
@ -205,6 +207,16 @@ module Depp
|
|||
contacts = array_difference(create_contacts_hash(old_domain_params), create_contacts_hash(domain_params))
|
||||
rem_anon = contacts
|
||||
|
||||
add_arr = []
|
||||
add_ns = create_nameservers_hash(domain_params) - create_nameservers_hash(old_domain_params)
|
||||
add_arr << { ns: add_ns } if add_ns.any?
|
||||
add_arr << { _anonymus: add_anon } if add_anon.any?
|
||||
|
||||
rem_arr = []
|
||||
rem_ns = create_nameservers_hash(old_domain_params) - create_nameservers_hash(domain_params)
|
||||
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] } }]
|
||||
end
|
||||
|
@ -212,22 +224,18 @@ module Depp
|
|||
{
|
||||
name: { value: domain_params[:name] },
|
||||
chg: chg,
|
||||
add: [
|
||||
{ ns: create_nameservers_hash(domain_params) - create_nameservers_hash(old_domain_params) },
|
||||
{ _anonymus: add_anon }
|
||||
],
|
||||
rem: [
|
||||
{ ns: create_nameservers_hash(old_domain_params) - create_nameservers_hash(domain_params) },
|
||||
{ _anonymus: rem_anon }
|
||||
]
|
||||
add: add_arr,
|
||||
rem: rem_arr
|
||||
}
|
||||
end
|
||||
|
||||
def construct_ext_edit_hash(domain_params, old_domain_params)
|
||||
{
|
||||
add: create_dnskeys_hash(domain_params) - create_dnskeys_hash(old_domain_params),
|
||||
rem: create_dnskeys_hash(old_domain_params) - create_dnskeys_hash(domain_params)
|
||||
}
|
||||
rem_keys = create_dnskeys_hash(old_domain_params) - create_dnskeys_hash(domain_params)
|
||||
add_keys = create_dnskeys_hash(domain_params) - create_dnskeys_hash(old_domain_params)
|
||||
hash = {}
|
||||
hash[:rem] = rem_keys if rem_keys.any?
|
||||
hash[:add] = add_keys if add_keys.any?
|
||||
hash
|
||||
end
|
||||
|
||||
def create_nameservers_hash(domain_params)
|
||||
|
|
|
@ -5,7 +5,7 @@ xml.epp_head do
|
|||
end
|
||||
|
||||
xml.resData do
|
||||
xml.tag!('contact:chkData', 'xmlns:contact' => 'https://raw.githubusercontent.com/internetee/registry/alpha/doc/schemas/contact-eis-1.0.xsd') do
|
||||
xml.tag!('contact:chkData', 'xmlns:contact' => 'https://epp.tld.ee/schema/contact-eis-1.0.xsd') do
|
||||
@results.each do |result|
|
||||
xml.tag!('contact:cd') do
|
||||
xml.tag! "contact:id", result[:code], avail: result[:avail]
|
||||
|
|
|
@ -5,7 +5,7 @@ xml.epp_head do
|
|||
end
|
||||
|
||||
xml.resData do
|
||||
xml.tag!('contact:creData', 'xmlns:contact' => 'https://raw.githubusercontent.com/internetee/registry/alpha/doc/schemas/contact-eis-1.0.xsd') do
|
||||
xml.tag!('contact:creData', 'xmlns:contact' => 'https://epp.tld.ee/schema/contact-eis-1.0.xsd') do
|
||||
xml.tag!('contact:id', @contact.code)
|
||||
xml.tag!('contact:crDate', @contact.created_at.try(:iso8601))
|
||||
end
|
||||
|
|
|
@ -5,7 +5,7 @@ xml.epp_head do
|
|||
end
|
||||
|
||||
xml.resData do
|
||||
xml.tag!('contact:infData', 'xmlns:contact' => 'https://raw.githubusercontent.com/internetee/registry/alpha/doc/schemas/contact-eis-1.0.xsd') do
|
||||
xml.tag!('contact:infData', 'xmlns:contact' => 'https://epp.tld.ee/schema/contact-eis-1.0.xsd') do
|
||||
xml.tag!('contact:id', @contact.code)
|
||||
xml.tag!('contact:roid', @contact.roid)
|
||||
|
||||
|
@ -55,7 +55,7 @@ xml.epp_head do
|
|||
end
|
||||
if can? :view_full_info, @contact, @password
|
||||
xml.tag!('extension') do
|
||||
xml.tag!('eis:extdata', 'xmlns:eis' => 'https://raw.githubusercontent.com/internetee/registry/alpha/doc/schemas/eis-1.0.xsd') do
|
||||
xml.tag!('eis:extdata', 'xmlns:eis' => 'https://epp.tld.ee/schema/eis-1.0.xsd') do
|
||||
xml.tag!('eis:ident', @contact.ident,
|
||||
type: @contact.ident_type, cc: @contact.ident_country_code)
|
||||
end
|
||||
|
|
|
@ -5,7 +5,7 @@ xml.epp_head do
|
|||
end
|
||||
|
||||
xml.resData do
|
||||
xml.tag!('contact:creData', 'xmlns:contact' => 'https://raw.githubusercontent.com/internetee/registry/alpha/doc/schemas/contact-eis-1.0.xsd') do
|
||||
xml.tag!('contact:creData', 'xmlns:contact' => 'https://epp.tld.ee/schema/contact-eis-1.0.xsd') do
|
||||
xml.tag!('contact:id', @contact.code)
|
||||
xml.tag!('contact:crDate', @contact.created_at.try(:iso8601))
|
||||
end
|
||||
|
|
|
@ -5,7 +5,7 @@ xml.epp_head do
|
|||
end
|
||||
|
||||
xml.resData do
|
||||
xml.tag!('domain:chkData', 'xmlns:domain' => 'https://raw.githubusercontent.com/internetee/registry/alpha/doc/schemas/domain-eis-1.0.xsd') do
|
||||
xml.tag!('domain:chkData', 'xmlns:domain' => 'https://epp.tld.ee/schema/domain-eis-1.0.xsd') do
|
||||
@domains.each do |x|
|
||||
xml.tag!('domain:cd') do
|
||||
xml.tag!('domain:name', x[:name], 'avail' => x[:avail])
|
||||
|
|
|
@ -5,7 +5,7 @@ xml.epp_head do
|
|||
end
|
||||
|
||||
xml.resData do
|
||||
xml.tag!('domain:creData', 'xmlns:domain' => 'https://raw.githubusercontent.com/internetee/registry/alpha/doc/schemas/domain-eis-1.0.xsd') do
|
||||
xml.tag!('domain:creData', 'xmlns:domain' => 'https://epp.tld.ee/schema/domain-eis-1.0.xsd') do
|
||||
xml.tag!('domain:name', @domain.name)
|
||||
xml.tag!('domain:crDate', @domain.created_at.try(:iso8601))
|
||||
xml.tag!('domain:exDate', @domain.valid_to.try(:iso8601))
|
||||
|
|
|
@ -5,7 +5,7 @@ xml.epp_head do
|
|||
end
|
||||
|
||||
xml.resData do
|
||||
xml.tag!('domain:infData', 'xmlns:domain' => 'https://raw.githubusercontent.com/internetee/registry/alpha/doc/schemas/domain-eis-1.0.xsd') do
|
||||
xml.tag!('domain:infData', 'xmlns:domain' => 'https://epp.tld.ee/schema/domain-eis-1.0.xsd') do
|
||||
xml.tag!('domain:name', @domain.name)
|
||||
xml.tag!('domain:roid', @domain.roid)
|
||||
@domain.statuses.each do |s|
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
builder.tag!('domain:trnData', 'xmlns:domain' => 'https://raw.githubusercontent.com/internetee/registry/alpha/doc/schemas/domain-eis-1.0.xsd') do
|
||||
builder.tag!('domain:trnData', 'xmlns:domain' => 'https://epp.tld.ee/schema/domain-eis-1.0.xsd') do
|
||||
builder.tag!('domain:name', dt.domain_name)
|
||||
builder.tag!('domain:trStatus', dt.status)
|
||||
builder.tag!('domain:reID', dt.transfer_to.code)
|
||||
|
|
|
@ -5,7 +5,7 @@ xml.epp_head do
|
|||
end
|
||||
|
||||
xml.resData do
|
||||
xml.tag!('domain:renData', 'xmlns:domain' => 'https://raw.githubusercontent.com/internetee/registry/alpha/doc/schemas/domain-eis-1.0.xsd') do
|
||||
xml.tag!('domain:renData', 'xmlns:domain' => 'https://epp.tld.ee/schema/domain-eis-1.0.xsd') do
|
||||
xml.tag!('domain:name', @domain[:name])
|
||||
xml.tag!('domain:exDate', @domain.valid_to.try(:iso8601))
|
||||
end
|
||||
|
|
|
@ -2,7 +2,7 @@ xml.instruct!(:xml, standalone: 'no')
|
|||
xml.epp(
|
||||
'xmlns' => 'urn:ietf:params:xml:ns:epp-1.0',
|
||||
'xmlns:secDNS' => 'urn:ietf:params:xml:ns:secDNS-1.1',
|
||||
'xmlns:domain' => 'https://raw.githubusercontent.com/internetee/registry/alpha/doc/schemas/domain-eis-1.0.xsd',
|
||||
'xmlns:domain' => 'https://epp.tld.ee/schema/domain-eis-1.0.xsd',
|
||||
'xmlns:keyrelay' => 'urn:ietf:params:xml:ns:keyrelay-1.0'
|
||||
) do
|
||||
xml.response do
|
||||
|
|
|
@ -5,13 +5,13 @@ xml.epp_head do
|
|||
xml.svcMenu do
|
||||
xml.version '1.0'
|
||||
xml.lang 'en'
|
||||
xml.objURI 'https://raw.githubusercontent.com/internetee/registry/alpha/doc/schemas/domain-eis-1.0.xsd'
|
||||
xml.objURI 'https://raw.githubusercontent.com/internetee/registry/alpha/doc/schemas/contact-eis-1.0.xsd'
|
||||
xml.objURI 'https://epp.tld.ee/schema/domain-eis-1.0.xsd'
|
||||
xml.objURI 'https://epp.tld.ee/schema/contact-eis-1.0.xsd'
|
||||
xml.objURI 'urn:ietf:params:xml:ns:host-1.0'
|
||||
xml.objURI 'urn:ietf:params:xml:ns:keyrelay-1.0'
|
||||
xml.svcExtension do
|
||||
xml.extURI 'urn:ietf:params:xml:ns:secDNS-1.1'
|
||||
xml.extURI 'https://raw.githubusercontent.com/internetee/registry/alpha/doc/schemas/eis-1.0.xsd'
|
||||
xml.extURI 'https://epp.tld.ee/schema/eis-1.0.xsd'
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
<command>
|
||||
<check>
|
||||
<contact:check
|
||||
xmlns:contact="https://raw.githubusercontent.com/internetee/registry/alpha/doc/schemas/contact-eis-1.0.xsd">
|
||||
xmlns:contact="https://epp.tld.ee/schema/contact-eis-1.0.xsd">
|
||||
<contact:id>sh8013</contact:id>
|
||||
</contact:check>
|
||||
</check>
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
<command>
|
||||
<check>
|
||||
<contact:check
|
||||
xmlns:contact="https://raw.githubusercontent.com/internetee/registry/alpha/doc/schemas/contact-eis-1.0.xsd">
|
||||
xmlns:contact="https://epp.tld.ee/schema/contact-eis-1.0.xsd">
|
||||
<contact:id>sh8013</contact:id>
|
||||
<contact:id>sh13</contact:id>
|
||||
<contact:id>vsdfvq</contact:id>
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<epp xmlns="urn:ietf:params:xml:ns:epp-1.0">
|
||||
<command>
|
||||
<create>
|
||||
<contact:create xmlns:contact="https://raw.githubusercontent.com/internetee/registry/alpha/doc/schemas/contact-eis-1.0.xsd">
|
||||
<contact:create xmlns:contact="https://epp.tld.ee/schema/contact-eis-1.0.xsd">
|
||||
<contact:postalInfo>
|
||||
<contact:name>Sillius Soddus</contact:name>
|
||||
<contact:addr>
|
||||
|
@ -20,7 +20,7 @@
|
|||
</contact:create>
|
||||
</create>
|
||||
<extension>
|
||||
<eis:extdata xmlns:eis="https://raw.githubusercontent.com/internetee/registry/alpha/doc/schemas/eis-1.0.xsd">
|
||||
<eis:extdata xmlns:eis="https://epp.tld.ee/schema/eis-1.0.xsd">
|
||||
<eis:ident type="bic" cc="EE">123</eis:ident>
|
||||
<eis:legalDocument type="pdf">
|
||||
JVBERi0xLjQKJcOkw7zDtsOfCjIgMCBvYmoKPDwvTGVuZ3RoIDMgMCBSL0Zp==
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
<command>
|
||||
<delete>
|
||||
<contact:delete
|
||||
xmlns:contact="https://raw.githubusercontent.com/internetee/registry/alpha/doc/schemas/contact-eis-1.0.xsd">
|
||||
xmlns:contact="https://epp.tld.ee/schema/contact-eis-1.0.xsd">
|
||||
<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://raw.githubusercontent.com/internetee/registry/alpha/doc/schemas/eis-1.0.xsd">
|
||||
<eis:extdata xmlns:eis="https://epp.tld.ee/schema/eis-1.0.xsd">
|
||||
<eis:legalDocument type="pdf">
|
||||
JVBERi0xLjQKJcOkw7zDtsOfCjIgMCBvYmoKPDwvTGVuZ3RoIDMgMCBSL0Zp==
|
||||
</eis:legalDocument>
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<epp xmlns="urn:ietf:params:xml:ns:epp-1.0">
|
||||
<command>
|
||||
<info>
|
||||
<contact:info xmlns:contact="https://raw.githubusercontent.com/internetee/registry/alpha/doc/schemas/contact-eis-1.0.xsd">
|
||||
<contact:info xmlns:contact="https://epp.tld.ee/schema/contact-eis-1.0.xsd">
|
||||
<contact:id>sh8013</contact:id>
|
||||
<contact:authInfo>
|
||||
<contact:pw>Aas34fq</contact:pw>
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<epp xmlns="urn:ietf:params:xml:ns:epp-1.0">
|
||||
<command>
|
||||
<update>
|
||||
<contact:update xmlns:contact="https://raw.githubusercontent.com/internetee/registry/alpha/doc/schemas/contact-eis-1.0.xsd">
|
||||
<contact:update xmlns:contact="https://epp.tld.ee/schema/contact-eis-1.0.xsd">
|
||||
<contact:id>sh8013</contact:id>
|
||||
<contact:chg>
|
||||
<contact:postalInfo>
|
||||
|
@ -25,7 +25,7 @@
|
|||
</contact:update>
|
||||
</update>
|
||||
<extension>
|
||||
<eis:extdata xmlns:eis="https://raw.githubusercontent.com/internetee/registry/alpha/doc/schemas/eis-1.0.xsd">
|
||||
<eis:extdata xmlns:eis="https://epp.tld.ee/schema/eis-1.0.xsd">
|
||||
<eis:legalDocument type="pdf">
|
||||
JVBERi0xLjQKJcOkw7zDtsOfCjIgMCBvYmoKPDwvTGVuZ3RoIDMgMCBSL0Zp==
|
||||
</eis:legalDocument>
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
<command>
|
||||
<check>
|
||||
<domain:check
|
||||
xmlns:domain="https://raw.githubusercontent.com/internetee/registry/alpha/doc/schemas/domain-eis-1.0.xsd">
|
||||
xmlns:domain="https://epp.tld.ee/schema/domain-eis-1.0.xsd">
|
||||
<domain:name>example.ee</domain:name>
|
||||
</domain:check>
|
||||
</check>
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
<command>
|
||||
<create>
|
||||
<domain:create
|
||||
xmlns:domain="https://raw.githubusercontent.com/internetee/registry/alpha/doc/schemas/domain-eis-1.0.xsd">
|
||||
xmlns:domain="https://epp.tld.ee/schema/domain-eis-1.0.xsd">
|
||||
<domain:name>example.ee</domain:name>
|
||||
<domain:period unit="y">1</domain:period>
|
||||
<domain:ns>
|
||||
|
@ -33,7 +33,7 @@
|
|||
</secDNS:create>
|
||||
</extension>
|
||||
<extension>
|
||||
<eis:extdata xmlns:eis="https://raw.githubusercontent.com/internetee/registry/alpha/doc/schemas/eis-1.0.xsd">
|
||||
<eis:extdata xmlns:eis="https://epp.tld.ee/schema/eis-1.0.xsd">
|
||||
<eis:legalDocument type="pdf">
|
||||
JVBERi0xLjQKJcOkw7zDtsOfCjIgMCBvYmoKPDwvTGVuZ3RoIDMgMCBSL0Zp==
|
||||
</eis:legalDocument>
|
||||
|
|
|
@ -3,12 +3,12 @@
|
|||
<command>
|
||||
<delete>
|
||||
<domain:delete
|
||||
xmlns:domain="https://raw.githubusercontent.com/internetee/registry/alpha/doc/schemas/domain-eis-1.0.xsd">
|
||||
xmlns:domain="https://epp.tld.ee/schema/domain-eis-1.0.xsd">
|
||||
<domain:name>example.ee</domain:name>
|
||||
</domain:delete>
|
||||
</delete>
|
||||
<extension>
|
||||
<eis:extdata xmlns:eis="https://raw.githubusercontent.com/internetee/registry/alpha/doc/schemas/eis-1.0.xsd">
|
||||
<eis:extdata xmlns:eis="https://epp.tld.ee/schema/eis-1.0.xsd">
|
||||
<eis:legalDocument type="pdf">
|
||||
JVBERi0xLjQKJcOkw7zDtsOfCjIgMCBvYmoKPDwvTGVuZ3RoIDMgMCBSL0Zp==
|
||||
</eis:legalDocument>
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
<command>
|
||||
<info>
|
||||
<domain:info
|
||||
xmlns:domain="https://raw.githubusercontent.com/internetee/registry/alpha/doc/schemas/domain-eis-1.0.xsd">
|
||||
xmlns:domain="https://epp.tld.ee/schema/domain-eis-1.0.xsd">
|
||||
<domain:name hosts="all">example.ee</domain:name>
|
||||
<domain:authInfo>
|
||||
<domain:pw>2fooBAR</domain:pw>
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
<command>
|
||||
<renew>
|
||||
<domain:renew
|
||||
xmlns:domain="https://raw.githubusercontent.com/internetee/registry/alpha/doc/schemas/domain-eis-1.0.xsd">
|
||||
xmlns:domain="https://epp.tld.ee/schema/domain-eis-1.0.xsd">
|
||||
<domain:name>example.ee</domain:name>
|
||||
<domain:curExpDate>2014-08-07</domain:curExpDate>
|
||||
<domain:period unit="y">1</domain:period>
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
<command>
|
||||
<transfer op="query">
|
||||
<domain:transfer
|
||||
xmlns:domain="https://raw.githubusercontent.com/internetee/registry/alpha/doc/schemas/domain-eis-1.0.xsd">
|
||||
xmlns:domain="https://epp.tld.ee/schema/domain-eis-1.0.xsd">
|
||||
<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://raw.githubusercontent.com/internetee/registry/alpha/doc/schemas/eis-1.0.xsd">
|
||||
<eis:extdata xmlns:eis="https://epp.tld.ee/schema/eis-1.0.xsd">
|
||||
<eis:legalDocument type="pdf">
|
||||
JVBERi0xLjQKJcOkw7zDtsOfCjIgMCBvYmoKPDwvTGVuZ3RoIDMgMCBSL0Zp==
|
||||
</eis:legalDocument>
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
<command>
|
||||
<update>
|
||||
<domain:update
|
||||
xmlns:domain="https://raw.githubusercontent.com/internetee/registry/alpha/doc/schemas/domain-eis-1.0.xsd">
|
||||
xmlns:domain="https://epp.tld.ee/schema/domain-eis-1.0.xsd">
|
||||
<domain:name>example.ee</domain:name>
|
||||
<domain:chg>
|
||||
<domain:registrant>mak21</domain:registrant>
|
||||
|
@ -37,7 +37,7 @@
|
|||
</secDNS:update>
|
||||
</extension>
|
||||
<extension>
|
||||
<eis:extdata xmlns:eis="https://raw.githubusercontent.com/internetee/registry/alpha/doc/schemas/eis-1.0.xsd">
|
||||
<eis:extdata xmlns:eis="https://epp.tld.ee/schema/eis-1.0.xsd">
|
||||
<eis:legalDocument type="pdf">
|
||||
JVBERi0xLjQKJcOkw7zDtsOfCjIgMCBvYmoKPDwvTGVuZ3RoIDMgMCBSL0Zp==
|
||||
</eis:legalDocument>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<epp xmlns="urn:ietf:params:xml:ns:epp-1.0" xmlns:secDNS="urn:ietf:params:xml:ns:secDNS-1.1" xmlns:domain="https://raw.githubusercontent.com/internetee/registry/alpha/doc/schemas/domain-eis-1.0.xsd" xmlns:ext="urn:ietf:params:xml:ns:keyrelay-1.0">
|
||||
<epp xmlns="urn:ietf:params:xml:ns:epp-1.0" xmlns:secDNS="urn:ietf:params:xml:ns:secDNS-1.1" xmlns:domain="https://epp.tld.ee/schema/domain-eis-1.0.xsd" xmlns:ext="urn:ietf:params:xml:ns:keyrelay-1.0">
|
||||
<command>
|
||||
<ext:keyrelay>
|
||||
<ext:name>example6.ee</ext:name>
|
||||
|
@ -16,7 +16,7 @@
|
|||
<ext:relative>P1D</ext:relative>
|
||||
</ext:expiry>
|
||||
</ext:keyrelay>
|
||||
<eis:extdata xmlns:eis="https://raw.githubusercontent.com/internetee/registry/alpha/doc/schemas/eis-1.0.xsd">
|
||||
<eis:extdata xmlns:eis="https://epp.tld.ee/schema/eis-1.0.xsd">
|
||||
<eis:legalDocument type="pdf">JVBERi0xLjQKJcOkw7zDtsOfCjIgMCBvYmoKPDwvTGVuZ3RoIDMgMCBSL0Zp==</eis:legalDocument>
|
||||
</eis:extdata>
|
||||
<ext:clTRID>1422542244</ext:clTRID>
|
||||
|
|
3
config/initializers/load_schemas.rb
Normal file
3
config/initializers/load_schemas.rb
Normal file
|
@ -0,0 +1,3 @@
|
|||
EPP_SCHEMA = Nokogiri::XML::Schema(File.read("lib/schemas/epp-1.0.xsd"))
|
||||
DOMAIN_SCHEMA = Nokogiri::XML::Schema(File.read("lib/schemas/domain-eis-1.0.xsd"))
|
||||
CONTACT_SCHEMA = Nokogiri::XML::Schema(File.read("lib/schemas/contact-eis-1.0.xsd"))
|
|
@ -2,15 +2,15 @@ require 'epp_constraint'
|
|||
|
||||
Rails.application.routes.draw do
|
||||
namespace(:epp, defaults: { format: :xml }) do
|
||||
match 'session/:action', controller: 'sessions', via: :all
|
||||
match 'session/pki/:action', controller: 'sessions', via: :all
|
||||
match 'session/:action', controller: 'sessions', via: :all, constraints: EppConstraint.new(:session)
|
||||
match 'session/pki/:action', controller: 'sessions', via: :all, constraints: EppConstraint.new(:session)
|
||||
|
||||
post 'command/:action', controller: 'domains', constraints: EppConstraint.new(:domain)
|
||||
post 'command/:action', controller: 'contacts', constraints: EppConstraint.new(:contact)
|
||||
post 'command/poll', to: 'polls#poll', constraints: EppConstraint.new(:poll)
|
||||
post 'command/keyrelay', to: 'keyrelays#keyrelay', constraints: EppConstraint.new(:keyrelay)
|
||||
|
||||
post 'command/:command', to: 'errors#not_found' # fallback route
|
||||
post 'command/:command', to: 'errors#not_found', constraints: EppConstraint.new(:not_found) # fallback route
|
||||
|
||||
get 'error/:command', to: 'errors#error'
|
||||
end
|
||||
|
|
|
@ -16,15 +16,11 @@ Our implementation supports following protocols:
|
|||
[RFC5910 - DNSSEC Mapping](http://tools.ietf.org/html/rfc5910)
|
||||
[RFC3735 - Guidelines for Extending the EPP](http://tools.ietf.org/html/rfc3735)
|
||||
|
||||
Related XML Schema Definitions (may differ from policies applied to registry):
|
||||
EIS specific XML Schema Definitions (may differ from policies applied to registry):
|
||||
|
||||
[contact-eis-1.0.xsd](schemas/contact-eis-1.0.xsd)
|
||||
[domain-eis-1.0.xsd](schemas/domain-eis-1.0.xsd)
|
||||
[eis-1.0.xsd](schemas/eis-1.0.xsd)
|
||||
[epp-1.0.xsd](schemas/epp-1.0.xsd)
|
||||
[eppcom-1.0.xsd](schemas/eppcom-1.0.xsd)
|
||||
[host-1.0.xsd](schemas/host-1.0.xsd)
|
||||
[secDNS-1.1.xsd](schemas/secDNS-1.1.xsd)
|
||||
|
||||
More info about The Extensible Provisioning Protocol (EPP):<br>
|
||||
http://en.wikipedia.org/wiki/Extensible_Provisioning_Protocol
|
||||
|
|
1044
doc/epp-examples.md
1044
doc/epp-examples.md
File diff suppressed because it is too large
Load diff
|
@ -12,7 +12,7 @@ Contact Mapping protocol short version:
|
|||
Field name Min-max Field description
|
||||
----------------------- ------- -----------------
|
||||
<create> 1
|
||||
<contact:create> 1 Attribute: xmlns:contact="https://raw.githubusercontent.com/internetee/registry/alpha/doc/schemas/contact-eis-1.0.xsd"
|
||||
<contact:create> 1 Attribute: xmlns:contact="https://epp.tld.ee/schema/contact-eis-1.0.xsd"
|
||||
<contact:id> 0-1 Contact id, optional, string, no spaces, max 100 characters,
|
||||
generated automatically if missing
|
||||
<contact:postalInfo> 1 Postal information container
|
||||
|
@ -27,7 +27,7 @@ Contact Mapping protocol short version:
|
|||
<contact:voice> 1 Phone number in format \+ddd.d+
|
||||
<contact:email> 1 E-mail
|
||||
<extension> 1
|
||||
<eis:extdata> 1 Attribute: xmlns:eis="https://raw.githubusercontent.com/internetee/registry/alpha/doc/schemas/eis-1.0.xsd"
|
||||
<eis:extdata> 1 Attribute: xmlns:eis="https://epp.tld.ee/schema/eis-1.0.xsd"
|
||||
<eis:ident> 1 Contact identificator
|
||||
Attribute: "type"
|
||||
"bic" # Business registry code
|
||||
|
@ -46,7 +46,7 @@ Contact Mapping protocol short version:
|
|||
Field name Min-max Field description
|
||||
----------------------- ------- -----------------
|
||||
<update> 1
|
||||
<contact:update> 1 Attribute: xmlns:contact="https://raw.githubusercontent.com/internetee/registry/alpha/doc/schemas/contact-eis-1.0.xsd"
|
||||
<contact:update> 1 Attribute: xmlns:contact="https://epp.tld.ee/schema/contact-eis-1.0.xsd"
|
||||
<contact:id> 1 Contact id, required
|
||||
<contact:chg> 1 Change container
|
||||
<contact:postalInfo> 1 Postal information container
|
||||
|
@ -63,7 +63,7 @@ Contact Mapping protocol short version:
|
|||
<contact:authInfo> 0-1 Required if registrar is not the owner of the contact.
|
||||
<contact:pw> 1 Contact password. Attribute: roid="String"
|
||||
<extension> 0-1
|
||||
<eis:extdata> 0-1 Attribute: xmlns:eis="https://raw.githubusercontent.com/internetee/registry/alpha/doc/schemas/eis-1.0.xsd"
|
||||
<eis:extdata> 0-1 Attribute: xmlns:eis="https://epp.tld.ee/schema/eis-1.0.xsd"
|
||||
<eis:ident> 0-1 Contact identificator
|
||||
Attribute: "type"
|
||||
"bic" # Business registry code
|
||||
|
@ -83,12 +83,12 @@ Contact Mapping protocol short version:
|
|||
Field name Min-max Field description
|
||||
----------------------- ------- -----------------
|
||||
<delete> 1
|
||||
<contact:delete> 1 Attribute: xmlns:contact="https://raw.githubusercontent.com/internetee/registry/alpha/doc/schemas/contact-eis-1.0.xsd"
|
||||
<contact:delete> 1 Attribute: xmlns:contact="https://epp.tld.ee/schema/contact-eis-1.0.xsd"
|
||||
<contact:id> 1 Contact id
|
||||
<contact:authInfo> 0-1 Required if registrar is not the owner of the contact.
|
||||
<contact:pw> 1 Contact password. Attribute: roid="String"
|
||||
<extension> 0-1
|
||||
<eis:extdata> 0-1 Attribute: xmlns:eis="https://raw.githubusercontent.com/internetee/registry/alpha/doc/schemas/eis-1.0.xsd"
|
||||
<eis:extdata> 0-1 Attribute: xmlns:eis="https://epp.tld.ee/schema/eis-1.0.xsd"
|
||||
<eis:legalDocument> 0-1 Base64 encoded document.
|
||||
Attribute: type="pdf/bdoc/ddoc/zip/rar/gz/tar/7z"
|
||||
<clTRID> 0-1 Client transaction id
|
||||
|
@ -101,7 +101,7 @@ Contact Mapping protocol short version:
|
|||
Field name Min-max Field description
|
||||
----------------------- ------- -----------------
|
||||
<check> 1
|
||||
<contact:check> 1 Attribute: xmlns:contact="https://raw.githubusercontent.com/internetee/registry/alpha/doc/schemas/contact-eis-1.0.xsd"
|
||||
<contact:check> 1 Attribute: xmlns:contact="https://epp.tld.ee/schema/contact-eis-1.0.xsd"
|
||||
<contact:id> 1-n Contact id
|
||||
<clTRID> 0-1 Client transaction id
|
||||
|
||||
|
@ -113,7 +113,7 @@ Contact Mapping protocol short version:
|
|||
Field name Min-max Field description
|
||||
----------------------- ------- -----------------
|
||||
<info> 1
|
||||
<contact:info> 1 Attribute: xmlns:contact="https://raw.githubusercontent.com/internetee/registry/alpha/doc/schemas/contact-eis-1.0.xsd"
|
||||
<contact:info> 1 Attribute: xmlns:contact="https://epp.tld.ee/schema/contact-eis-1.0.xsd"
|
||||
<contact:id> 1-n Contact id
|
||||
<contact:authInfo> 0-1 Required if registrar is not the owner of the contact.
|
||||
<contact:pw> 1 Contact password. Attribute: roid="String"
|
||||
|
|
|
@ -13,7 +13,7 @@ Domain name mapping protocol short version:
|
|||
Field name Min-max Field description
|
||||
------------------------- ------- -----------------
|
||||
<create> 1
|
||||
<domain:create> 1 Attribute: xmlns:domain="https://raw.githubusercontent.com/internetee/registry/alpha/doc/schemas/domain-eis-1.0.xsd"
|
||||
<domain:create> 1 Attribute: xmlns:domain="https://epp.tld.ee/schema/domain-eis-1.0.xsd"
|
||||
<domain:name> 1 Domain name. Can contain unicode characters.
|
||||
<domain:period> 0-1 Registration period for domain.
|
||||
Must add up to 1 / 2 / 3 years.
|
||||
|
@ -36,7 +36,7 @@ Domain name mapping protocol short version:
|
|||
<secDNS:protocol> 1 Allowed values: 3
|
||||
<secDNS:alg> 1 Allowed values: 3, 5, 6, 7, 8, 252, 253, 254, 255
|
||||
<secDNS:pubKey> 1 Public key
|
||||
<eis:extdata> 1 Attribute: xmlns:eis="https://raw.githubusercontent.com/internetee/registry/alpha/doc/schemas/eis-1.0.xsd"
|
||||
<eis:extdata> 1 Attribute: xmlns:eis="https://epp.tld.ee/schema/eis-1.0.xsd"
|
||||
<eis:legalDocument> 1 Base64 encoded document.
|
||||
Attribute: type="pdf/bdoc/ddoc/zip/rar/gz/tar/7z"
|
||||
<eis:reserved> 0-1
|
||||
|
@ -50,7 +50,7 @@ Domain name mapping protocol short version:
|
|||
Field name Min-max Field description
|
||||
------------------------ -------- -----------------
|
||||
<update> 1
|
||||
<domain:update> 1 Attribute: xmlns:domain="https://raw.githubusercontent.com/internetee/registry/alpha/doc/schemas/domain-eis-1.0.xsd"
|
||||
<domain:update> 1 Attribute: xmlns:domain="https://epp.tld.ee/schema/domain-eis-1.0.xsd"
|
||||
<domain:name> 1 Domain name. Can contain unicode characters.
|
||||
<domain:chg> 0-1 Attributes to change
|
||||
<domain:registrant> 0-1 Contact reference to the registrant
|
||||
|
@ -85,7 +85,7 @@ Domain name mapping protocol short version:
|
|||
<secDNS:rem> 0-1
|
||||
<secDNS:keyData> 1-n
|
||||
<secDNS:pubKey> 1 Public key
|
||||
<eis:extdata> 0-1 Attribute: xmlns:eis="https://raw.githubusercontent.com/internetee/registry/alpha/doc/schemas/eis-1.0.xsd"
|
||||
<eis:extdata> 0-1 Attribute: xmlns:eis="https://epp.tld.ee/schema/eis-1.0.xsd"
|
||||
<eis:legalDocument> 0-1 Base64 encoded document. Required if registrant is changing.
|
||||
Attribute: type="pdf/bdoc/ddoc/zip/rar/gz/tar/7z"
|
||||
<clTRID> 0-1 Client transaction id
|
||||
|
@ -97,11 +97,11 @@ Domain name mapping protocol short version:
|
|||
Field name Min-max Field description
|
||||
----------------------- ------- -----------------
|
||||
<delete> 1
|
||||
<domain:delete> 1 Attribute: xmlns:domain="https://raw.githubusercontent.com/internetee/registry/alpha/doc/schemas/domain-eis-1.0.xsd"
|
||||
<domain:delete> 1 Attribute: xmlns:domain="https://epp.tld.ee/schema/domain-eis-1.0.xsd"
|
||||
Optional attribute: verified="yes/no"
|
||||
<domain:name> 1 Domain name. Can contain unicode characters.
|
||||
<extension> 1
|
||||
<eis:extdata> 1 Attribute: xmlns:eis="https://raw.githubusercontent.com/internetee/registry/alpha/doc/schemas/eis-1.0.xsd"
|
||||
<eis:extdata> 1 Attribute: xmlns:eis="https://epp.tld.ee/schema/eis-1.0.xsd"
|
||||
<eis:legalDocument> 1 Base64 encoded document.
|
||||
Attribute: type="pdf/bdoc/ddoc/zip/rar/gz/tar/7z"
|
||||
<clTRID> 0-1 Client transaction id
|
||||
|
@ -113,7 +113,7 @@ Domain name mapping protocol short version:
|
|||
Field name Min-max Field description
|
||||
----------------------- ------- -----------------
|
||||
<info> 1
|
||||
<domain:info> 1 Attribute: xmlns:domain="https://raw.githubusercontent.com/internetee/registry/alpha/doc/schemas/domain-eis-1.0.xsd"
|
||||
<domain:info> 1 Attribute: xmlns:domain="https://epp.tld.ee/schema/domain-eis-1.0.xsd"
|
||||
<domain:name> 1 Domain name. Can contain unicode characters.
|
||||
Attribute: hosts="all / del / sub / none"
|
||||
<domain:authInfo> 0-1 Required if registrar is not the owner of the domain.
|
||||
|
@ -127,14 +127,14 @@ Domain name mapping protocol short version:
|
|||
Field name Min-max Field description
|
||||
----------------------- ------- -----------------
|
||||
<renew> 1
|
||||
<domain:renew> 1 Attribute: xmlns:domain="https://raw.githubusercontent.com/internetee/registry/alpha/doc/schemas/domain-eis-1.0.xsd"
|
||||
<domain:renew> 1 Attribute: xmlns:domain="https://epp.tld.ee/schema/domain-eis-1.0.xsd"
|
||||
<domain:name> 1 Domain name. Can contain unicode characters.
|
||||
<domain:curExpDate> 1 Current expiry date (ISO8601 format)
|
||||
<domain:period> 0-1 Registration period for domain.
|
||||
Must add up to 1 / 2 / 3 years. Attribute: unit="y/m/d"
|
||||
Default value is 1 year.
|
||||
<extension> 0-1
|
||||
<eis:extdata> 0-1 Attribute: xmlns:eis="https://raw.githubusercontent.com/internetee/registry/alpha/doc/schemas/eis-1.0.xsd"
|
||||
<eis:extdata> 0-1 Attribute: xmlns:eis="https://epp.tld.ee/schema/eis-1.0.xsd"
|
||||
<eis:legalDocument> 0-1 Base64 encoded document.
|
||||
Attribute: type="pdf/bdoc/ddoc/zip/rar/gz/tar/7z"
|
||||
<clTRID> 0-1 Client transaction id
|
||||
|
@ -146,12 +146,12 @@ Domain name mapping protocol short version:
|
|||
Field name Min-max Field description
|
||||
----------------------- ------- -----------------
|
||||
<transfer> 1 Attribute: op="request/query/approve/reject/cancel"
|
||||
<domain:transfer> 1 Attribute: xmlns:domain="https://raw.githubusercontent.com/internetee/registry/alpha/doc/schemas/domain-eis-1.0.xsd"
|
||||
<domain:transfer> 1 Attribute: xmlns:domain="https://epp.tld.ee/schema/domain-eis-1.0.xsd"
|
||||
<domain:name> 1 Domain name. Can contain unicode characters.
|
||||
<domain:authInfo> 1
|
||||
<domain:pw> 1 Domain password. Attribute: roid="String"
|
||||
<extension> 0-1
|
||||
<eis:extdata> 0-1 Attribute: xmlns:eis="https://raw.githubusercontent.com/internetee/registry/alpha/doc/schemas/eis-1.0.xsd"
|
||||
<eis:extdata> 0-1 Attribute: xmlns:eis="https://epp.tld.ee/schema/eis-1.0.xsd"
|
||||
<eis:legalDocument> 0-1 Base64 encoded document.
|
||||
Attribute: type="pdf/bdoc/ddoc/zip/rar/gz/tar/7z"
|
||||
<clTRID> 0-1 Client transaction id
|
||||
|
@ -163,7 +163,7 @@ Domain name mapping protocol short version:
|
|||
Field name Min-max Field description
|
||||
----------------------- ------- -----------------
|
||||
<check> 1
|
||||
<domain:check> 1 Attribute: xmlns:domain="https://raw.githubusercontent.com/internetee/registry/alpha/doc/schemas/domain-eis-1.0.xsd"
|
||||
<domain:check> 1 Attribute: xmlns:domain="https://epp.tld.ee/schema/domain-eis-1.0.xsd"
|
||||
<domain:name> 1 Domain name. Can contain unicode characters.
|
||||
<clTRID> 0-1 Client transaction id
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<schema targetNamespace="https://raw.githubusercontent.com/internetee/registry/alpha/doc/schemas/contact-eis-1.0.xsd"
|
||||
xmlns:contact="https://raw.githubusercontent.com/internetee/registry/alpha/doc/schemas/contact-eis-1.0.xsd"
|
||||
<schema targetNamespace="https://epp.tld.ee/schema/contact-eis-1.0.xsd"
|
||||
xmlns:contact="https://epp.tld.ee/schema/contact-eis-1.0.xsd"
|
||||
xmlns:epp="urn:ietf:params:xml:ns:epp-1.0"
|
||||
xmlns:eppcom="urn:ietf:params:xml:ns:eppcom-1.0"
|
||||
xmlns="http://www.w3.org/2001/XMLSchema"
|
||||
|
@ -10,9 +10,9 @@
|
|||
<!--
|
||||
Import common element types.
|
||||
-->
|
||||
<import namespace="urn:ietf:params:xml:ns:eppcom-1.0" schemaLocation="doc/schemas/eppcom-1.0.xsd"/>
|
||||
<import namespace="urn:ietf:params:xml:ns:epp-1.0" schemaLocation="doc/schemas/epp-1.0.xsd"/>
|
||||
<import namespace="https://raw.githubusercontent.com/internetee/registry/alpha/doc/schemas/eis-1.0.xsd" schemaLocation="doc/schemas/eis-1.0.xsd"/>
|
||||
<import namespace="urn:ietf:params:xml:ns:eppcom-1.0" schemaLocation="http://www.iana.org/assignments/xml-registry/schema/eppcom-1.0.xsd"/>
|
||||
<import namespace="urn:ietf:params:xml:ns:epp-1.0" schemaLocation="http://www.iana.org/assignments/xml-registry/schema/epp-1.0.xsd"/>
|
||||
<import namespace="https://epp.tld.ee/schema/eis-1.0.xsd" schemaLocation="doc/schemas/eis-1.0.xsd"/>
|
||||
|
||||
<annotation>
|
||||
<documentation>
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<schema targetNamespace="https://raw.githubusercontent.com/internetee/registry/alpha/doc/schemas/domain-eis-1.0.xsd"
|
||||
xmlns:domain="https://raw.githubusercontent.com/internetee/registry/alpha/doc/schemas/domain-eis-1.0.xsd"
|
||||
<schema targetNamespace="https://epp.tld.ee/schema/domain-eis-1.0.xsd"
|
||||
xmlns:domain="https://epp.tld.ee/schema/domain-eis-1.0.xsd"
|
||||
xmlns:host="urn:ietf:params:xml:ns:host-1.0"
|
||||
xmlns:epp="urn:ietf:params:xml:ns:epp-1.0"
|
||||
xmlns:eppcom="urn:ietf:params:xml:ns:eppcom-1.0"
|
||||
|
@ -11,11 +11,11 @@
|
|||
<!--
|
||||
Import common element types.
|
||||
-->
|
||||
<import namespace="urn:ietf:params:xml:ns:eppcom-1.0" schemaLocation="doc/schemas/eppcom-1.0.xsd"/>
|
||||
<import namespace="urn:ietf:params:xml:ns:epp-1.0" schemaLocation="doc/schemas/epp-1.0.xsd"/>
|
||||
<import namespace="urn:ietf:params:xml:ns:host-1.0" schemaLocation="doc/schemas/host-1.0.xsd"/>
|
||||
<import namespace="urn:ietf:params:xml:ns:secDNS-1.1" schemaLocation="doc/schemas/secDNS-1.1.xsd"/>
|
||||
<import namespace="https://raw.githubusercontent.com/internetee/registry/alpha/doc/schemas/eis-1.0.xsd" schemaLocation="doc/schemas/eis-1.0.xsd"/>
|
||||
<import namespace="urn:ietf:params:xml:ns:eppcom-1.0" schemaLocation="http://www.iana.org/assignments/xml-registry/schema/eppcom-1.0.xsd"/>
|
||||
<import namespace="urn:ietf:params:xml:ns:epp-1.0" schemaLocation="http://www.iana.org/assignments/xml-registry/schema/epp-1.0.xsd"/>
|
||||
<import namespace="urn:ietf:params:xml:ns:host-1.0" schemaLocation="http://www.iana.org/assignments/xml-registry/schema/host-1.0.xsd"/>
|
||||
<import namespace="urn:ietf:params:xml:ns:secDNS-1.1" schemaLocation="http://www.iana.org/assignments/xml-registry/schema/secDNS-1.1.xsd"/>
|
||||
<import namespace="https://epp.tld.ee/schema/eis-1.0.xsd" schemaLocation="doc/schemas/eis-1.0.xsd"/>
|
||||
|
||||
<annotation>
|
||||
<documentation>
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<schema
|
||||
targetNamespace="https://raw.githubusercontent.com/internetee/registry/alpha/doc/schemas/eis-1.0.xsd"
|
||||
xmlns:eis="https://raw.githubusercontent.com/internetee/registry/alpha/doc/schemas/eis-1.0.xsd"
|
||||
targetNamespace="https://epp.tld.ee/schema/eis-1.0.xsd"
|
||||
xmlns:eis="https://epp.tld.ee/schema/eis-1.0.xsd"
|
||||
xmlns="http://www.w3.org/2001/XMLSchema"
|
||||
elementFormDefault="qualified">
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
class EppConstraint
|
||||
OBJECT_TYPES = {
|
||||
domain: { domain: 'https://raw.githubusercontent.com/internetee/registry/alpha/doc/schemas/domain-eis-1.0.xsd' },
|
||||
contact: { contact: 'https://raw.githubusercontent.com/internetee/registry/alpha/doc/schemas/contact-eis-1.0.xsd' }
|
||||
domain: { domain: 'https://epp.tld.ee/schema/domain-eis-1.0.xsd' },
|
||||
contact: { contact: 'https://epp.tld.ee/schema/contact-eis-1.0.xsd' }
|
||||
}
|
||||
|
||||
def initialize(type)
|
||||
|
@ -10,14 +10,15 @@ class EppConstraint
|
|||
|
||||
# creates parsed_frame, detects epp request object
|
||||
def matches?(request)
|
||||
parsed_frame = Nokogiri::XML(request.params[:raw_frame])
|
||||
# TODO: Maybe move this to controller to keep params clean
|
||||
request.params[:nokogiri_frame] ||= Nokogiri::XML(request.params[:raw_frame])
|
||||
request.params[:parsed_frame] ||= request.params[:nokogiri_frame].dup.remove_namespaces!
|
||||
|
||||
unless [:keyrelay, :poll].include?(@type)
|
||||
unless [:keyrelay, :poll, :session, :not_found].include?(@type)
|
||||
element = "//#{@type}:#{request.params[:action]}"
|
||||
return false if parsed_frame.xpath("#{element}", OBJECT_TYPES[@type]).none?
|
||||
return false if request.params[:nokogiri_frame].xpath("#{element}", OBJECT_TYPES[@type]).none?
|
||||
end
|
||||
|
||||
request.params[:parsed_frame] = parsed_frame.remove_namespaces!
|
||||
request.params[:epp_object_type] = @type
|
||||
true
|
||||
end
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<schema targetNamespace="urn:ietf:params:xml:ns:contact-1.0"
|
||||
xmlns:contact="urn:ietf:params:xml:ns:contact-1.0"
|
||||
<schema targetNamespace="https://epp.tld.ee/schema/contact-eis-1.0.xsd"
|
||||
xmlns:contact="https://epp.tld.ee/schema/contact-eis-1.0.xsd"
|
||||
xmlns:epp="urn:ietf:params:xml:ns:epp-1.0"
|
||||
xmlns:eppcom="urn:ietf:params:xml:ns:eppcom-1.0"
|
||||
xmlns="http://www.w3.org/2001/XMLSchema"
|
||||
|
@ -10,8 +10,9 @@
|
|||
<!--
|
||||
Import common element types.
|
||||
-->
|
||||
<import namespace="urn:ietf:params:xml:ns:eppcom-1.0"/>
|
||||
<import namespace="urn:ietf:params:xml:ns:epp-1.0"/>
|
||||
<import namespace="urn:ietf:params:xml:ns:eppcom-1.0" schemaLocation="lib/schemas/eppcom-1.0.xsd"/>
|
||||
<import namespace="urn:ietf:params:xml:ns:epp-1.0" schemaLocation="lib/schemas/epp-1.0.xsd"/>
|
||||
<import namespace="https://epp.tld.ee/schema/eis-1.0.xsd" schemaLocation="lib/schemas/eis-1.0.xsd"/>
|
||||
|
||||
<annotation>
|
||||
<documentation>
|
||||
|
@ -25,7 +26,7 @@
|
|||
-->
|
||||
<element name="check" type="contact:mIDType"/>
|
||||
<element name="create" type="contact:createType"/>
|
||||
<element name="delete" type="contact:sIDType"/>
|
||||
<element name="delete" type="contact:authIDType"/>
|
||||
<element name="info" type="contact:authIDType"/>
|
||||
<element name="transfer" type="contact:authIDType"/>
|
||||
<element name="update" type="contact:updateType"/>
|
||||
|
@ -38,7 +39,6 @@
|
|||
<length value="2"/>
|
||||
</restriction>
|
||||
</simpleType>
|
||||
|
||||
<complexType name="e164Type">
|
||||
<simpleContent>
|
||||
<extension base="contact:e164StringType">
|
||||
|
@ -49,7 +49,7 @@
|
|||
|
||||
<simpleType name="e164StringType">
|
||||
<restriction base="token">
|
||||
<pattern value="(\+[0-9]{1,3}\.[0-9]{1,14})?"/>
|
||||
<!--<pattern value="(\+[0-9]{1,3}\.[0-9]{1,14})?"/> -->
|
||||
<maxLength value="17"/>
|
||||
</restriction>
|
||||
</simpleType>
|
||||
|
@ -78,7 +78,7 @@
|
|||
-->
|
||||
<complexType name="createType">
|
||||
<sequence>
|
||||
<element name="id" type="eppcom:clIDType"/>
|
||||
<element name="id" type="eppcom:clIDType" minOccurs="0"/>
|
||||
<element name="postalInfo" type="contact:postalInfoType"
|
||||
maxOccurs="2"/>
|
||||
<element name="voice" type="contact:e164Type"
|
||||
|
@ -86,9 +86,8 @@
|
|||
<element name="fax" type="contact:e164Type"
|
||||
minOccurs="0"/>
|
||||
<element name="email" type="eppcom:minTokenType"/>
|
||||
<element name="authInfo" type="contact:authInfoType"/>
|
||||
<element name="disclose" type="contact:discloseType"
|
||||
minOccurs="0"/>
|
||||
<element name="authInfo" type="contact:authInfoType" minOccurs="0"/>
|
||||
|
||||
</sequence>
|
||||
</complexType>
|
||||
|
||||
|
@ -99,8 +98,7 @@
|
|||
minOccurs="0"/>
|
||||
<element name="addr" type="contact:addrType"/>
|
||||
</sequence>
|
||||
<attribute name="type" type="contact:postalInfoEnumType"
|
||||
use="required"/>
|
||||
<attribute name="type" type="contact:postalInfoEnumType"/>
|
||||
</complexType>
|
||||
|
||||
<simpleType name="postalInfoEnumType">
|
||||
|
@ -130,21 +128,6 @@
|
|||
</choice>
|
||||
</complexType>
|
||||
|
||||
<complexType name="discloseType">
|
||||
<sequence>
|
||||
<element name="name" type="contact:intLocType"
|
||||
minOccurs="0" maxOccurs="2"/>
|
||||
<element name="org" type="contact:intLocType"
|
||||
minOccurs="0" maxOccurs="2"/>
|
||||
<element name="addr" type="contact:intLocType"
|
||||
minOccurs="0" maxOccurs="2"/>
|
||||
<element name="voice" minOccurs="0"/>
|
||||
<element name="fax" minOccurs="0"/>
|
||||
<element name="email" minOccurs="0"/>
|
||||
</sequence>
|
||||
<attribute name="flag" type="boolean" use="required"/>
|
||||
</complexType>
|
||||
|
||||
<complexType name="intLocType">
|
||||
<attribute name="type" type="contact:postalInfoEnumType"
|
||||
use="required"/>
|
||||
|
@ -220,8 +203,6 @@
|
|||
minOccurs="0"/>
|
||||
<element name="authInfo" type="contact:authInfoType"
|
||||
minOccurs="0"/>
|
||||
<element name="disclose" type="contact:discloseType"
|
||||
minOccurs="0"/>
|
||||
</sequence>
|
||||
</complexType>
|
||||
|
||||
|
@ -234,8 +215,7 @@
|
|||
<element name="addr" type="contact:addrType"
|
||||
minOccurs="0"/>
|
||||
</sequence>
|
||||
<attribute name="type" type="contact:postalInfoEnumType"
|
||||
use="required"/>
|
||||
<attribute name="type" type="contact:postalInfoEnumType"/>
|
||||
</complexType>
|
||||
|
||||
<!--
|
||||
|
@ -311,8 +291,6 @@
|
|||
minOccurs="0"/>
|
||||
<element name="authInfo" type="contact:authInfoType"
|
||||
minOccurs="0"/>
|
||||
<element name="disclose" type="contact:discloseType"
|
||||
minOccurs="0"/>
|
||||
</sequence>
|
||||
</complexType>
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<schema targetNamespace="urn:ietf:params:xml:ns:domain-1.0"
|
||||
xmlns:domain="urn:ietf:params:xml:ns:domain-1.0"
|
||||
<schema targetNamespace="https://epp.tld.ee/schema/domain-eis-1.0.xsd"
|
||||
xmlns:domain="https://epp.tld.ee/schema/domain-eis-1.0.xsd"
|
||||
xmlns:host="urn:ietf:params:xml:ns:host-1.0"
|
||||
xmlns:epp="urn:ietf:params:xml:ns:epp-1.0"
|
||||
xmlns:eppcom="urn:ietf:params:xml:ns:eppcom-1.0"
|
||||
|
@ -11,9 +11,11 @@
|
|||
<!--
|
||||
Import common element types.
|
||||
-->
|
||||
<import namespace="urn:ietf:params:xml:ns:eppcom-1.0"/>
|
||||
<import namespace="urn:ietf:params:xml:ns:epp-1.0"/>
|
||||
<import namespace="urn:ietf:params:xml:ns:host-1.0"/>
|
||||
<import namespace="urn:ietf:params:xml:ns:eppcom-1.0" schemaLocation="lib/schemas/eppcom-1.0.xsd"/>
|
||||
<import namespace="urn:ietf:params:xml:ns:epp-1.0" schemaLocation="lib/schemas/epp-1.0.xsd"/>
|
||||
<import namespace="urn:ietf:params:xml:ns:host-1.0" schemaLocation="lib/schemas/host-1.0.xsd"/>
|
||||
<import namespace="urn:ietf:params:xml:ns:secDNS-1.1" schemaLocation="lib/schemas/secDNS-1.1.xsd"/>
|
||||
<import namespace="https://epp.tld.ee/schema/eis-1.0.xsd" schemaLocation="lib/schemas/eis-1.0.xsd"/>
|
||||
|
||||
<annotation>
|
||||
<documentation>
|
||||
|
@ -46,7 +48,7 @@
|
|||
minOccurs="0"/>
|
||||
<element name="contact" type="domain:contactType"
|
||||
minOccurs="0" maxOccurs="unbounded"/>
|
||||
<element name="authInfo" type="domain:authInfoType"/>
|
||||
<element name="authInfo" type="domain:authInfoType" minOccurs="0"/>
|
||||
</sequence>
|
||||
</complexType>
|
||||
|
||||
|
@ -62,7 +64,7 @@
|
|||
<simpleType name="pLimitType">
|
||||
<restriction base="unsignedShort">
|
||||
<minInclusive value="1"/>
|
||||
<maxInclusive value="99"/>
|
||||
<maxInclusive value="1095"/>
|
||||
</restriction>
|
||||
</simpleType>
|
||||
|
||||
|
@ -70,6 +72,7 @@
|
|||
<restriction base="token">
|
||||
<enumeration value="y"/>
|
||||
<enumeration value="m"/>
|
||||
<enumeration value="d"/>
|
||||
</restriction>
|
||||
</simpleType>
|
||||
|
||||
|
@ -89,6 +92,7 @@
|
|||
<sequence>
|
||||
<element name="hostName" type="eppcom:labelType"/>
|
||||
<element name="hostAddr" type="host:addrType"
|
||||
|
||||
minOccurs="0" maxOccurs="unbounded"/>
|
||||
</sequence>
|
||||
</complexType>
|
||||
|
@ -237,12 +241,28 @@
|
|||
Allow the registrant value to be nullified by changing the
|
||||
minLength restriction to "0".
|
||||
-->
|
||||
<simpleType name="clIDChgType">
|
||||
|
||||
<complexType name="clIDChgType">
|
||||
<simpleContent>
|
||||
<extension base="domain:clIDChgSimpleType">
|
||||
<attribute name="verified" type="domain:verifiedType"/>
|
||||
</extension>
|
||||
</simpleContent>
|
||||
</complexType>
|
||||
|
||||
<simpleType name="clIDChgSimpleType">
|
||||
<restriction base="token">
|
||||
<minLength value="0"/>
|
||||
<maxLength value="16"/>
|
||||
</restriction>
|
||||
</simpleType>
|
||||
</simpleType>
|
||||
|
||||
<simpleType name="verifiedType">
|
||||
<restriction base="token">
|
||||
<enumeration value="yes"/>
|
||||
<enumeration value="no"/>
|
||||
</restriction>
|
||||
</simpleType>
|
||||
|
||||
|
||||
<!--
|
||||
Allow the authInfo value to be nullified by including an
|
||||
|
@ -425,7 +445,6 @@
|
|||
minOccurs="0"/>
|
||||
</sequence>
|
||||
</complexType>
|
||||
|
||||
<!--
|
||||
End of schema.
|
||||
-->
|
102
lib/schemas/eis-1.0.xsd
Normal file
102
lib/schemas/eis-1.0.xsd
Normal file
|
@ -0,0 +1,102 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<schema
|
||||
targetNamespace="https://epp.tld.ee/schema/eis-1.0.xsd"
|
||||
xmlns:eis="https://epp.tld.ee/schema/eis-1.0.xsd"
|
||||
xmlns="http://www.w3.org/2001/XMLSchema"
|
||||
elementFormDefault="qualified">
|
||||
|
||||
<annotation>
|
||||
<documentation>
|
||||
EIS Extensible Provisioning Protocol v1.0 extension schema.
|
||||
</documentation>
|
||||
</annotation>
|
||||
|
||||
<!--
|
||||
Child elements found in EPP commands.
|
||||
-->
|
||||
|
||||
<element name="extdata" type="eis:eisExtType"/>
|
||||
|
||||
<!--
|
||||
Child elements supporting EIS specific values.
|
||||
-->
|
||||
<complexType name="eisExtType">
|
||||
<sequence>
|
||||
<element name="ident" type="eis:identType" minOccurs="0" maxOccurs="1"/>
|
||||
<element name="legalDocument" type="eis:legalDocType" minOccurs="0" maxOccurs="1"/>
|
||||
<element name="reserved" type="eis:reservedType" minOccurs="0" maxOccurs="1"/>
|
||||
</sequence>
|
||||
</complexType>
|
||||
|
||||
<!--
|
||||
Child elements of extdata
|
||||
-->
|
||||
|
||||
<!--
|
||||
Reserved for providing passwords for reserved domains
|
||||
-->
|
||||
|
||||
<complexType name="reservedType">
|
||||
<sequence>
|
||||
<element name="pw" type="eis:pwType" minOccurs="0" maxOccurs="1"/>
|
||||
</sequence>
|
||||
</complexType>
|
||||
|
||||
<simpleType name="pwType">
|
||||
<restriction base="normalizedString">
|
||||
<minLength value="1"/>
|
||||
<maxLength value="255"/>
|
||||
</restriction>
|
||||
</simpleType>
|
||||
|
||||
<!--
|
||||
Legal document, encoded in base64
|
||||
-->
|
||||
<complexType name="legalDocType">
|
||||
<simpleContent>
|
||||
<extension base="base64Binary">
|
||||
<attribute name="type" type="eis:legalDocEnumType" use="required"/>
|
||||
</extension>
|
||||
</simpleContent>
|
||||
</complexType>
|
||||
|
||||
<simpleType name="legalDocEnumType">
|
||||
<restriction base="token">
|
||||
<enumeration value="pdf"/>
|
||||
<enumeration value="bdoc"/>
|
||||
<enumeration value="ddoc"/>
|
||||
<enumeration value="zip"/>
|
||||
<enumeration value="rar"/>
|
||||
<enumeration value="gz"/>
|
||||
<enumeration value="tar"/>
|
||||
<enumeration value="7z"/>
|
||||
</restriction>
|
||||
</simpleType>
|
||||
|
||||
<!--
|
||||
Ident with type and country code
|
||||
-->
|
||||
<complexType name="identType">
|
||||
<simpleContent>
|
||||
<extension base="normalizedString">
|
||||
<attribute name="type" type="eis:identEnumType" use="required"/>
|
||||
<attribute name="cc" type="eis:ccType" use="required"/>
|
||||
</extension>
|
||||
</simpleContent>
|
||||
</complexType>
|
||||
|
||||
<simpleType name="identEnumType">
|
||||
<restriction base="token">
|
||||
<enumeration value="bic"/>
|
||||
<enumeration value="priv"/>
|
||||
<enumeration value="birthday"/>
|
||||
</restriction>
|
||||
</simpleType>
|
||||
|
||||
<simpleType name="ccType">
|
||||
<restriction base="normalizedString">
|
||||
<minLength value="2"/>
|
||||
<maxLength value="2"/>
|
||||
</restriction>
|
||||
</simpleType>
|
||||
</schema>
|
|
@ -9,7 +9,7 @@
|
|||
<!--
|
||||
Import common element types.
|
||||
-->
|
||||
<import namespace="urn:ietf:params:xml:ns:eppcom-1.0" schemaLocation="doc/schemas/eppcom-1.0.xsd" />
|
||||
<import namespace="urn:ietf:params:xml:ns:eppcom-1.0" schemaLocation="lib/schemas/eppcom-1.0.xsd" />
|
||||
|
||||
<annotation>
|
||||
<documentation>
|
|
@ -2,7 +2,7 @@ require 'rails_helper'
|
|||
|
||||
describe 'EPP Contact', epp: true do
|
||||
before :all do
|
||||
@xsd = Nokogiri::XML::Schema(File.read('doc/schemas/contact-eis-1.0.xsd'))
|
||||
@xsd = Nokogiri::XML::Schema(File.read('lib/schemas/contact-eis-1.0.xsd'))
|
||||
@registrar1 = Fabricate(:registrar1)
|
||||
@registrar2 = Fabricate(:registrar2)
|
||||
@epp_xml = EppXml::Contact.new(cl_trid: 'ABC-12345')
|
||||
|
@ -58,34 +58,10 @@ describe 'EPP Contact', epp: true do
|
|||
end
|
||||
|
||||
it 'fails if request xml is missing' do
|
||||
response = epp_plain_request(@epp_xml.create, validate_input: false)
|
||||
response[:results][0][:msg].should ==
|
||||
'Required parameter missing: create > create > postalInfo > name [name]'
|
||||
response[:results][1][:msg].should ==
|
||||
'Required parameter missing: create > create > postalInfo > addr > street [street]'
|
||||
response[:results][2][:msg].should ==
|
||||
'Required parameter missing: create > create > postalInfo > addr > city [city]'
|
||||
response[:results][3][:msg].should ==
|
||||
'Required parameter missing: create > create > postalInfo > addr > pc [pc]'
|
||||
response[:results][4][:msg].should ==
|
||||
'Required parameter missing: create > create > postalInfo > addr > cc [cc]'
|
||||
response[:results][5][:msg].should ==
|
||||
'Required parameter missing: create > create > voice [voice]'
|
||||
response[:results][6][:msg].should ==
|
||||
'Required parameter missing: create > create > email [email]'
|
||||
response[:results][7][:msg].should ==
|
||||
'Required parameter missing: extension > extdata > ident [ident]'
|
||||
response = epp_plain_request(@epp_xml.create)
|
||||
|
||||
response[:results][0][:result_code].should == '2003'
|
||||
response[:results][1][:result_code].should == '2003'
|
||||
response[:results][2][:result_code].should == '2003'
|
||||
response[:results][3][:result_code].should == '2003'
|
||||
response[:results][4][:result_code].should == '2003'
|
||||
response[:results][5][:result_code].should == '2003'
|
||||
response[:results][6][:result_code].should == '2003'
|
||||
response[:results][7][:result_code].should == '2003'
|
||||
|
||||
response[:results].count.should == 8
|
||||
response[:results][0][:msg].should == "Element '{https://epp.tld.ee/schema/contact-eis-1.0.xsd}create': Missing child element(s). Expected is one of ( {https://epp.tld.ee/schema/contact-eis-1.0.xsd}id, {https://epp.tld.ee/schema/contact-eis-1.0.xsd}postalInfo )."
|
||||
response[:results][0][:result_code].should == '2001'
|
||||
end
|
||||
|
||||
it 'successfully creates a contact' do
|
||||
|
@ -196,10 +172,9 @@ describe 'EPP Contact', epp: true do
|
|||
attrs: { type: 'birthday', cc: 'WRONG' }
|
||||
}
|
||||
}
|
||||
response = create_request({}, extension, validate_input: false)
|
||||
response[:msg].should ==
|
||||
'Ident country code is not valid, should be in ISO_3166-1 alpha 2 format [ident]'
|
||||
response[:result_code].should == '2005'
|
||||
response = create_request({}, extension)
|
||||
response[:msg].should == "Element '{https://epp.tld.ee/schema/eis-1.0.xsd}ident', attribute 'cc': [facet 'maxLength'] The value 'WRONG' has a length of '5'; this exceeds the allowed maximum length of '2'."
|
||||
response[:result_code].should == '2001'
|
||||
end
|
||||
|
||||
it 'should return country missing' do
|
||||
|
@ -209,10 +184,9 @@ describe 'EPP Contact', epp: true do
|
|||
attrs: { type: 'birthday' }
|
||||
}
|
||||
}
|
||||
response = create_request({}, extension, validate_input: false)
|
||||
response[:msg].should ==
|
||||
'Required ident attribute missing: cc'
|
||||
response[:result_code].should == '2003'
|
||||
response = create_request({}, extension)
|
||||
response[:msg].should == "Element '{https://epp.tld.ee/schema/eis-1.0.xsd}ident': The attribute 'cc' is required but missing."
|
||||
response[:result_code].should == '2001'
|
||||
end
|
||||
|
||||
it 'should return country missing' do
|
||||
|
@ -221,10 +195,9 @@ describe 'EPP Contact', epp: true do
|
|||
value: '1990-22-12'
|
||||
}
|
||||
}
|
||||
response = create_request({}, extension, validate_input: false)
|
||||
response[:msg].should ==
|
||||
'Required ident attribute missing: type'
|
||||
response[:result_code].should == '2003'
|
||||
response = create_request({}, extension)
|
||||
response[:msg].should == "Element '{https://epp.tld.ee/schema/eis-1.0.xsd}ident': The attribute 'type' is required but missing."
|
||||
response[:result_code].should == '2001'
|
||||
end
|
||||
|
||||
it 'should add registrar prefix for code when legacy prefix present' do
|
||||
|
@ -335,15 +308,8 @@ describe 'EPP Contact', epp: true do
|
|||
end
|
||||
|
||||
it 'fails if request is invalid' do
|
||||
response = epp_plain_request(@epp_xml.update, validate_input: false)
|
||||
|
||||
response[:results][0][:msg].should ==
|
||||
'Required parameter missing: add, rem or chg'
|
||||
response[:results][0][:result_code].should == '2003'
|
||||
response[:results][1][:msg].should ==
|
||||
'Required parameter missing: update > update > id [id]'
|
||||
response[:results][1][:result_code].should == '2003'
|
||||
response[:results].count.should == 2
|
||||
response = epp_plain_request(@epp_xml.update)
|
||||
response[:results][0][:msg].should == "Element '{https://epp.tld.ee/schema/contact-eis-1.0.xsd}update': Missing child element(s). Expected is ( {https://epp.tld.ee/schema/contact-eis-1.0.xsd}id )."
|
||||
end
|
||||
|
||||
it 'returns error if obj doesnt exist' do
|
||||
|
@ -429,11 +395,11 @@ describe 'EPP Contact', epp: true do
|
|||
chg: {
|
||||
id: { value: 'notpossibletoupdate' }
|
||||
}
|
||||
}, {}, { validate_input: false }
|
||||
}, {}
|
||||
)
|
||||
|
||||
response[:msg].should == 'Object does not exist'
|
||||
response[:result_code].should == '2303'
|
||||
response[:msg].should == "Element '{https://epp.tld.ee/schema/contact-eis-1.0.xsd}id': This element is not expected."
|
||||
response[:result_code].should == '2001'
|
||||
|
||||
@contact.reload.code.should == 'FIRST0:SH8013'
|
||||
end
|
||||
|
@ -492,16 +458,16 @@ describe 'EPP Contact', epp: true do
|
|||
id: { value: 'FIRST0:SH8013' },
|
||||
add: [{
|
||||
_anonymus: [
|
||||
{ status: { value: 'Payment overdue.', attrs: { s: 'clientHold', lang: 'en' } } },
|
||||
{ status: { value: 'Payment overdue.', attrs: { s: 'clientDeleteProhibited', lang: 'en' } } },
|
||||
{ status: { value: '', attrs: { s: 'clientUpdateProhibited' } } }
|
||||
]
|
||||
}]
|
||||
})
|
||||
|
||||
response = epp_plain_request(xml, validate_input: false)
|
||||
response[:results][0][:result_code].should == '2306'
|
||||
response = epp_plain_request(xml)
|
||||
response[:results][0][:msg].should == "Parameter value policy error. Client-side object status "\
|
||||
"management not supported: status [status]"
|
||||
response[:results][0][:result_code].should == '2306'
|
||||
|
||||
Setting.client_status_editing_enabled = true
|
||||
end
|
||||
|
@ -543,6 +509,7 @@ describe 'EPP Contact', epp: true do
|
|||
end
|
||||
|
||||
it 'should honor chg value over add value when both changes same attribute' do
|
||||
pending 'It should not be possible to add voice (in add)'
|
||||
xml = @epp_xml.update({
|
||||
id: { value: 'FIRST0:SH8013' },
|
||||
add: {
|
||||
|
@ -554,7 +521,7 @@ describe 'EPP Contact', epp: true do
|
|||
}
|
||||
})
|
||||
|
||||
response = epp_plain_request(xml, validate_input: false)
|
||||
response = epp_plain_request(xml)
|
||||
response[:results][0][:msg].should == 'Command completed successfully'
|
||||
response[:results][0][:result_code].should == '1000'
|
||||
|
||||
|
@ -585,8 +552,10 @@ describe 'EPP Contact', epp: true do
|
|||
|
||||
# TODO: Update request rem block must be analyzed
|
||||
it 'should not allow to remove required attribute' do
|
||||
pending 'It should not be possible to remove or add voice (in add and rem)'
|
||||
contact = Contact.find_by(code: 'FIRST0:SH8013')
|
||||
phone = contact.phone
|
||||
# TODO: Refactor authInfo under chg block
|
||||
xml = @epp_xml.update({
|
||||
id: { value: 'FIRST0:SH8013' },
|
||||
authInfo: { pw: { value: 'password' } },
|
||||
|
@ -595,7 +564,7 @@ describe 'EPP Contact', epp: true do
|
|||
}
|
||||
})
|
||||
|
||||
response = epp_plain_request(xml, validate_input: false)
|
||||
response = epp_plain_request(xml)
|
||||
response[:results][0][:msg].should == 'Required parameter missing - phone [phone]'
|
||||
response[:results][0][:result_code].should == '2003'
|
||||
|
||||
|
@ -604,6 +573,8 @@ describe 'EPP Contact', epp: true do
|
|||
end
|
||||
|
||||
it 'should honor add over rem' do
|
||||
pending 'It should not be possible to remove or add voice (in add and rem)'
|
||||
# TODO: Refactor authInfo under chg block
|
||||
xml = @epp_xml.update({
|
||||
id: { value: 'FIRST0:SH8013' },
|
||||
authInfo: { pw: { value: 'password' } },
|
||||
|
@ -615,7 +586,7 @@ describe 'EPP Contact', epp: true do
|
|||
}
|
||||
})
|
||||
|
||||
response = epp_plain_request(xml, validate_input: false)
|
||||
response = epp_plain_request(xml)
|
||||
response[:results][0][:msg].should == 'Command completed successfully'
|
||||
response[:results][0][:result_code].should == '1000'
|
||||
|
||||
|
@ -626,6 +597,8 @@ describe 'EPP Contact', epp: true do
|
|||
end
|
||||
|
||||
it 'should honor chg over rem' do
|
||||
pending 'It should not be possible to remove or add voice (in add and rem)'
|
||||
# TODO: Refactor authInfo under chg block
|
||||
xml = @epp_xml.update({
|
||||
id: { value: 'FIRST0:SH8013' },
|
||||
authInfo: { pw: { value: 'password' } },
|
||||
|
@ -637,7 +610,7 @@ describe 'EPP Contact', epp: true do
|
|||
}
|
||||
})
|
||||
|
||||
response = epp_plain_request(xml, validate_input: false)
|
||||
response = epp_plain_request(xml)
|
||||
response[:results][0][:msg].should == 'Command completed successfully'
|
||||
response[:results][0][:result_code].should == '1000'
|
||||
|
||||
|
@ -648,6 +621,8 @@ describe 'EPP Contact', epp: true do
|
|||
end
|
||||
|
||||
it 'should honor chg over rem and add' do
|
||||
pending 'It should not be possible to remove or add voice (in add and rem)'
|
||||
# TODO: Refactor authInfo under chg block
|
||||
xml = @epp_xml.update({
|
||||
id: { value: 'FIRST0:SH8013' },
|
||||
authInfo: { pw: { value: 'password' } },
|
||||
|
@ -662,7 +637,7 @@ describe 'EPP Contact', epp: true do
|
|||
}
|
||||
})
|
||||
|
||||
response = epp_plain_request(xml, validate_input: false)
|
||||
response = epp_plain_request(xml)
|
||||
response[:results][0][:msg].should == 'Command completed successfully'
|
||||
response[:results][0][:result_code].should == '1000'
|
||||
|
||||
|
@ -673,6 +648,7 @@ describe 'EPP Contact', epp: true do
|
|||
end
|
||||
|
||||
it 'should not remove password' do
|
||||
pending 'There should be no possibility to remove pw'
|
||||
xml = @epp_xml.update({
|
||||
id: { value: 'FIRST0:SH8013' },
|
||||
authInfo: { pw: { value: 'password' } },
|
||||
|
@ -681,7 +657,7 @@ describe 'EPP Contact', epp: true do
|
|||
}
|
||||
})
|
||||
|
||||
response = epp_plain_request(xml, validate_input: false)
|
||||
response = epp_plain_request(xml)
|
||||
response[:results][0][:msg].should == 'Command completed successfully'
|
||||
response[:results][0][:result_code].should == '1000'
|
||||
|
||||
|
@ -690,21 +666,26 @@ describe 'EPP Contact', epp: true do
|
|||
end
|
||||
|
||||
it 'should return general policy error when removing org' do
|
||||
pending 'Test says it should throw error when removing org, it does not do it when removing it with chg block'
|
||||
xml = @epp_xml.update({
|
||||
id: { value: 'FIRST0:SH8013' },
|
||||
authInfo: { pw: { value: 'password' } },
|
||||
rem: {
|
||||
postalInfo: { org: { value: 'not important' } }
|
||||
chg: {
|
||||
postalInfo: {
|
||||
org: { value: '' }
|
||||
},
|
||||
authInfo: { pw: { value: 'password' } }
|
||||
}
|
||||
})
|
||||
|
||||
response = epp_plain_request(xml, validate_input: false)
|
||||
response = epp_plain_request(xml)
|
||||
response[:results][0][:msg].should ==
|
||||
'Parameter value policy error. Org must be blank: postalInfo > org [org]'
|
||||
response[:results][0][:result_code].should == '2306'
|
||||
end
|
||||
|
||||
it 'should return error when removing street' do
|
||||
pending 'Test says it tests removing street, but actually street is not removed'
|
||||
# TODO: Refactor authInfo under chg block
|
||||
xml = @epp_xml.update({
|
||||
id: { value: 'FIRST0:SH8013' },
|
||||
authInfo: { pw: { value: 'password' } },
|
||||
|
@ -715,7 +696,7 @@ describe 'EPP Contact', epp: true do
|
|||
}
|
||||
})
|
||||
|
||||
response = epp_plain_request(xml, validate_input: false)
|
||||
response = epp_plain_request(xml)
|
||||
response[:results][0][:msg].should == "Required parameter missing - name [name]"
|
||||
response[:results][0][:result_code].should == '2003'
|
||||
end
|
||||
|
@ -736,11 +717,10 @@ describe 'EPP Contact', epp: true do
|
|||
end
|
||||
|
||||
it 'fails if request is invalid' do
|
||||
response = epp_plain_request(@epp_xml.delete, validate_input: false)
|
||||
response = epp_plain_request(@epp_xml.delete)
|
||||
|
||||
response[:results][0][:msg].should ==
|
||||
'Required parameter missing: delete > delete > id [id]'
|
||||
response[:results][0][:result_code].should == '2003'
|
||||
response[:results][0][:msg].should == "Element '{https://epp.tld.ee/schema/contact-eis-1.0.xsd}delete': Missing child element(s). Expected is ( {https://epp.tld.ee/schema/contact-eis-1.0.xsd}id )."
|
||||
response[:results][0][:result_code].should == '2001'
|
||||
response[:results].count.should == 1
|
||||
end
|
||||
|
||||
|
@ -832,10 +812,10 @@ describe 'EPP Contact', epp: true do
|
|||
end
|
||||
|
||||
it 'fails if request is invalid' do
|
||||
response = epp_plain_request(@epp_xml.check, validate_input: false)
|
||||
response = epp_plain_request(@epp_xml.check)
|
||||
|
||||
response[:results][0][:msg].should == 'Required parameter missing: check > check > id [id]'
|
||||
response[:results][0][:result_code].should == '2003'
|
||||
response[:results][0][:msg].should == "Element '{https://epp.tld.ee/schema/contact-eis-1.0.xsd}check': Missing child element(s). Expected is ( {https://epp.tld.ee/schema/contact-eis-1.0.xsd}id )."
|
||||
response[:results][0][:result_code].should == '2001'
|
||||
response[:results].count.should == 1
|
||||
end
|
||||
|
||||
|
@ -887,10 +867,9 @@ describe 'EPP Contact', epp: true do
|
|||
end
|
||||
|
||||
it 'fails if request invalid' do
|
||||
response = epp_plain_request(@epp_xml.info, validate_input: false)
|
||||
response[:results][0][:msg].should ==
|
||||
'Required parameter missing: info > info > id [id]'
|
||||
response[:results][0][:result_code].should == '2003'
|
||||
response = epp_plain_request(@epp_xml.info)
|
||||
response[:results][0][:msg].should == "Element '{https://epp.tld.ee/schema/contact-eis-1.0.xsd}info': Missing child element(s). Expected is ( {https://epp.tld.ee/schema/contact-eis-1.0.xsd}id )."
|
||||
response[:results][0][:result_code].should == '2001'
|
||||
response[:results].count.should == 1
|
||||
end
|
||||
|
||||
|
@ -1013,7 +992,7 @@ describe 'EPP Contact', epp: true do
|
|||
<command>
|
||||
<check>
|
||||
<contact:check
|
||||
xmlns:contact="https://raw.githubusercontent.com/internetee/registry/alpha/doc/schemas/contact-eis-1.0.xsd">
|
||||
xmlns:contact="https://epp.tld.ee/schema/contact-eis-1.0.xsd">
|
||||
<contact:id>FIXED:CHECK-1234</contact:id>
|
||||
<contact:id>check-4321</contact:id>
|
||||
</contact:check>
|
||||
|
@ -1029,7 +1008,7 @@ describe 'EPP Contact', epp: true do
|
|||
<command>
|
||||
<check>
|
||||
<contact:check
|
||||
xmlns:contact="https://raw.githubusercontent.com/internetee/registry/alpha/doc/schemas/contact-eis-1.0.xsd">
|
||||
xmlns:contact="https://epp.tld.ee/schema/contact-eis-1.0.xsd">
|
||||
<contact:id>FIXED:CHECK-LEGACY</contact:id>
|
||||
<contact:id>CID:FIXED:CHECK-LEGACY</contact:id>
|
||||
</contact:check>
|
||||
|
|
|
@ -2,7 +2,7 @@ require 'rails_helper'
|
|||
|
||||
describe 'EPP Domain', epp: true do
|
||||
before(:all) do
|
||||
@xsd = Nokogiri::XML::Schema(File.read('doc/schemas/domain-eis-1.0.xsd'))
|
||||
@xsd = Nokogiri::XML::Schema(File.read('lib/schemas/domain-eis-1.0.xsd'))
|
||||
@epp_xml = EppXml.new(cl_trid: 'ABC-12345')
|
||||
@registrar1 = Fabricate(:registrar1, code: 'REGDOMAIN1')
|
||||
@registrar1.credit!({ sum: 10000 })
|
||||
|
@ -473,17 +473,17 @@ describe 'EPP Domain', epp: true do
|
|||
period: { value: '1', attrs: { unit: '' } }
|
||||
})
|
||||
|
||||
response = epp_plain_request(xml, validate_input: false)
|
||||
response[:results][0][:msg].should == 'Attribute is invalid: unit'
|
||||
response[:results][0][:result_code].should == '2306'
|
||||
response = epp_plain_request(xml)
|
||||
response[:results][0][:msg].should == "Element '{https://epp.tld.ee/schema/domain-eis-1.0.xsd}period', attribute 'unit': [facet 'enumeration'] The value '' is not an element of the set {'y', 'm', 'd'}."
|
||||
response[:results][0][:result_code].should == '2001'
|
||||
|
||||
xml = domain_create_xml({
|
||||
period: { value: '1', attrs: { unit: 'bla' } }
|
||||
})
|
||||
|
||||
response = epp_plain_request(xml, validate_input: false)
|
||||
response[:results][0][:msg].should == 'Attribute is invalid: unit'
|
||||
response[:results][0][:result_code].should == '2306'
|
||||
response = epp_plain_request(xml)
|
||||
response[:results][0][:msg].should == "Element '{https://epp.tld.ee/schema/domain-eis-1.0.xsd}period', attribute 'unit': [facet 'enumeration'] The value 'bla' is not an element of the set {'y', 'm', 'd'}."
|
||||
response[:results][0][:result_code].should == '2001'
|
||||
end
|
||||
|
||||
it 'creates a domain with multiple dnskeys' do
|
||||
|
@ -542,7 +542,6 @@ describe 'EPP Domain', epp: true do
|
|||
end
|
||||
|
||||
it 'does not create a domain when dnskeys are invalid' do
|
||||
|
||||
xml = domain_create_xml({}, {
|
||||
_anonymus: [
|
||||
{ keyData: {
|
||||
|
@ -571,7 +570,40 @@ describe 'EPP Domain', epp: true do
|
|||
]
|
||||
})
|
||||
|
||||
response = epp_plain_request(xml, validate_input: false)
|
||||
response = epp_plain_request(xml)
|
||||
|
||||
response[:results][0][:msg].should == "Element '{urn:ietf:params:xml:ns:secDNS-1.1}pubKey': [facet 'minLength'] The value has a length of '0'; this underruns the allowed minimum length of '1'."
|
||||
response[:results][1][:msg].should == "Element '{urn:ietf:params:xml:ns:secDNS-1.1}pubKey': '' is not a valid value of the atomic type '{urn:ietf:params:xml:ns:secDNS-1.1}keyType'."
|
||||
|
||||
xml = domain_create_xml({}, {
|
||||
_anonymus: [
|
||||
{ keyData: {
|
||||
flags: { value: '250' },
|
||||
protocol: { value: '4' },
|
||||
alg: { value: '9' },
|
||||
pubKey: { value: 'AwEAAddt2AkLfYGKgiEZB5SmIF8EvrjxNMH6HtxWEA4RJ9Ao6LCWheg8' }
|
||||
}
|
||||
},
|
||||
{
|
||||
keyData: {
|
||||
flags: { value: '1' },
|
||||
protocol: { value: '3' },
|
||||
alg: { value: '10' },
|
||||
pubKey: { value: '700b97b591ed27ec2590d19f06f88bba700b97b591ed27ec2590d19f' }
|
||||
}
|
||||
},
|
||||
{
|
||||
keyData: {
|
||||
flags: { value: '256' },
|
||||
protocol: { value: '5' },
|
||||
alg: { value: '254' },
|
||||
pubKey: { value: 'AwEAAbuFiHS4jZL7ZQKvEPBmsbceNHTVYpEVMdxz2A6YCjlZTEoAH3qK' }
|
||||
}
|
||||
}
|
||||
]
|
||||
})
|
||||
|
||||
response = epp_plain_request(xml)
|
||||
|
||||
response[:results][0][:msg].should ==
|
||||
'Valid algorithms are: 3, 5, 6, 7, 8, 252, 253, 254, 255 [alg]'
|
||||
|
@ -589,10 +621,8 @@ describe 'EPP Domain', epp: true do
|
|||
response[:results][4][:msg].should == 'Valid flags are: 0, 256, 257 [flags]'
|
||||
response[:results][4][:value].should == '1'
|
||||
|
||||
response[:results][5][:msg].should == 'Public key is missing [public_key]'
|
||||
|
||||
response[:results][6][:msg].should == 'Valid protocols are: 3 [protocol]'
|
||||
response[:results][6][:value].should == '5'
|
||||
response[:results][5][:msg].should == 'Valid protocols are: 3 [protocol]'
|
||||
response[:results][5][:value].should == '5'
|
||||
end
|
||||
|
||||
it 'does not create a domain with two identical dnskeys' do
|
||||
|
@ -805,10 +835,9 @@ describe 'EPP Domain', epp: true do
|
|||
}]
|
||||
})
|
||||
|
||||
response = epp_plain_request(xml, validate_input: false)
|
||||
response[:msg].should == 'Mutually exclusive parameters: extension > create > keyData, '\
|
||||
'extension > create > dsData'
|
||||
response[:result_code].should == '2306'
|
||||
response = epp_plain_request(xml)
|
||||
response[:msg].should == "Element '{urn:ietf:params:xml:ns:secDNS-1.1}keyData': This element is not expected. Expected is ( {urn:ietf:params:xml:ns:secDNS-1.1}dsData )."
|
||||
response[:result_code].should == '2001'
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -1475,9 +1504,9 @@ describe 'EPP Domain', epp: true do
|
|||
end
|
||||
|
||||
it 'returns an error for incorrect op attribute' do
|
||||
response = epp_plain_request(domain_transfer_xml({}, 'bla'), validate_input: false)
|
||||
response[:msg].should == 'Parameter value range error: op'
|
||||
response[:result_code].should == '2004'
|
||||
response = epp_plain_request(domain_transfer_xml({}, 'bla'))
|
||||
response[:msg].should == "Element '{urn:ietf:params:xml:ns:epp-1.0}transfer', attribute 'op': [facet 'enumeration'] The value 'bla' is not an element of the set {'approve', 'cancel', 'query', 'reject', 'request'}."
|
||||
response[:result_code].should == '2001'
|
||||
end
|
||||
|
||||
it 'creates new pw after successful transfer' do
|
||||
|
@ -2213,10 +2242,9 @@ describe 'EPP Domain', epp: true do
|
|||
]
|
||||
})
|
||||
|
||||
response = epp_plain_request(xml, validate_input: false)
|
||||
response[:results][0][:result_code].should == '2303'
|
||||
response[:results][0][:msg].should == 'Status was not found'
|
||||
response[:results][0][:value].should == 'invalidStatus'
|
||||
response = epp_plain_request(xml)
|
||||
response[:results][0][:msg].should == "Element '{https://epp.tld.ee/schema/domain-eis-1.0.xsd}status', attribute 's': [facet 'enumeration'] The value 'invalidStatus' is not an element of the set {'clientDeleteProhibited', 'clientHold', 'clientRenewProhibited', 'clientTransferProhibited', 'clientUpdateProhibited', 'inactive', 'ok', 'pendingCreate', 'pendingDelete', 'pendingRenew', 'pendingTransfer', 'pendingUpdate', 'serverDeleteProhibited', 'serverHold', 'serverRenewProhibited', 'serverTransferProhibited', 'serverUpdateProhibited'}."
|
||||
response[:results][0][:result_code].should == '2001'
|
||||
end
|
||||
|
||||
### RENEW ###
|
||||
|
@ -2327,9 +2355,9 @@ describe 'EPP Domain', epp: true do
|
|||
period: { value: '1', attrs: { unit: '' } }
|
||||
)
|
||||
|
||||
response = epp_plain_request(xml, validate_input: false)
|
||||
response[:results][0][:msg].should == 'Attribute is invalid: unit'
|
||||
response[:results][0][:result_code].should == '2306'
|
||||
response = epp_plain_request(xml)
|
||||
response[:results][0][:msg].should == "Element '{https://epp.tld.ee/schema/domain-eis-1.0.xsd}period', attribute 'unit': [facet 'enumeration'] The value '' is not an element of the set {'y', 'm', 'd'}."
|
||||
response[:results][0][:result_code].should == '2001'
|
||||
|
||||
xml = @epp_xml.domain.renew(
|
||||
name: { value: domain.name },
|
||||
|
@ -2337,9 +2365,9 @@ describe 'EPP Domain', epp: true do
|
|||
period: { value: '1', attrs: { unit: 'bla' } }
|
||||
)
|
||||
|
||||
response = epp_plain_request(xml, validate_input: false)
|
||||
response[:results][0][:msg].should == 'Attribute is invalid: unit'
|
||||
response[:results][0][:result_code].should == '2306'
|
||||
response = epp_plain_request(xml)
|
||||
response[:results][0][:msg].should == "Element '{https://epp.tld.ee/schema/domain-eis-1.0.xsd}period', attribute 'unit': [facet 'enumeration'] The value 'bla' is not an element of the set {'y', 'm', 'd'}."
|
||||
response[:results][0][:result_code].should == '2001'
|
||||
|
||||
Setting.days_to_renew_domain_before_expire = 90
|
||||
end
|
||||
|
@ -2692,9 +2720,9 @@ describe 'EPP Domain', epp: true do
|
|||
domain.save
|
||||
|
||||
xml = domain_info_xml(name: { value: domain.name, attrs: { hosts: 'invalid' } })
|
||||
response = epp_plain_request(xml, validate_input: false)
|
||||
response[:msg].should == 'Attribute is invalid: hosts'
|
||||
response[:result_code].should == '2306'
|
||||
response = epp_plain_request(xml)
|
||||
response[:msg].should == "Element '{https://epp.tld.ee/schema/domain-eis-1.0.xsd}name', attribute 'hosts': [facet 'enumeration'] The value 'invalid' is not an element of the set {'all', 'del', 'none', 'sub'}."
|
||||
response[:result_code].should == '2001'
|
||||
|
||||
xml = domain_info_xml(name: { value: domain.name, attrs: { hosts: 'sub' } })
|
||||
response = epp_plain_request(xml)
|
||||
|
|
|
@ -12,7 +12,7 @@ describe 'EPP Helper', epp: true do
|
|||
<command>
|
||||
<transfer op="request">
|
||||
<domain:transfer
|
||||
xmlns:domain="https://raw.githubusercontent.com/internetee/registry/alpha/doc/schemas/domain-eis-1.0.xsd">
|
||||
xmlns:domain="https://epp.tld.ee/schema/domain-eis-1.0.xsd">
|
||||
<domain:name>' + dn + '</domain:name>
|
||||
<domain:authInfo>
|
||||
<domain:pw roid="citizen_1234-REP">98oiewslkfkd</domain:pw>
|
||||
|
@ -32,7 +32,7 @@ describe 'EPP Helper', epp: true do
|
|||
<command>
|
||||
<transfer op="approve">
|
||||
<domain:transfer
|
||||
xmlns:domain="https://raw.githubusercontent.com/internetee/registry/alpha/doc/schemas/domain-eis-1.0.xsd">
|
||||
xmlns:domain="https://epp.tld.ee/schema/domain-eis-1.0.xsd">
|
||||
<domain:name>one.ee</domain:name>
|
||||
<domain:authInfo>
|
||||
<domain:pw roid="askdf">test</domain:pw>
|
||||
|
|
|
@ -12,7 +12,7 @@ describe 'EPP Poll', epp: true do
|
|||
end
|
||||
|
||||
before(:all) do
|
||||
@xsd = Nokogiri::XML::Schema(File.read('doc/schemas/epp-1.0.xsd'))
|
||||
@xsd = Nokogiri::XML::Schema(File.read('lib/schemas/epp-1.0.xsd'))
|
||||
Fabricate(:api_user, username: 'registrar1', registrar: registrar1)
|
||||
Fabricate(:api_user, username: 'registrar2', registrar: registrar2)
|
||||
|
||||
|
@ -87,8 +87,8 @@ describe 'EPP Poll', epp: true do
|
|||
})
|
||||
|
||||
response = epp_plain_request(xml, validate_input: false)
|
||||
response[:msg].should == 'Parameter value range error: op'
|
||||
response[:result_code].should == '2004'
|
||||
response[:msg].should == "Element '{urn:ietf:params:xml:ns:epp-1.0}poll', attribute 'op': [facet 'enumeration'] The value 'bla' is not an element of the set {'ack', 'req'}."
|
||||
response[:result_code].should == '2001'
|
||||
end
|
||||
|
||||
it 'dequeues multiple messages' do
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
<command>
|
||||
<create>
|
||||
<contact:create
|
||||
xmlns:contact="https://raw.githubusercontent.com/internetee/registry/alpha/doc/schemas/contact-eis-1.0.xsd">
|
||||
xmlns:contact="https://epp.tld.ee/schema/contact-eis-1.0.xsd">
|
||||
<contact:id>loc_int</contact:id>
|
||||
<contact:postalInfo type="int">
|
||||
<contact:name>John Doe Int</contact:name>
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
<command>
|
||||
<delete>
|
||||
<contact:delete
|
||||
xmlns:contact="https://raw.githubusercontent.com/internetee/registry/alpha/doc/schemas/contact-eis-1.0.xsd">
|
||||
xmlns:contact="https://epp.tld.ee/schema/contact-eis-1.0.xsd">
|
||||
<contact:id>dwa1234</contact:id>
|
||||
</contact:delete>
|
||||
</delete>
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
<command>
|
||||
<delete>
|
||||
<contact:delete
|
||||
xmlns:contact="https://raw.githubusercontent.com/internetee/registry/alpha/doc/schemas/contact-eis-1.0.xsd">
|
||||
xmlns:contact="https://epp.tld.ee/schema/contact-eis-1.0.xsd">
|
||||
</contact:delete>
|
||||
</delete>
|
||||
<clTRID>ABC-12345</clTRID>
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
<command>
|
||||
<info>
|
||||
<contact:info
|
||||
xmlns:contact="https://raw.githubusercontent.com/internetee/registry/alpha/doc/schemas/contact-eis-1.0.xsd">
|
||||
xmlns:contact="https://epp.tld.ee/schema/contact-eis-1.0.xsd">
|
||||
<contact:id>info-4444</contact:id>
|
||||
<contact:authInfo>
|
||||
<contact:pw>2fooBAR</contact:pw>
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
<command>
|
||||
<info>
|
||||
<contact:info
|
||||
xmlns:contact="https://raw.githubusercontent.com/internetee/registry/alpha/doc/schemas/contact-eis-1.0.xsd">
|
||||
xmlns:contact="https://epp.tld.ee/schema/contact-eis-1.0.xsd">
|
||||
</contact:info>
|
||||
</info>
|
||||
<clTRID>ABC-12345</clTRID>
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
<command>
|
||||
<update>
|
||||
<contact:update
|
||||
xmlns:contact="https://raw.githubusercontent.com/internetee/registry/alpha/doc/schemas/contact-eis-1.0.xsd">
|
||||
xmlns:contact="https://epp.tld.ee/schema/contact-eis-1.0.xsd">
|
||||
<contact:id>sh8013</contact:id>
|
||||
<contact:chg>
|
||||
<contact:postalInfo type="int">
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
<command>
|
||||
<update>
|
||||
<contact:update
|
||||
xmlns:contact="https://raw.githubusercontent.com/internetee/registry/alpha/doc/schemas/contact-eis-1.0.xsd">
|
||||
xmlns:contact="https://epp.tld.ee/schema/contact-eis-1.0.xsd">
|
||||
</contact:update>
|
||||
</update>
|
||||
<clTRID>ABC-12345</clTRID>
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
<command>
|
||||
<update>
|
||||
<contact:update
|
||||
xmlns:contact="https://raw.githubusercontent.com/internetee/registry/alpha/doc/schemas/contact-eis-1.0.xsd">
|
||||
xmlns:contact="https://epp.tld.ee/schema/contact-eis-1.0.xsd">
|
||||
<contact:id>sh8013</contact:id>
|
||||
<contact:chg>
|
||||
<contact:voice x="1234">123456798</contact:voice>
|
||||
|
|
|
@ -5,7 +5,7 @@ describe 'EPP Session', epp: true do
|
|||
@api_user = Fabricate(:gitlab_api_user)
|
||||
@epp_xml = EppXml.new(cl_trid: 'ABC-12345')
|
||||
@login_xml_cache = @epp_xml.session.login(clID: { value: 'gitlab' }, pw: { value: 'ghyt9e4fu' })
|
||||
@xsd = Nokogiri::XML::Schema(File.read('doc/schemas/epp-1.0.xsd'))
|
||||
@xsd = Nokogiri::XML::Schema(File.read('lib/schemas/epp-1.0.xsd'))
|
||||
end
|
||||
|
||||
context 'when not connected' do
|
||||
|
@ -51,7 +51,7 @@ describe 'EPP Session', epp: true do
|
|||
end
|
||||
|
||||
it 'prohibits further actions unless logged in' do
|
||||
@xsd = Nokogiri::XML::Schema(File.read('doc/schemas/domain-eis-1.0.xsd'))
|
||||
@xsd = Nokogiri::XML::Schema(File.read('lib/schemas/domain-eis-1.0.xsd'))
|
||||
response = epp_plain_request(@epp_xml.domain.info(name: { value: 'test.ee' }))
|
||||
response[:msg].should == 'You need to login first.'
|
||||
response[:result_code].should == '2002'
|
||||
|
@ -142,8 +142,8 @@ describe 'EPP Session', epp: true do
|
|||
newPW: { value: '' }
|
||||
), validate_input: false)
|
||||
|
||||
response[:msg].should == 'Password is missing [password]'
|
||||
response[:result_code].should == '2306'
|
||||
response[:msg].should == "Element '{urn:ietf:params:xml:ns:epp-1.0}newPW': [facet 'minLength'] The value has a length of '0'; this underruns the allowed minimum length of '6'."
|
||||
response[:result_code].should == '2001'
|
||||
|
||||
@api_user.reload
|
||||
@api_user.password.should == 'ghyt9e4fu'
|
||||
|
|
|
@ -45,7 +45,13 @@ feature 'Contact', type: :feature do
|
|||
visit '/registrar/contacts/new'
|
||||
current_path.should == '/registrar/contacts/new'
|
||||
|
||||
fill_in 'depp_contact_ident', with: 'bic-ident'
|
||||
fill_in 'depp_contact_ident', with: ''
|
||||
fill_in 'depp_contact_name', with: 'Business Name Ltd'
|
||||
fill_in 'depp_contact_email', with: 'example@example.com'
|
||||
fill_in 'depp_contact_street', with: 'Example street 12'
|
||||
fill_in 'depp_contact_city', with: 'Example City'
|
||||
fill_in 'depp_contact_zip', with: '123456'
|
||||
fill_in 'depp_contact_phone', with: '+372.12345678'
|
||||
click_button 'Create'
|
||||
|
||||
current_path.should == '/registrar/contacts'
|
||||
|
|
|
@ -12,6 +12,7 @@ describe ApiUser do
|
|||
@api_user.valid?
|
||||
@api_user.errors.full_messages.should match_array([
|
||||
"Password Password is missing",
|
||||
"Password is too short (minimum is 6 characters)",
|
||||
"Registrar Registrar is missing",
|
||||
"Username Username is missing",
|
||||
"Roles is missing"
|
||||
|
|
|
@ -67,15 +67,15 @@ module Epp
|
|||
|
||||
def epp_plain_request(data, *args)
|
||||
options = args.extract_options!
|
||||
validate_input = options[:validate_input] != false # true by default
|
||||
# validate_input = options[:validate_input] != false # true by default
|
||||
validate_output = options[:validate_output] != false # true by default
|
||||
|
||||
if validate_input && @xsd
|
||||
xml = Nokogiri::XML(data)
|
||||
@xsd.validate(xml).each do |error|
|
||||
fail Exception.new, error.to_s
|
||||
end
|
||||
end
|
||||
# if validate_input && @xsd
|
||||
# xml = Nokogiri::XML(data)
|
||||
# @xsd.validate(xml).each do |error|
|
||||
# fail Exception.new, error.to_s
|
||||
# end
|
||||
# end
|
||||
|
||||
res = parse_response(server.send_request(data))
|
||||
if res
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue