mirror of
https://github.com/internetee/registry.git
synced 2025-06-12 15:44:45 +02:00
Merge pull request #2047 from internetee/2033-adding-unsupported-dnskey-alg-response
fixed dnskey invalid alg response
This commit is contained in:
commit
33bbc0ed42
3 changed files with 38 additions and 4 deletions
|
@ -34,9 +34,12 @@ class Dnskey < ApplicationRecord
|
||||||
def epp_code_map
|
def epp_code_map
|
||||||
{
|
{
|
||||||
'2005' => [
|
'2005' => [
|
||||||
[:alg, :invalid, { value: { obj: 'alg', val: alg }, values: ALGORITHMS.join(', ') }],
|
[:alg, :invalid, { value: { obj: 'alg', val: alg },
|
||||||
[:protocol, :invalid, { value: { obj: 'protocol', val: protocol }, values: PROTOCOLS.join(', ') }],
|
values: "Valid algorithms are: #{ALGORITHMS.join(', ')}" }],
|
||||||
[:flags, :invalid, { value: { obj: 'flags', val: flags }, values: FLAGS.join(', ') }]
|
[:protocol, :invalid, { value: { obj: 'protocol', val: protocol },
|
||||||
|
values: "Valid protocols are: #{PROTOCOLS.join(', ')}" }],
|
||||||
|
[:flags, :invalid, { value: { obj: 'flags', val: flags },
|
||||||
|
values: "Valid protocols are: #{PROTOCOLS.join(', ')}" }],
|
||||||
],
|
],
|
||||||
'2302' => [
|
'2302' => [
|
||||||
[:public_key, :taken, { value: { obj: 'pubKey', val: public_key } }]
|
[:public_key, :taken, { value: { obj: 'pubKey', val: public_key } }]
|
||||||
|
|
|
@ -123,7 +123,7 @@ en:
|
||||||
dnskey:
|
dnskey:
|
||||||
attributes:
|
attributes:
|
||||||
alg:
|
alg:
|
||||||
invalid: 'Valid algorithms are: %{values}'
|
invalid: '%{values}'
|
||||||
blank: 'Algorithm is missing'
|
blank: 'Algorithm is missing'
|
||||||
protocol:
|
protocol:
|
||||||
invalid: 'Valid protocols are: %{values}'
|
invalid: 'Valid protocols are: %{values}'
|
||||||
|
|
|
@ -17,6 +17,37 @@ class EppDomainUpdateBaseTest < EppTestCase
|
||||||
@original_registrant_change_verification
|
@original_registrant_change_verification
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def test_update_dnskey_with_invalid_alg
|
||||||
|
request_xml = <<~XML
|
||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
|
<epp xmlns="#{Xsd::Schema.filename(for_prefix: 'epp-ee')}">
|
||||||
|
<command>
|
||||||
|
<update>
|
||||||
|
<domain:update xmlns:domain="#{Xsd::Schema.filename(for_prefix: 'domain-ee')}">
|
||||||
|
<domain:name>shop.test</domain:name>
|
||||||
|
</domain:update>
|
||||||
|
</update>
|
||||||
|
<extension>
|
||||||
|
<secDNS:update xmlns:secDNS="urn:ietf:params:xml:ns:secDNS-1.1">
|
||||||
|
<secDNS:add><secDNS:keyData>
|
||||||
|
<secDNS:flags>257</secDNS:flags>
|
||||||
|
<secDNS:protocol>3</secDNS:protocol>
|
||||||
|
<secDNS:alg>666</secDNS:alg>
|
||||||
|
<secDNS:pubKey>P25MwGXr2sTbxdOIKRNbSC8bUO2CObo4/T8kMFoKcgs=</secDNS:pubKey>
|
||||||
|
</secDNS:keyData></secDNS:add>
|
||||||
|
</secDNS:update>
|
||||||
|
</extension>
|
||||||
|
</command>
|
||||||
|
</epp>
|
||||||
|
XML
|
||||||
|
|
||||||
|
post epp_update_path, params: { frame: request_xml },
|
||||||
|
headers: { 'HTTP_COOKIE' => 'session=api_bestnames' }
|
||||||
|
response_xml = Nokogiri::XML(response.body)
|
||||||
|
assert_correct_against_schema response_xml
|
||||||
|
assert_epp_response :parameter_value_syntax_error
|
||||||
|
end
|
||||||
|
|
||||||
def test_update_domain
|
def test_update_domain
|
||||||
request_xml = <<-XML
|
request_xml = <<-XML
|
||||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue