mirror of
https://github.com/internetee/registry.git
synced 2025-05-17 01:47:18 +02:00
Add dnssec test to epp
This commit is contained in:
parent
f90bb8f26e
commit
905ec2efeb
3 changed files with 24 additions and 7 deletions
|
@ -217,6 +217,27 @@ describe 'EPP Domain', epp: true do
|
|||
expect(key.public_key).to eq('AwEAAddt2AkLfYGKgiEZB5SmIF8EvrjxNMH6HtxWEA4RJ9Ao6LCWheg8')
|
||||
end
|
||||
|
||||
it 'creates ria.ee with valid ds record' do
|
||||
xml = domain_create_xml({
|
||||
name: { value: 'ria.ee' }
|
||||
}, {
|
||||
_other: [
|
||||
{ keyData: {
|
||||
flags: { value: '257' },
|
||||
protocol: { value: '3' },
|
||||
alg: { value: '8' },
|
||||
pubKey: { value: 'AwEAAaOf5+lz3ftsL+0CCvfJbhUF/NVsNh8BKo61oYs5fXVbuWDiH872 LC8uKDO92TJy7Q4TF9XMAKMMlf1GMAxlRspD749SOCTN00sqfWx1OMTu a28L1PerwHq7665oDJDKqR71btcGqyLKhe2QDvCdA0mENimF1NudX1BJ DDFi6oOZ0xE/0CuveB64I3ree7nCrwLwNs56kXC4LYoX3XdkOMKiJLL/ MAhcxXa60CdZLoRtTEW3z8/oBq4hEAYMCNclpbd6y/exScwBxFTdUfFk KsdNcmvai1lyk9vna0WQrtpYpHKMXvY9LFHaJxCOLR4umfeQ42RuTd82 lqfU6ClMeXs=' }
|
||||
}
|
||||
}
|
||||
]
|
||||
})
|
||||
|
||||
response = epp_request(xml, :xml)
|
||||
d = Domain.first
|
||||
ds = d.dnskeys.first
|
||||
expect(ds.ds_digest).to eq('0B62D1BC64EFD1EE652FB102BDF1011BF514CCD9A1A0CFB7472AEA3B01F38C92')
|
||||
end
|
||||
|
||||
it 'validates nameserver ipv4 when in same zone as domain' do
|
||||
xml = domain_create_xml({
|
||||
ns: [
|
||||
|
@ -532,7 +553,7 @@ describe 'EPP Domain', epp: true do
|
|||
end
|
||||
|
||||
context 'with valid domain' do
|
||||
before(:each) { Fabricate(:domain, name: 'example.ee', registrar: EppUser.first.registrar) }
|
||||
before(:each) { Fabricate(:domain, name: 'example.ee', registrar: EppUser.first.registrar, dnskeys: []) }
|
||||
|
||||
it 'renews a domain' do
|
||||
exp_date = (Date.today + 1.year)
|
||||
|
|
|
@ -43,7 +43,7 @@ Fabricator(:dnskeys_setting_group, from: :setting_group) do
|
|||
code 'dnskeys'
|
||||
settings do
|
||||
[
|
||||
Fabricate(:setting, code: Setting::DS_ALGORITHM, value: 1),
|
||||
Fabricate(:setting, code: Setting::DS_ALGORITHM, value: 2),
|
||||
Fabricate(:setting, code: Setting::ALLOW_DS_DATA, value: 1),
|
||||
Fabricate(:setting, code: Setting::ALLOW_DS_DATA_WITH_KEYS, value: 1),
|
||||
Fabricate(:setting, code: Setting::ALLOW_KEY_DATA, value: 1)
|
||||
|
|
|
@ -3,16 +3,12 @@ require 'rails_helper'
|
|||
describe Dnskey do
|
||||
before(:each) do
|
||||
Fabricate(:domain_validation_setting_group)
|
||||
|
||||
Fabricate(:setting_group, code: 'dnskeys', settings: [
|
||||
Fabricate(:setting, code: Setting::DS_ALGORITHM, value: 2)
|
||||
])
|
||||
Fabricate(:dnskeys_setting_group)
|
||||
end
|
||||
|
||||
it { should belong_to(:domain) }
|
||||
|
||||
it 'generates digest' do
|
||||
|
||||
d = Fabricate(:domain, name: 'ria.ee')
|
||||
ds = d.dnskeys.first
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue