mirror of
https://github.com/internetee/registry.git
synced 2025-05-17 17:59:47 +02:00
Add dnssec info to domain info query
This commit is contained in:
parent
338a58a611
commit
c8863df4c5
4 changed files with 65 additions and 21 deletions
|
@ -36,6 +36,17 @@ xml.epp_head do
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
xml.tag!('domain:dnssec') do
|
||||||
|
@domain.dnskeys.each do |x|
|
||||||
|
xml.tag!('domain:dnskey') do
|
||||||
|
xml.tag!('domain:flags', x.flags)
|
||||||
|
xml.tag!('domain:protocol', x.protocol)
|
||||||
|
xml.tag!('domain:alg', x.alg)
|
||||||
|
xml.tag!('domain:pubKey', x.public_key)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end if @domain.dnskeys.any?
|
||||||
|
|
||||||
## TODO Find out what this domain:host is all about
|
## TODO Find out what this domain:host is all about
|
||||||
|
|
||||||
xml.tag!('domain:clID', @domain.owner_contact_code)
|
xml.tag!('domain:clID', @domain.owner_contact_code)
|
||||||
|
|
|
@ -504,6 +504,9 @@ describe 'EPP Domain', epp: true do
|
||||||
d = Domain.first
|
d = Domain.first
|
||||||
d.domain_statuses.build(value: DomainStatus::CLIENT_HOLD, description: 'Payment overdue.')
|
d.domain_statuses.build(value: DomainStatus::CLIENT_HOLD, description: 'Payment overdue.')
|
||||||
d.nameservers.build(hostname: 'ns1.example.com', ipv4: '192.168.1.1', ipv6: '1080:0:0:0:8:800:200C:417A')
|
d.nameservers.build(hostname: 'ns1.example.com', ipv4: '192.168.1.1', ipv6: '1080:0:0:0:8:800:200C:417A')
|
||||||
|
|
||||||
|
d.dnskeys.build(flags: 257, protocol: 3, alg: 3, public_key: 'AwEAAddt2AkLfYGKgiEZB5SmIF8EvrjxNMH6HtxWEA4RJ9Ao6LCWheg8')
|
||||||
|
d.dnskeys.build(flags: 0, protocol: 3, alg: 5, public_key: '700b97b591ed27ec2590d19f06f88bba700b97b591ed27ec2590d19f')
|
||||||
d.save
|
d.save
|
||||||
|
|
||||||
response = epp_request(domain_info_xml, :xml)
|
response = epp_request(domain_info_xml, :xml)
|
||||||
|
@ -531,9 +534,20 @@ describe 'EPP Domain', epp: true do
|
||||||
expect(inf_data.css('hostAddr').last.text).to eq('1080:0:0:0:8:800:200C:417A')
|
expect(inf_data.css('hostAddr').last.text).to eq('1080:0:0:0:8:800:200C:417A')
|
||||||
expect(inf_data.css('crDate').text).to eq(d.created_at.to_time.utc.to_s)
|
expect(inf_data.css('crDate').text).to eq(d.created_at.to_time.utc.to_s)
|
||||||
expect(inf_data.css('exDate').text).to eq(d.valid_to.to_time.utc.to_s)
|
expect(inf_data.css('exDate').text).to eq(d.valid_to.to_time.utc.to_s)
|
||||||
|
|
||||||
expect(inf_data.css('pw').text).to eq(d.auth_info)
|
expect(inf_data.css('pw').text).to eq(d.auth_info)
|
||||||
|
|
||||||
|
dnskey_1 = inf_data.css('dnskey')[0]
|
||||||
|
expect(dnskey_1.css('flags').first.text).to eq('257')
|
||||||
|
expect(dnskey_1.css('protocol').first.text).to eq('3')
|
||||||
|
expect(dnskey_1.css('alg').first.text).to eq('3')
|
||||||
|
expect(dnskey_1.css('pubKey').first.text).to eq('AwEAAddt2AkLfYGKgiEZB5SmIF8EvrjxNMH6HtxWEA4RJ9Ao6LCWheg8')
|
||||||
|
|
||||||
|
dnskey_2 = inf_data.css('dnskey')[1]
|
||||||
|
expect(dnskey_2.css('flags').first.text).to eq('0')
|
||||||
|
expect(dnskey_2.css('protocol').first.text).to eq('3')
|
||||||
|
expect(dnskey_2.css('alg').first.text).to eq('5')
|
||||||
|
expect(dnskey_2.css('pubKey').first.text).to eq('700b97b591ed27ec2590d19f06f88bba700b97b591ed27ec2590d19f')
|
||||||
|
|
||||||
d.touch
|
d.touch
|
||||||
|
|
||||||
response = epp_request(domain_info_xml, :xml)
|
response = epp_request(domain_info_xml, :xml)
|
||||||
|
|
|
@ -16,6 +16,14 @@ describe 'EPP Helper', epp: true do
|
||||||
<domain:hostObj>ns2.example.net</domain:hostObj>
|
<domain:hostObj>ns2.example.net</domain:hostObj>
|
||||||
</domain:ns>
|
</domain:ns>
|
||||||
<domain:registrant>jd1234</domain:registrant>
|
<domain:registrant>jd1234</domain:registrant>
|
||||||
|
<domain:dnssec>
|
||||||
|
<domain:dnskey>
|
||||||
|
<domain:flags>257</domain:flags>
|
||||||
|
<domain:protocol>3</domain:protocol>
|
||||||
|
<domain:alg>5</domain:alg>
|
||||||
|
<domain:pubKey>AwEAAddt2AkLfYGKgiEZB5SmIF8EvrjxNMH6HtxWEA4RJ9Ao6LCWheg8</domain:pubKey>
|
||||||
|
</domain:dnskey>
|
||||||
|
</domain:dnssec>
|
||||||
<domain:contact type="admin">sh8013</domain:contact>
|
<domain:contact type="admin">sh8013</domain:contact>
|
||||||
<domain:contact type="tech">sh8013</domain:contact>
|
<domain:contact type="tech">sh8013</domain:contact>
|
||||||
<domain:contact type="tech">sh801333</domain:contact>
|
<domain:contact type="tech">sh801333</domain:contact>
|
||||||
|
@ -44,6 +52,14 @@ describe 'EPP Helper', epp: true do
|
||||||
<domain:hostObj>ns2.test.net</domain:hostObj>
|
<domain:hostObj>ns2.test.net</domain:hostObj>
|
||||||
</domain:ns>
|
</domain:ns>
|
||||||
<domain:registrant>32fsdaf</domain:registrant>
|
<domain:registrant>32fsdaf</domain:registrant>
|
||||||
|
<domain:dnssec>
|
||||||
|
<domain:dnskey>
|
||||||
|
<domain:flags>257</domain:flags>
|
||||||
|
<domain:protocol>3</domain:protocol>
|
||||||
|
<domain:alg>5</domain:alg>
|
||||||
|
<domain:pubKey>AwEAAddt2AkLfYGKgiEZB5SmIF8EvrjxNMH6HtxWEA4RJ9Ao6LCWheg8</domain:pubKey>
|
||||||
|
</domain:dnskey>
|
||||||
|
</domain:dnssec>
|
||||||
<domain:contact type="admin">2323rafaf</domain:contact>
|
<domain:contact type="admin">2323rafaf</domain:contact>
|
||||||
<domain:contact type="tech">3dgxx</domain:contact>
|
<domain:contact type="tech">3dgxx</domain:contact>
|
||||||
<domain:contact type="tech">345xxv</domain:contact>
|
<domain:contact type="tech">345xxv</domain:contact>
|
||||||
|
@ -54,18 +70,20 @@ describe 'EPP Helper', epp: true do
|
||||||
</epp>
|
</epp>
|
||||||
').to_s.squish
|
').to_s.squish
|
||||||
|
|
||||||
xml = domain_create_xml(
|
xml = domain_create_xml({
|
||||||
name: 'one.ee',
|
name: { value: 'one.ee' },
|
||||||
period_value: '345',
|
period: {value: '345', attrs: { unit: 'd' } },
|
||||||
period_unit: 'd',
|
ns: [
|
||||||
nameservers: [{ hostObj: 'ns1.test.net' }, { hostObj: 'ns2.test.net' }],
|
{ hostObj: {value: 'ns1.test.net' } },
|
||||||
registrant: '32fsdaf',
|
{ hostObj: {value: 'ns2.test.net' } }
|
||||||
contacts: [
|
],
|
||||||
{ contact_value: '2323rafaf', contact_type: 'admin' },
|
registrant: { value: '32fsdaf' },
|
||||||
{ contact_value: '3dgxx', contact_type: 'tech' },
|
_other: [
|
||||||
{ contact_value: '345xxv', contact_type: 'tech' }
|
{ contact: {value: '2323rafaf', attrs: { type: 'admin' } } },
|
||||||
|
{ contact: {value: '3dgxx', attrs: { type: 'tech' } } },
|
||||||
|
{ contact: {value: '345xxv', attrs: { type: 'tech' } } }
|
||||||
]
|
]
|
||||||
)
|
})
|
||||||
|
|
||||||
generated = Nokogiri::XML(xml).to_s.squish
|
generated = Nokogiri::XML(xml).to_s.squish
|
||||||
expect(generated).to eq(expected)
|
expect(generated).to eq(expected)
|
||||||
|
@ -86,13 +104,14 @@ describe 'EPP Helper', epp: true do
|
||||||
</epp>
|
</epp>
|
||||||
').to_s.squish
|
').to_s.squish
|
||||||
|
|
||||||
xml = domain_create_xml(
|
xml = domain_create_xml({
|
||||||
name: 'one.ee',
|
name: { value: 'one.ee' },
|
||||||
period: false,
|
period: nil,
|
||||||
nameservers: [],
|
ns: nil,
|
||||||
registrant: false,
|
registrant: nil,
|
||||||
contacts: []
|
_other: nil,
|
||||||
)
|
dnssec: nil
|
||||||
|
})
|
||||||
|
|
||||||
generated = Nokogiri::XML(xml).to_s.squish
|
generated = Nokogiri::XML(xml).to_s.squish
|
||||||
expect(generated).to eq(expected)
|
expect(generated).to eq(expected)
|
||||||
|
|
|
@ -58,8 +58,8 @@ module Epp
|
||||||
name: { value: 'example.ee' },
|
name: { value: 'example.ee' },
|
||||||
period: { value: '1', attrs: { unit: 'y' } },
|
period: { value: '1', attrs: { unit: 'y' } },
|
||||||
ns: [
|
ns: [
|
||||||
{ hostObj: { value: 'ns1.example.com' } },
|
{ hostObj: { value: 'ns1.example.net' } },
|
||||||
{ hostObj: { value: 'ns2.example.com' } }
|
{ hostObj: { value: 'ns2.example.net' } }
|
||||||
],
|
],
|
||||||
registrant: { value: 'jd1234' },
|
registrant: { value: 'jd1234' },
|
||||||
dnssec: [
|
dnssec: [
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue