mirror of
https://github.com/internetee/registry.git
synced 2025-08-03 00:12:03 +02:00
Tests working with dnssec
This commit is contained in:
parent
eaa553dc9d
commit
79d2b69809
5 changed files with 28 additions and 52 deletions
|
@ -66,6 +66,12 @@ class Epp::EppDomain < Domain
|
|||
errors.empty?
|
||||
end
|
||||
|
||||
def parse_and_detach_ds_data(parsed_frame)
|
||||
detach_dnskeys(self.class.parse_dnskeys_from_frame(parsed_frame))
|
||||
|
||||
errors.empty?
|
||||
end
|
||||
|
||||
def parse_and_update_domain_dependencies(parsed_frame)
|
||||
owner_contact_code = parsed_frame.css('registrant').try(:text)
|
||||
attach_owner_contact(owner_contact_code) if owner_contact_code.present?
|
||||
|
@ -235,6 +241,21 @@ class Epp::EppDomain < Domain
|
|||
end
|
||||
end
|
||||
|
||||
if dnssec_data[:key_data].any? && !key_data_allowed
|
||||
errors.add(:base, :key_data_not_allowed)
|
||||
return
|
||||
end
|
||||
|
||||
to_delete = []
|
||||
dnssec_data[:key_data].each do |x|
|
||||
ds = dnskeys.where(public_key: x[:public_key])
|
||||
if ds.blank?
|
||||
add_epp_error('2303', 'publicKey', x[:public_key], [:dnskeys, :not_found])
|
||||
else
|
||||
to_delete << ds
|
||||
end
|
||||
end
|
||||
|
||||
dnskeys.delete(to_delete)
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue