mirror of
https://github.com/internetee/registry.git
synced 2025-05-17 09:57:23 +02:00
Merge branch 'master' of github.com:domify/registry
This commit is contained in:
commit
fb42ec138e
4 changed files with 18 additions and 11 deletions
|
@ -1,4 +1,4 @@
|
||||||
xml.trID do
|
xml.trID do
|
||||||
xml.clTRID params[:clTRID]
|
xml.clTRID params[:clTRID] if params[:clTRID].present?
|
||||||
xml.svTRID @svTRID
|
xml.svTRID @svTRID
|
||||||
end
|
end
|
||||||
|
|
|
@ -1931,10 +1931,10 @@ describe 'EPP Domain', epp: true do
|
||||||
domain.save
|
domain.save
|
||||||
|
|
||||||
xml = domain_info_xml(name: { value: domain.name })
|
xml = domain_info_xml(name: { value: domain.name })
|
||||||
|
|
||||||
response = epp_plain_request(xml, :xml)
|
response = epp_plain_request(xml, :xml)
|
||||||
response[:results][0][:msg].should == 'Command completed successfully'
|
response[:results][0][:msg].should == 'Command completed successfully'
|
||||||
response[:results][0][:result_code].should == '1000'
|
response[:results][0][:result_code].should == '1000'
|
||||||
|
response[:clTRID].should be_nil
|
||||||
|
|
||||||
inf_data = response[:parsed].css('resData infData')
|
inf_data = response[:parsed].css('resData infData')
|
||||||
inf_data.css('name').text.should == domain.name
|
inf_data.css('name').text.should == domain.name
|
||||||
|
|
|
@ -46,6 +46,13 @@ describe 'EPP Session', epp: true do
|
||||||
response[:clTRID].should == 'ABC-12345'
|
response[:clTRID].should == 'ABC-12345'
|
||||||
end
|
end
|
||||||
|
|
||||||
|
it 'should not have clTRID in response if client does not send it' do
|
||||||
|
epp_xml_no_cltrid = EppXml.new(cl_trid: '')
|
||||||
|
wrong_user = epp_xml_no_cltrid.session.login(clID: { value: 'wrong-user' }, pw: { value: 'ghyt9e4fu' })
|
||||||
|
response = epp_plain_request(wrong_user, :xml)
|
||||||
|
response[:clTRID].should be_nil
|
||||||
|
end
|
||||||
|
|
||||||
context 'with valid user' do
|
context 'with valid user' do
|
||||||
it 'logs in epp user' do
|
it 'logs in epp user' do
|
||||||
response = epp_plain_request(@login_xml_cache, :xml)
|
response = epp_plain_request(@login_xml_cache, :xml)
|
||||||
|
|
|
@ -31,14 +31,14 @@ module Epp
|
||||||
@xml ||= EppXml.new(cl_trid: 'ABC-12345')
|
@xml ||= EppXml.new(cl_trid: 'ABC-12345')
|
||||||
case user
|
case user
|
||||||
when :gitlab
|
when :gitlab
|
||||||
@gitlab_login_xml ||=
|
@gitlab_login_xml ||=
|
||||||
@xml.session.login(clID: { value: 'gitlab' }, pw: { value: 'ghyt9e4fu' })
|
@xml.session.login(clID: { value: 'gitlab' }, pw: { value: 'ghyt9e4fu' })
|
||||||
when :registrar1
|
when :registrar1
|
||||||
@registrar1_login_xml ||=
|
@registrar1_login_xml ||=
|
||||||
@xml.session.login(clID: { value: 'registrar1' }, pw: { value: 'ghyt9e4fu' })
|
@xml.session.login(clID: { value: 'registrar1' }, pw: { value: 'ghyt9e4fu' })
|
||||||
when :registrar2
|
when :registrar2
|
||||||
@registrar2_login_xml ||=
|
@registrar2_login_xml ||=
|
||||||
@xml.session.login(clID: { value: 'registrar2' }, pw: { value: 'ghyt9e4fu' })
|
@xml.session.login(clID: { value: 'registrar2' }, pw: { value: 'ghyt9e4fu' })
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -78,7 +78,7 @@ module Epp
|
||||||
rescue => e
|
rescue => e
|
||||||
e
|
e
|
||||||
end
|
end
|
||||||
|
|
||||||
def server
|
def server
|
||||||
# tag and password not in use, add those at login xml
|
# tag and password not in use, add those at login xml
|
||||||
@server ||= Epp::Server.new({ server: 'localhost', port: 701, tag: '', password: '' })
|
@server ||= Epp::Server.new({ server: 'localhost', port: 701, tag: '', password: '' })
|
||||||
|
@ -89,7 +89,7 @@ module Epp
|
||||||
|
|
||||||
obj = {
|
obj = {
|
||||||
results: [],
|
results: [],
|
||||||
clTRID: res.css('epp trID clTRID').text,
|
clTRID: res.css('epp trID clTRID').first.try(:text),
|
||||||
parsed: res.remove_namespaces!,
|
parsed: res.remove_namespaces!,
|
||||||
raw: raw
|
raw: raw
|
||||||
}
|
}
|
||||||
|
@ -127,7 +127,7 @@ module Epp
|
||||||
|
|
||||||
xml_params = defaults.deep_merge(xml_params)
|
xml_params = defaults.deep_merge(xml_params)
|
||||||
|
|
||||||
epp_xml = EppXml::Domain.new(cl_trid: 'ABC-12345')
|
epp_xml = EppXml::Domain.new(cl_trid: '')
|
||||||
epp_xml.info(xml_params)
|
epp_xml.info(xml_params)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue