mirror of
https://github.com/internetee/registry.git
synced 2025-07-20 09:46:09 +02:00
updated error handler
This commit is contained in:
parent
9e02335452
commit
1c1c28a55c
1 changed files with 13 additions and 9 deletions
|
@ -21,7 +21,7 @@ module Actions
|
||||||
end
|
end
|
||||||
|
|
||||||
def validate_dnskey
|
def validate_dnskey
|
||||||
domain = Domain.find_by(name: @params[:domain])
|
# domain = Domain.find_by(name: @params[:domain])
|
||||||
dns = prepare_resolver
|
dns = prepare_resolver
|
||||||
update_params_info = parse_data_from_update_request(@params[:dns_keys][0])
|
update_params_info = parse_data_from_update_request(@params[:dns_keys][0])
|
||||||
|
|
||||||
|
@ -45,6 +45,7 @@ module Actions
|
||||||
end
|
end
|
||||||
|
|
||||||
def parse_data_from_zonefile(dns_resolver:, hostname:)
|
def parse_data_from_zonefile(dns_resolver:, hostname:)
|
||||||
|
begin
|
||||||
alg = dns_resolver.query(hostname, 'DS').answer[0].rdata[1]
|
alg = dns_resolver.query(hostname, 'DS').answer[0].rdata[1]
|
||||||
result = dns_resolver.query(hostname, 'DNSKEY').answer
|
result = dns_resolver.query(hostname, 'DNSKEY').answer
|
||||||
|
|
||||||
|
@ -55,6 +56,9 @@ module Actions
|
||||||
algorithm: alg.to_s,
|
algorithm: alg.to_s,
|
||||||
protocol: result[0].protocol.to_s,
|
protocol: result[0].protocol.to_s,
|
||||||
}
|
}
|
||||||
|
rescue Dnsruby::NXDomain
|
||||||
|
domain.add_epp_error('2308', nil, nil, I18n.t(:dns_policy_violation))
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def prepare_resolver
|
def prepare_resolver
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue