mirror of
https://github.com/internetee/registry.git
synced 2025-07-25 20:18:22 +02:00
Merge branch 'master' of github.com:internetee/registry
Conflicts: app/views/client/domain_versions/show.haml
This commit is contained in:
commit
6aa82dd222
47 changed files with 138 additions and 1229 deletions
|
@ -273,8 +273,16 @@ describe 'EPP Domain', epp: true do
|
|||
it 'validates nameserver ipv4 when in same zone as domain' do
|
||||
xml = domain_create_xml({
|
||||
ns: [
|
||||
{ hostObj: { value: 'ns1.example.ee' } },
|
||||
{ hostObj: { value: 'ns2.example.ee' } }
|
||||
{
|
||||
hostAttr: [
|
||||
{ hostName: { value: 'ns1.example.ee' } }
|
||||
]
|
||||
},
|
||||
{
|
||||
hostAttr: {
|
||||
hostName: { value: 'ns2.example.ee' }
|
||||
}
|
||||
}
|
||||
]
|
||||
})
|
||||
|
||||
|
@ -319,7 +327,13 @@ describe 'EPP Domain', epp: true do
|
|||
|
||||
it 'does not create domain with too many nameservers' do
|
||||
nameservers = []
|
||||
14.times { |i| nameservers << { hostObj: { value: "ns#{i}.example.net" } } }
|
||||
14.times do |i|
|
||||
nameservers << {
|
||||
hostAttr: {
|
||||
hostName: { value: "ns#{i}.example.net" }
|
||||
}
|
||||
}
|
||||
end
|
||||
xml = domain_create_xml(ns: nameservers)
|
||||
|
||||
response = epp_request(xml, :xml)
|
||||
|
@ -330,10 +344,17 @@ describe 'EPP Domain', epp: true do
|
|||
it 'returns error when invalid nameservers are present' do
|
||||
xml = domain_create_xml({
|
||||
ns: [
|
||||
{ hostObj: { value: 'invalid1-' } },
|
||||
{ hostObj: { value: '-invalid2' } }
|
||||
{
|
||||
hostAttr: {
|
||||
hostName: { value: 'invalid1-' }
|
||||
}
|
||||
},
|
||||
{
|
||||
hostAttr: {
|
||||
hostName: { value: '-invalid2' }
|
||||
}
|
||||
}
|
||||
]
|
||||
|
||||
})
|
||||
|
||||
response = epp_request(xml, :xml)
|
||||
|
@ -341,8 +362,25 @@ describe 'EPP Domain', epp: true do
|
|||
expect(response[:msg]).to eq('Hostname is invalid')
|
||||
end
|
||||
|
||||
it 'does not allow hostObj' do
|
||||
xml = domain_create_xml({
|
||||
ns: [
|
||||
{
|
||||
hostObj: { value: 'ns1.example.ee' }
|
||||
},
|
||||
{
|
||||
hostObj: { value: 'ns2.example.ee' }
|
||||
}
|
||||
]
|
||||
})
|
||||
|
||||
response = epp_request(xml, :xml)
|
||||
expect(response[:result_code]).to eq('2306')
|
||||
expect(response[:msg]).to eq('hostObj object is not allowed')
|
||||
end
|
||||
|
||||
it 'creates domain with nameservers with ips' do
|
||||
epp_request('domains/create_w_host_attrs.xml')
|
||||
epp_request(domain_create_with_host_attrs, :xml)
|
||||
expect(Domain.first.nameservers.count).to eq(2)
|
||||
ns = Domain.first.nameservers.first
|
||||
expect(ns.ipv4).to eq('192.0.2.2')
|
||||
|
@ -350,7 +388,7 @@ describe 'EPP Domain', epp: true do
|
|||
end
|
||||
|
||||
it 'returns error when nameserver has invalid ips' do
|
||||
response = epp_request('domains/create_w_invalid_ns_ip.xml')
|
||||
response = epp_request(domain_create_with_invalid_ns_ip_xml, :xml)
|
||||
expect(response[:results][0][:result_code]).to eq '2005'
|
||||
expect(response[:results][0][:msg]).to eq 'IPv4 is invalid'
|
||||
expect(response[:results][0][:value]).to eq '192.0.2.2.invalid'
|
||||
|
|
|
@ -1,30 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<epp xmlns="urn:ietf:params:xml:ns:epp-1.0">
|
||||
<command>
|
||||
<create>
|
||||
<domain:create
|
||||
xmlns:domain="urn:ietf:params:xml:ns:domain-1.0">
|
||||
<domain:name>example.ee</domain:name>
|
||||
<domain:period unit="y">1</domain:period>
|
||||
<domain:ns>
|
||||
<domain:hostAttr>
|
||||
<domain:hostName>ns1.example.net</domain:hostName>
|
||||
<domain:hostAddr ip="v4">192.0.2.2</domain:hostAddr>
|
||||
<domain:hostAddr ip="v6">1080:0:0:0:8:800:200C:417A</domain:hostAddr>
|
||||
</domain:hostAttr>
|
||||
<domain:hostAttr>
|
||||
<domain:hostName>ns2.example.net</domain:hostName>
|
||||
</domain:hostAttr>
|
||||
</domain:ns>
|
||||
<domain:registrant>jd1234</domain:registrant>
|
||||
<domain:contact type="admin">sh8013</domain:contact>
|
||||
<domain:contact type="tech">sh8013</domain:contact>
|
||||
<domain:contact type="tech">sh801333</domain:contact>
|
||||
<domain:authInfo>
|
||||
<domain:pw>2fooBAR</domain:pw>
|
||||
</domain:authInfo>
|
||||
</domain:create>
|
||||
</create>
|
||||
<clTRID>ABC-12345</clTRID>
|
||||
</command>
|
||||
</epp>
|
|
@ -1,30 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<epp xmlns="urn:ietf:params:xml:ns:epp-1.0">
|
||||
<command>
|
||||
<create>
|
||||
<domain:create
|
||||
xmlns:domain="urn:ietf:params:xml:ns:domain-1.0">
|
||||
<domain:name>example.ee</domain:name>
|
||||
<domain:period unit="y">1</domain:period>
|
||||
<domain:ns>
|
||||
<domain:hostAttr>
|
||||
<domain:hostName>ns1.example.net</domain:hostName>
|
||||
<domain:hostAddr ip="v4">192.0.2.2.invalid</domain:hostAddr>
|
||||
</domain:hostAttr>
|
||||
<domain:hostAttr>
|
||||
<domain:hostName>ns2.example.net</domain:hostName>
|
||||
<domain:hostAddr ip="v6">invalid_ipv6</domain:hostAddr>
|
||||
</domain:hostAttr>
|
||||
</domain:ns>
|
||||
<domain:registrant>jd1234</domain:registrant>
|
||||
<domain:contact type="admin">sh8013</domain:contact>
|
||||
<domain:contact type="tech">sh8013</domain:contact>
|
||||
<domain:contact type="tech">sh801333</domain:contact>
|
||||
<domain:authInfo>
|
||||
<domain:pw>2fooBAR</domain:pw>
|
||||
</domain:authInfo>
|
||||
</domain:create>
|
||||
</create>
|
||||
<clTRID>ABC-12345</clTRID>
|
||||
</command>
|
||||
</epp>
|
Loading…
Add table
Add a link
Reference in a new issue