mirror of
https://github.com/internetee/registry.git
synced 2025-08-04 08:52:04 +02:00
Replace hostObj with hostAttr
This commit is contained in:
parent
1d7b289a10
commit
e0c22db7b1
5 changed files with 356 additions and 313 deletions
|
@ -128,14 +128,9 @@ class Epp::DomainsController < EppController
|
|||
ret = true
|
||||
|
||||
# TODO: Verify contact presence if registrant is juridical
|
||||
attrs_present = epp_request_valid?('name', 'ns', 'registrant', 'legalDocument')
|
||||
attrs_present = epp_request_valid?('name', 'ns', 'registrant', 'legalDocument', 'hostAttr')
|
||||
ret = false unless attrs_present
|
||||
|
||||
if params[:parsed_frame].css('hostObj').any?
|
||||
epp_errors << { code: '2306', msg: I18n.t('host_obj_is_not_allowed') }
|
||||
ret = false
|
||||
end
|
||||
|
||||
if params[:parsed_frame].css('dsData').count > 0 && params[:parsed_frame].css('create > keyData').count > 0
|
||||
epp_errors << { code: '2306', msg: I18n.t('ds_data_and_key_data_must_not_exists_together') }
|
||||
ret = false
|
||||
|
|
|
@ -177,7 +177,7 @@ class Epp::EppDomain < Domain
|
|||
ns_list.each do |ns_attrs|
|
||||
nameserver = nameservers.where(ns_attrs)
|
||||
if nameserver.blank?
|
||||
add_epp_error('2303', 'hostObj', ns_attrs[:hostname], [:nameservers, :not_found])
|
||||
add_epp_error('2303', 'hostAttr', ns_attrs[:hostname], [:nameservers, :not_found])
|
||||
else
|
||||
to_delete << nameserver
|
||||
end
|
||||
|
@ -509,12 +509,6 @@ class Epp::EppDomain < Domain
|
|||
res << host_attr.delete_if { |_k, v| v.blank? }
|
||||
end
|
||||
|
||||
parsed_frame.css('hostObj').each do |x|
|
||||
res << {
|
||||
hostname: x.text
|
||||
}
|
||||
end
|
||||
|
||||
res
|
||||
end
|
||||
|
||||
|
|
|
@ -21,10 +21,10 @@ class Nameserver < ActiveRecord::Base
|
|||
def epp_code_map
|
||||
{
|
||||
'2302' => [
|
||||
[:hostname, :taken, { value: { obj: 'hostObj', val: hostname } }]
|
||||
[:hostname, :taken, { value: { obj: 'hostAttr', val: hostname } }]
|
||||
],
|
||||
'2005' => [
|
||||
[:hostname, :invalid, { value: { obj: 'hostObj', val: hostname } }],
|
||||
[:hostname, :invalid, { value: { obj: 'hostAttr', val: hostname } }],
|
||||
[:ipv4, :invalid, { value: { obj: 'hostAddr', val: ipv4 } }],
|
||||
[:ipv6, :invalid, { value: { obj: 'hostAddr', val: ipv6 } }]
|
||||
],
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue