mirror of
https://github.com/internetee/registry.git
synced 2025-08-04 00:42:04 +02:00
Add ip validation to nameserver
This commit is contained in:
parent
38f0528d70
commit
da950f5df7
6 changed files with 49 additions and 5 deletions
|
@ -92,6 +92,12 @@ describe 'EPP Domain', epp: true do
|
|||
ns = Domain.first.nameservers.first
|
||||
expect(ns.ip).to eq('192.0.2.2')
|
||||
end
|
||||
|
||||
it 'returns error when nameserver has invalid ip' do
|
||||
response = epp_request('domains/create_w_invalid_ns_ip.xml')
|
||||
expect(response[:results][0][:result_code]).to eq '2005'
|
||||
expect(response[:results][0][:msg]).to eq 'IP is invalid'
|
||||
end
|
||||
end
|
||||
|
||||
context 'with juridical persion as an owner' do
|
||||
|
|
29
spec/epp/requests/domains/create_w_invalid_ns_ip.xml
Normal file
29
spec/epp/requests/domains/create_w_invalid_ns_ip.xml
Normal file
|
@ -0,0 +1,29 @@
|
|||
<?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: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