mirror of
https://github.com/internetee/registry.git
synced 2025-08-06 01:35:10 +02:00
Require legalDocument on domain create
This commit is contained in:
parent
4aaef3f80b
commit
56c923c988
5 changed files with 57 additions and 10 deletions
|
@ -67,11 +67,10 @@ module Epp::Common
|
|||
def epp_request_valid?(*selectors)
|
||||
selectors.each do |selector|
|
||||
el = parsed_frame.css(selector).first
|
||||
next unless el
|
||||
epp_errors << {
|
||||
code: '2003',
|
||||
msg: I18n.t('errors.messages.required_parameter_missing', key: el.name)
|
||||
} unless el.text.present?
|
||||
msg: I18n.t('errors.messages.required_parameter_missing', key: el.try(:name) || selector)
|
||||
} if el.nil? || el.text.blank?
|
||||
end
|
||||
|
||||
epp_errors.empty?
|
||||
|
|
|
@ -100,9 +100,8 @@ module Epp::DomainsHelper
|
|||
def validate_domain_create_request
|
||||
ret = true
|
||||
|
||||
@ph = params_hash['epp']['command']['create']['create']
|
||||
# TODO: Verify contact presence if registrant is juridical
|
||||
attrs_present = xml_attrs_present?(@ph, [['name'], ['ns'], ['registrant']])
|
||||
attrs_present = epp_request_valid?('name', 'ns', 'registrant', 'legalDocument')
|
||||
ret = false unless attrs_present
|
||||
|
||||
if parsed_frame.css('hostObj').any?
|
||||
|
|
|
@ -16,7 +16,7 @@ module Epp::KeyrelayHelper
|
|||
private
|
||||
|
||||
def validate_keyrelay_request
|
||||
epp_request_valid?('pubKey', 'flags', 'protocol', 'algorithm', 'name', 'pw')
|
||||
epp_request_valid?('pubKey', 'flags', 'protocol', 'alg', 'name', 'pw')
|
||||
|
||||
begin
|
||||
abs_datetime = parsed_frame.css('absolute').text
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue