Merge pull request #1364 from internetee/limit-epp-routes

Limit EPP routes
This commit is contained in:
Timo Võhmar 2019-10-16 16:34:28 +03:00 committed by GitHub
commit 60a98c2793
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
26 changed files with 145 additions and 120 deletions

View file

@ -1,14 +1,39 @@
require_dependency 'epp_constraint' require_dependency 'epp_constraint'
Rails.application.routes.draw do Rails.application.routes.draw do
namespace(:epp, defaults: { format: :xml }) do # https://github.com/internetee/epp_proxy#translation-of-epp-calls
match 'session/:action', controller: 'sessions', via: :all, constraints: EppConstraint.new(:session) namespace :epp do
constraints(EppConstraint.new(:session)) do
get 'session/hello', to: 'sessions#hello', as: 'hello'
post 'session/login', to: 'sessions#login', as: 'login'
post 'session/logout', to: 'sessions#logout', as: 'logout'
end
post 'command/:action', controller: 'domains', constraints: EppConstraint.new(:domain) constraints(EppConstraint.new(:contact)) do
post 'command/:action', controller: 'contacts', constraints: EppConstraint.new(:contact) controller('contacts') do
post 'command/poll', to: 'polls#poll', constraints: EppConstraint.new(:poll) post 'command/create', action: 'create', as: :create
post 'command/keyrelay', to: 'keyrelays#keyrelay', constraints: EppConstraint.new(:keyrelay) post 'command/update', action: 'update', as: :update
post 'command/info', action: 'info', as: :info
post 'command/check', action: 'check', as: :check
post 'command/transfer', action: 'transfer', as: :transfer
post 'command/renew', action: 'renew', as: :renew
post 'command/delete', action: 'delete', as: :delete
end
end
constraints(EppConstraint.new(:domain)) do
controller('domains') do
post 'command/create', action: 'create', as: nil
post 'command/update', action: 'update', as: nil
post 'command/info', action: 'info', as: nil
post 'command/check', action: 'check', as: nil
post 'command/transfer', action: 'transfer', as: nil
post 'command/renew', action: 'renew', as: nil
post 'command/delete', action: 'delete', as: nil
end
end
post 'command/poll', to: 'polls#poll', as: 'poll', constraints: EppConstraint.new(:poll)
get 'error/:command', to: 'errors#error' get 'error/:command', to: 'errors#error'
end end

View file

@ -50,7 +50,7 @@ class EppBaseTest < EppTestCase
</command> </command>
</epp> </epp>
XML XML
post '/epp/command/info', { frame: xml_of_epp_command_that_requires_authentication }, post epp_info_path, { frame: xml_of_epp_command_that_requires_authentication },
'HTTP_COOKIE' => 'session=non-existent' 'HTTP_COOKIE' => 'session=non-existent'
assert_epp_response :authorization_error assert_epp_response :authorization_error
@ -74,7 +74,7 @@ class EppBaseTest < EppTestCase
</command> </command>
</epp> </epp>
XML XML
post '/epp/command/info', { frame: xml_of_epp_command_that_requires_authorization }, post epp_info_path, { frame: xml_of_epp_command_that_requires_authorization },
'HTTP_COOKIE' => "session=#{session.session_id}" 'HTTP_COOKIE' => "session=#{session.session_id}"
assert_epp_response :authorization_error assert_epp_response :authorization_error
@ -83,7 +83,7 @@ class EppBaseTest < EppTestCase
private private
def valid_command_path def valid_command_path
epp_command_poll_path epp_poll_path
end end
def valid_request_xml def valid_request_xml

View file

@ -14,7 +14,7 @@ class EppContactBaseTest < EppTestCase
</command> </command>
</epp> </epp>
XML XML
post '/epp/command/info', { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames' post epp_info_path, { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
assert_epp_response :object_does_not_exist assert_epp_response :object_does_not_exist
end end

View file

@ -21,7 +21,7 @@ class EppContactCheckBaseTest < EppTestCase
</epp> </epp>
XML XML
post '/epp/command/check', { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames' post epp_check_path, { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
response_xml = Nokogiri::XML(response.body) response_xml = Nokogiri::XML(response.body)
assert_epp_response :completed_successfully assert_epp_response :completed_successfully
@ -42,7 +42,7 @@ class EppContactCheckBaseTest < EppTestCase
</epp> </epp>
XML XML
post '/epp/command/check', { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames' post epp_check_path, { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
response_xml = Nokogiri::XML(response.body) response_xml = Nokogiri::XML(response.body)
assert_equal '1', response_xml.at_xpath('//contact:id', contact: xml_schema)['avail'] assert_equal '1', response_xml.at_xpath('//contact:id', contact: xml_schema)['avail']
@ -65,7 +65,7 @@ class EppContactCheckBaseTest < EppTestCase
</epp> </epp>
XML XML
post '/epp/command/check', { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames' post epp_check_path, { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
response_xml = Nokogiri::XML(response.body) response_xml = Nokogiri::XML(response.body)
assert_equal '0', response_xml.at_xpath('//contact:id', contact: xml_schema)['avail'] assert_equal '0', response_xml.at_xpath('//contact:id', contact: xml_schema)['avail']
@ -88,7 +88,7 @@ class EppContactCheckBaseTest < EppTestCase
</epp> </epp>
XML XML
post '/epp/command/check', { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames' post epp_check_path, { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
response_xml = Nokogiri::XML(response.body) response_xml = Nokogiri::XML(response.body)
assert_equal 3, response_xml.xpath('//contact:cd', contact: xml_schema).size assert_equal 3, response_xml.xpath('//contact:cd', contact: xml_schema).size

View file

@ -29,7 +29,7 @@ class EppContactCreateBaseTest < EppTestCase
XML XML
assert_difference 'Contact.count' do assert_difference 'Contact.count' do
post '/epp/command/create', { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames' post epp_create_path, { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
end end
assert_epp_response :completed_successfully assert_epp_response :completed_successfully
@ -68,7 +68,7 @@ class EppContactCreateBaseTest < EppTestCase
</epp> </epp>
XML XML
post '/epp/command/create', { frame: request_xml }, 'HTTP_COOKIE' => "session=#{session.session_id}" post epp_create_path, { frame: request_xml }, 'HTTP_COOKIE' => "session=#{session.session_id}"
contact = Contact.find_by(name: name) contact = Contact.find_by(name: name)
assert_equal "#{session.user.registrar.code}:#{code}".upcase, contact.code assert_equal "#{session.user.registrar.code}:#{code}".upcase, contact.code
@ -98,7 +98,7 @@ class EppContactCreateBaseTest < EppTestCase
XML XML
assert_no_difference 'Contact.count' do assert_no_difference 'Contact.count' do
post '/epp/command/create', { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames' post epp_create_path, { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
end end
assert_epp_response :required_parameter_missing assert_epp_response :required_parameter_missing
end end

View file

@ -21,7 +21,7 @@ class EppContactDeleteBaseTest < EppTestCase
XML XML
assert_difference 'Contact.count', -1 do assert_difference 'Contact.count', -1 do
post '/epp/command/delete', { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames' post epp_delete_path, { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
end end
assert_epp_response :completed_successfully assert_epp_response :completed_successfully
end end
@ -47,7 +47,7 @@ class EppContactDeleteBaseTest < EppTestCase
XML XML
assert_no_difference 'Contact.count' do assert_no_difference 'Contact.count' do
post '/epp/command/delete', { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames' post epp_delete_path, { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
end end
assert_epp_response :object_association_prohibits_operation assert_epp_response :object_association_prohibits_operation
end end

View file

@ -29,7 +29,7 @@ class EppContactInfoBaseTest < EppTestCase
</epp> </epp>
XML XML
post '/epp/command/info', { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames' post epp_info_path, { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
response_xml = Nokogiri::XML(response.body) response_xml = Nokogiri::XML(response.body)
assert_epp_response :completed_successfully assert_epp_response :completed_successfully

View file

@ -37,7 +37,7 @@ class EppContactUpdateBaseTest < EppTestCase
</epp> </epp>
XML XML
post '/epp/command/update', { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames' post epp_update_path, { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
@contact.reload @contact.reload
assert_epp_response :completed_successfully assert_epp_response :completed_successfully
@ -69,7 +69,7 @@ class EppContactUpdateBaseTest < EppTestCase
</epp> </epp>
XML XML
post '/epp/command/update', { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames' post epp_update_path, { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
assert_emails 1 assert_emails 1
end end
@ -97,7 +97,7 @@ class EppContactUpdateBaseTest < EppTestCase
</epp> </epp>
XML XML
post '/epp/command/update', { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames' post epp_update_path, { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
assert_no_emails assert_no_emails
end end
@ -128,7 +128,7 @@ class EppContactUpdateBaseTest < EppTestCase
</epp> </epp>
XML XML
post '/epp/command/update', { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames' post epp_update_path, { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
assert_no_emails assert_no_emails
end end
@ -154,7 +154,7 @@ class EppContactUpdateBaseTest < EppTestCase
</epp> </epp>
XML XML
post '/epp/command/update', { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames' post epp_update_path, { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
assert_epp_response :object_does_not_exist assert_epp_response :object_does_not_exist
end end
@ -188,7 +188,7 @@ class EppContactUpdateBaseTest < EppTestCase
</epp> </epp>
XML XML
assert_no_changes -> { @contact.updated_at } do assert_no_changes -> { @contact.updated_at } do
post '/epp/command/update', { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames' post epp_update_path, { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
end end
assert_epp_response :data_management_policy_violation assert_epp_response :data_management_policy_violation
end end
@ -220,7 +220,7 @@ class EppContactUpdateBaseTest < EppTestCase
</command> </command>
</epp> </epp>
XML XML
post '/epp/command/update', { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames' post epp_update_path, { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
assert_epp_response :completed_successfully assert_epp_response :completed_successfully
end end

View file

@ -14,7 +14,7 @@ class EppDomainBaseTest < EppTestCase
</command> </command>
</epp> </epp>
XML XML
post '/epp/command/info', { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames' post epp_info_path, { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
assert_epp_response :object_does_not_exist assert_epp_response :object_does_not_exist
end end

View file

@ -28,7 +28,7 @@ class EppDomainCheckAuctionTest < EppTestCase
</epp> </epp>
XML XML
post '/epp/command/check', { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames' post epp_check_path, { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
response_xml = Nokogiri::XML(response.body) response_xml = Nokogiri::XML(response.body)
assert_epp_response :completed_successfully assert_epp_response :completed_successfully
@ -52,7 +52,7 @@ class EppDomainCheckAuctionTest < EppTestCase
</epp> </epp>
XML XML
post '/epp/command/check', { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames' post epp_check_path, { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
response_xml = Nokogiri::XML(response.body) response_xml = Nokogiri::XML(response.body)
assert_epp_response :completed_successfully assert_epp_response :completed_successfully
@ -76,7 +76,7 @@ class EppDomainCheckAuctionTest < EppTestCase
</epp> </epp>
XML XML
post '/epp/command/check', { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames' post epp_check_path, { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
response_xml = Nokogiri::XML(response.body) response_xml = Nokogiri::XML(response.body)
assert_epp_response :completed_successfully assert_epp_response :completed_successfully
@ -100,7 +100,7 @@ class EppDomainCheckAuctionTest < EppTestCase
</epp> </epp>
XML XML
post '/epp/command/check', { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames' post epp_check_path, { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
response_xml = Nokogiri::XML(response.body) response_xml = Nokogiri::XML(response.body)
assert_epp_response :completed_successfully assert_epp_response :completed_successfully
@ -124,7 +124,7 @@ class EppDomainCheckAuctionTest < EppTestCase
</epp> </epp>
XML XML
post '/epp/command/check', { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames' post epp_check_path, { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
response_xml = Nokogiri::XML(response.body) response_xml = Nokogiri::XML(response.body)
assert_epp_response :completed_successfully assert_epp_response :completed_successfully

View file

@ -15,7 +15,7 @@ class EppDomainCheckBaseTest < EppTestCase
</epp> </epp>
XML XML
post '/epp/command/check', { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames' post epp_check_path, { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
response_xml = Nokogiri::XML(response.body) response_xml = Nokogiri::XML(response.body)
assert_epp_response :completed_successfully assert_epp_response :completed_successfully
@ -36,7 +36,7 @@ class EppDomainCheckBaseTest < EppTestCase
</epp> </epp>
XML XML
post '/epp/command/check', { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames' post epp_check_path, { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
response_xml = Nokogiri::XML(response.body) response_xml = Nokogiri::XML(response.body)
assert_equal '1', response_xml.at_xpath('//domain:name', 'domain' => 'https://epp.tld.ee/schema/domain-eis-1.0.xsd')['avail'] assert_equal '1', response_xml.at_xpath('//domain:name', 'domain' => 'https://epp.tld.ee/schema/domain-eis-1.0.xsd')['avail']
@ -59,7 +59,7 @@ class EppDomainCheckBaseTest < EppTestCase
</epp> </epp>
XML XML
post '/epp/command/check', { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames' post epp_check_path, { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
response_xml = Nokogiri::XML(response.body) response_xml = Nokogiri::XML(response.body)
assert_equal '1', response_xml.at_xpath('//domain:name', 'domain' => 'https://epp.tld.ee/schema/domain-eis-1.0.xsd')['avail'] assert_equal '1', response_xml.at_xpath('//domain:name', 'domain' => 'https://epp.tld.ee/schema/domain-eis-1.0.xsd')['avail']
@ -80,7 +80,7 @@ class EppDomainCheckBaseTest < EppTestCase
</epp> </epp>
XML XML
post '/epp/command/check', { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames' post epp_check_path, { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
response_xml = Nokogiri::XML(response.body) response_xml = Nokogiri::XML(response.body)
assert_equal '0', response_xml.at_xpath('//domain:name', 'domain' => 'https://epp.tld.ee/schema/domain-eis-1.0.xsd')['avail'] assert_equal '0', response_xml.at_xpath('//domain:name', 'domain' => 'https://epp.tld.ee/schema/domain-eis-1.0.xsd')['avail']
@ -103,7 +103,7 @@ class EppDomainCheckBaseTest < EppTestCase
</epp> </epp>
XML XML
post '/epp/command/check', { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames' post epp_check_path, { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
response_xml = Nokogiri::XML(response.body) response_xml = Nokogiri::XML(response.body)
assert_equal '0', response_xml.at_xpath('//domain:name', 'domain' => 'https://epp.tld.ee/schema/domain-eis-1.0.xsd')['avail'] assert_equal '0', response_xml.at_xpath('//domain:name', 'domain' => 'https://epp.tld.ee/schema/domain-eis-1.0.xsd')['avail']
@ -126,7 +126,7 @@ class EppDomainCheckBaseTest < EppTestCase
</epp> </epp>
XML XML
post '/epp/command/check', { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames' post epp_check_path, { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
response_xml = Nokogiri::XML(response.body) response_xml = Nokogiri::XML(response.body)
assert_equal '0', response_xml.at_xpath('//domain:name', 'domain' => 'https://epp.tld.ee/schema/domain-eis-1.0.xsd')['avail'] assert_equal '0', response_xml.at_xpath('//domain:name', 'domain' => 'https://epp.tld.ee/schema/domain-eis-1.0.xsd')['avail']
@ -149,7 +149,7 @@ class EppDomainCheckBaseTest < EppTestCase
</epp> </epp>
XML XML
post '/epp/command/check', { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames' post epp_check_path, { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
response_xml = Nokogiri::XML(response.body) response_xml = Nokogiri::XML(response.body)
assert_equal '0', response_xml.at_xpath('//domain:name', 'domain' => 'https://epp.tld.ee/schema/domain-eis-1.0.xsd')['avail'] assert_equal '0', response_xml.at_xpath('//domain:name', 'domain' => 'https://epp.tld.ee/schema/domain-eis-1.0.xsd')['avail']
@ -172,7 +172,7 @@ class EppDomainCheckBaseTest < EppTestCase
</epp> </epp>
XML XML
post '/epp/command/check', { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames' post epp_check_path, { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
response_xml = Nokogiri::XML(response.body) response_xml = Nokogiri::XML(response.body)
assert_equal 3, response_xml.xpath('//domain:cd', 'domain' => 'https://epp.tld.ee/schema/domain-eis-1.0.xsd').size assert_equal 3, response_xml.xpath('//domain:cd', 'domain' => 'https://epp.tld.ee/schema/domain-eis-1.0.xsd').size

View file

@ -39,7 +39,7 @@ class EppDomainCreateAuctionIdnTest < EppTestCase
XML XML
assert_no_difference 'Domain.count' do assert_no_difference 'Domain.count' do
post '/epp/command/create', { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames' post epp_create_path, { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
end end
refute Domain.where(name: @idn_auction.domain).exists? refute Domain.where(name: @idn_auction.domain).exists?
@ -73,7 +73,7 @@ class EppDomainCreateAuctionIdnTest < EppTestCase
XML XML
assert_no_difference 'Domain.count' do assert_no_difference 'Domain.count' do
post '/epp/command/create', { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames' post epp_create_path, { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
end end
refute Domain.where(name: @idn_auction.domain).exists? refute Domain.where(name: @idn_auction.domain).exists?
@ -106,7 +106,7 @@ class EppDomainCreateAuctionIdnTest < EppTestCase
XML XML
assert_no_difference 'Domain.count' do assert_no_difference 'Domain.count' do
post '/epp/command/create', { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames' post epp_create_path, { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
end end
refute Domain.where(name: @idn_auction.domain).exists? refute Domain.where(name: @idn_auction.domain).exists?
@ -139,7 +139,7 @@ class EppDomainCreateAuctionIdnTest < EppTestCase
XML XML
assert_no_difference 'Domain.count' do assert_no_difference 'Domain.count' do
post '/epp/command/create', { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames' post epp_create_path, { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
end end
refute Domain.where(name: @idn_auction.domain).exists? refute Domain.where(name: @idn_auction.domain).exists?
@ -176,7 +176,7 @@ class EppDomainCreateAuctionIdnTest < EppTestCase
XML XML
assert_difference 'Domain.count' do assert_difference 'Domain.count' do
post '/epp/command/create', { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames' post epp_create_path, { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
end end
@idn_auction.reload @idn_auction.reload
@ -212,7 +212,7 @@ class EppDomainCreateAuctionIdnTest < EppTestCase
XML XML
assert_difference 'Domain.count' do assert_difference 'Domain.count' do
post '/epp/command/create', { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames' post epp_create_path, { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
end end
@idn_auction.reload @idn_auction.reload

View file

@ -31,7 +31,7 @@ class EppDomainCreateAuctionTest < EppTestCase
XML XML
assert_difference 'Domain.count' do assert_difference 'Domain.count' do
post '/epp/command/create', { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames' post epp_create_path, { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
end end
assert_epp_response :completed_successfully assert_epp_response :completed_successfully
end end
@ -68,7 +68,7 @@ class EppDomainCreateAuctionTest < EppTestCase
XML XML
assert_difference 'Domain.count' do assert_difference 'Domain.count' do
post '/epp/command/create', { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames' post epp_create_path, { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
end end
assert_epp_response :completed_successfully assert_epp_response :completed_successfully
end end
@ -100,7 +100,7 @@ class EppDomainCreateAuctionTest < EppTestCase
XML XML
assert_difference 'Domain.count' do assert_difference 'Domain.count' do
post '/epp/command/create', { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames' post epp_create_path, { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
end end
@auction.reload @auction.reload
@ -132,7 +132,7 @@ class EppDomainCreateAuctionTest < EppTestCase
XML XML
assert_no_difference 'Domain.count' do assert_no_difference 'Domain.count' do
post '/epp/command/create', { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames' post epp_create_path, { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
end end
assert_epp_response :required_parameter_missing assert_epp_response :required_parameter_missing
end end
@ -164,7 +164,7 @@ class EppDomainCreateAuctionTest < EppTestCase
XML XML
assert_no_difference 'Domain.count' do assert_no_difference 'Domain.count' do
post '/epp/command/create', { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames' post epp_create_path, { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
end end
assert_epp_response :invalid_authorization_information assert_epp_response :invalid_authorization_information
end end
@ -195,7 +195,7 @@ class EppDomainCreateAuctionTest < EppTestCase
XML XML
assert_no_difference 'Domain.count' do assert_no_difference 'Domain.count' do
post '/epp/command/create', { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames' post epp_create_path, { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
end end
assert_epp_response :required_parameter_missing assert_epp_response :required_parameter_missing
end end
@ -222,7 +222,7 @@ class EppDomainCreateAuctionTest < EppTestCase
XML XML
assert_no_difference 'Domain.count' do assert_no_difference 'Domain.count' do
post '/epp/command/create', { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames' post epp_create_path, { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
end end
assert_epp_response :parameter_value_policy_error assert_epp_response :parameter_value_policy_error
end end

View file

@ -27,7 +27,7 @@ class EppDomainCreateBaseTest < EppTestCase
XML XML
assert_difference 'Domain.count' do assert_difference 'Domain.count' do
post '/epp/command/create', { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames' post epp_create_path, { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
end end
assert_epp_response :completed_successfully assert_epp_response :completed_successfully
@ -68,7 +68,7 @@ class EppDomainCreateBaseTest < EppTestCase
XML XML
assert_difference 'Domain.count' do assert_difference 'Domain.count' do
post '/epp/command/create', { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames' post epp_create_path, { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
end end
assert_epp_response :completed_successfully assert_epp_response :completed_successfully
@ -102,7 +102,7 @@ class EppDomainCreateBaseTest < EppTestCase
</epp> </epp>
XML XML
post '/epp/command/create', { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames' post epp_create_path, { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
assert_epp_response :completed_successfully assert_epp_response :completed_successfully
assert_equal transfer_code, Domain.find_by(name: name).transfer_code assert_equal transfer_code, Domain.find_by(name: name).transfer_code
@ -132,7 +132,7 @@ class EppDomainCreateBaseTest < EppTestCase
XML XML
assert_no_difference 'Domain.count' do assert_no_difference 'Domain.count' do
post '/epp/command/create', { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames' post epp_create_path, { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
end end
assert_epp_response :data_management_policy_violation assert_epp_response :data_management_policy_violation
end end
@ -161,7 +161,7 @@ class EppDomainCreateBaseTest < EppTestCase
XML XML
assert_no_difference 'Domain.count' do assert_no_difference 'Domain.count' do
post '/epp/command/create', { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames' post epp_create_path, { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
end end
assert_epp_response :invalid_authorization_information assert_epp_response :invalid_authorization_information
end end
@ -189,7 +189,7 @@ class EppDomainCreateBaseTest < EppTestCase
XML XML
assert_no_difference 'Domain.count' do assert_no_difference 'Domain.count' do
post '/epp/command/create', { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames' post epp_create_path, { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
end end
assert_epp_response :required_parameter_missing assert_epp_response :required_parameter_missing
end end
@ -217,7 +217,7 @@ class EppDomainCreateBaseTest < EppTestCase
</epp> </epp>
XML XML
assert_no_difference 'Domain.count' do assert_no_difference 'Domain.count' do
post '/epp/command/create', { frame: request_xml }, 'HTTP_COOKIE' => "session=#{session.session_id}" post epp_create_path, { frame: request_xml }, 'HTTP_COOKIE' => "session=#{session.session_id}"
end end
assert_epp_response :billing_failure assert_epp_response :billing_failure
end end
@ -245,7 +245,7 @@ class EppDomainCreateBaseTest < EppTestCase
</epp> </epp>
XML XML
assert_no_difference 'Domain.count' do assert_no_difference 'Domain.count' do
post '/epp/command/create', { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames' post epp_create_path, { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
end end
assert_epp_response :billing_failure assert_epp_response :billing_failure
end end

View file

@ -34,7 +34,7 @@ class EppDomainDeleteBaseTest < EppTestCase
</epp> </epp>
XML XML
post '/epp/command/delete', { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames' post epp_delete_path, { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
assert_includes Domain.find_by(name: 'invalid.test').statuses, DomainStatus::PENDING_DELETE_CONFIRMATION assert_includes Domain.find_by(name: 'invalid.test').statuses, DomainStatus::PENDING_DELETE_CONFIRMATION
assert_epp_response :completed_successfully_action_pending assert_epp_response :completed_successfully_action_pending
end end
@ -62,7 +62,7 @@ class EppDomainDeleteBaseTest < EppTestCase
XML XML
assert_no_difference 'Domain.count' do assert_no_difference 'Domain.count' do
post '/epp/command/delete', { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames' post epp_delete_path, { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
end end
assert_epp_response :object_status_prohibits_operation assert_epp_response :object_status_prohibits_operation
end end
@ -89,7 +89,7 @@ class EppDomainDeleteBaseTest < EppTestCase
</epp> </epp>
XML XML
post '/epp/command/delete', { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames' post epp_delete_path, { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
@domain.reload @domain.reload
assert @domain.registrant_verification_asked? assert @domain.registrant_verification_asked?
@ -120,7 +120,7 @@ class EppDomainDeleteBaseTest < EppTestCase
</epp> </epp>
XML XML
post '/epp/command/delete', { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames' post epp_delete_path, { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
@domain.reload @domain.reload
assert_not @domain.registrant_verification_asked? assert_not @domain.registrant_verification_asked?
@ -151,7 +151,7 @@ class EppDomainDeleteBaseTest < EppTestCase
</epp> </epp>
XML XML
post '/epp/command/delete', { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames' post epp_delete_path, { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
@domain.reload @domain.reload
assert_not @domain.registrant_verification_asked? assert_not @domain.registrant_verification_asked?
@ -176,7 +176,7 @@ class EppDomainDeleteBaseTest < EppTestCase
</epp> </epp>
XML XML
post '/epp/command/delete', { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames' post epp_delete_path, { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
assert_epp_response :required_parameter_missing assert_epp_response :required_parameter_missing
end end
@ -203,7 +203,7 @@ class EppDomainDeleteBaseTest < EppTestCase
</epp> </epp>
XML XML
post '/epp/command/delete', { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames' post epp_delete_path, { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
assert_epp_response :object_status_prohibits_operation assert_epp_response :object_status_prohibits_operation
end end

View file

@ -21,7 +21,7 @@ class EppDomainInfoBaseTest < EppTestCase
</epp> </epp>
XML XML
post '/epp/command/info', { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames' post epp_info_path, { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
response_xml = Nokogiri::XML(response.body) response_xml = Nokogiri::XML(response.body)
assert_epp_response :completed_successfully assert_epp_response :completed_successfully
@ -49,7 +49,7 @@ class EppDomainInfoBaseTest < EppTestCase
</epp> </epp>
XML XML
post '/epp/command/info', { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames' post epp_info_path, { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
response_xml = Nokogiri::XML(response.body) response_xml = Nokogiri::XML(response.body)
assert_equal '65078d5', response_xml.at_xpath('//domain:authInfo/domain:pw', 'domain' => 'https://epp.tld.ee/schema/domain-eis-1.0.xsd').text assert_equal '65078d5', response_xml.at_xpath('//domain:authInfo/domain:pw', 'domain' => 'https://epp.tld.ee/schema/domain-eis-1.0.xsd').text
@ -76,7 +76,7 @@ class EppDomainInfoBaseTest < EppTestCase
</epp> </epp>
XML XML
post '/epp/command/info', { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_goodnames' post epp_info_path, { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_goodnames'
response_xml = Nokogiri::XML(response.body) response_xml = Nokogiri::XML(response.body)
assert_equal '65078d5', response_xml.at_xpath('//domain:authInfo/domain:pw', 'domain' => 'https://epp.tld.ee/schema/domain-eis-1.0.xsd').text assert_equal '65078d5', response_xml.at_xpath('//domain:authInfo/domain:pw', 'domain' => 'https://epp.tld.ee/schema/domain-eis-1.0.xsd').text
@ -99,7 +99,7 @@ class EppDomainInfoBaseTest < EppTestCase
</epp> </epp>
XML XML
post '/epp/command/info', { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_goodnames' post epp_info_path, { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_goodnames'
response_xml = Nokogiri::XML(response.body) response_xml = Nokogiri::XML(response.body)
assert_nil response_xml.at_xpath('//domain:authInfo/domain:pw', assert_nil response_xml.at_xpath('//domain:authInfo/domain:pw',

View file

@ -24,7 +24,7 @@ class EppDomainRenewBaseTest < EppTestCase
</epp> </epp>
XML XML
post '/epp/command/renew', { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames' post epp_renew_path, { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
domain.reload domain.reload
assert_epp_response :completed_successfully assert_epp_response :completed_successfully
@ -50,7 +50,7 @@ class EppDomainRenewBaseTest < EppTestCase
XML XML
assert_no_changes -> { domain.valid_to } do assert_no_changes -> { domain.valid_to } do
post '/epp/command/renew', { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames' post epp_renew_path, { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
domain.reload domain.reload
end end
assert_epp_response :object_status_prohibits_operation assert_epp_response :object_status_prohibits_operation
@ -77,7 +77,7 @@ class EppDomainRenewBaseTest < EppTestCase
XML XML
assert_no_changes -> { domain.valid_to } do assert_no_changes -> { domain.valid_to } do
post '/epp/command/renew', { frame: request_xml }, post epp_renew_path, { frame: request_xml },
'HTTP_COOKIE' => "session=#{session.session_id}" 'HTTP_COOKIE' => "session=#{session.session_id}"
domain.reload domain.reload
end end
@ -105,7 +105,7 @@ class EppDomainRenewBaseTest < EppTestCase
XML XML
assert_no_difference -> { domain.valid_to } do assert_no_difference -> { domain.valid_to } do
post '/epp/command/renew', { frame: request_xml }, 'HTTP_COOKIE' => post epp_renew_path, { frame: request_xml }, 'HTTP_COOKIE' =>
"session=#{session.session_id}" "session=#{session.session_id}"
domain.reload domain.reload
end end
@ -132,7 +132,7 @@ class EppDomainRenewBaseTest < EppTestCase
XML XML
assert_no_changes -> { domain.valid_to } do assert_no_changes -> { domain.valid_to } do
post '/epp/command/renew', { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames' post epp_renew_path, { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
domain.reload domain.reload
end end
assert_epp_response :billing_failure assert_epp_response :billing_failure
@ -158,7 +158,7 @@ class EppDomainRenewBaseTest < EppTestCase
XML XML
assert_no_changes -> { domain.valid_to } do assert_no_changes -> { domain.valid_to } do
post '/epp/command/renew', { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames' post epp_renew_path, { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
domain.reload domain.reload
end end
assert_epp_response :parameter_value_policy_error assert_epp_response :parameter_value_policy_error

View file

@ -2,7 +2,7 @@ require 'test_helper'
class EppDomainTransferQueryTest < EppTestCase class EppDomainTransferQueryTest < EppTestCase
def test_returns_domain_transfer_details def test_returns_domain_transfer_details
post '/epp/command/transfer', { frame: request_xml }, { 'HTTP_COOKIE' => 'session=api_bestnames' } post epp_transfer_path, { frame: request_xml }, { 'HTTP_COOKIE' => 'session=api_bestnames' }
xml_doc = Nokogiri::XML(response.body) xml_doc = Nokogiri::XML(response.body)
assert_epp_response :completed_successfully assert_epp_response :completed_successfully
assert_equal 'shop.test', xml_doc.xpath('//domain:name', 'domain' => 'https://epp.tld.ee/schema/domain-eis-1.0.xsd').text assert_equal 'shop.test', xml_doc.xpath('//domain:name', 'domain' => 'https://epp.tld.ee/schema/domain-eis-1.0.xsd').text
@ -28,14 +28,14 @@ class EppDomainTransferQueryTest < EppTestCase
</epp> </epp>
XML XML
post '/epp/command/transfer', { frame: request_xml }, { 'HTTP_COOKIE' => 'session=api_bestnames' } post epp_transfer_path, { frame: request_xml }, { 'HTTP_COOKIE' => 'session=api_bestnames' }
assert_epp_response :invalid_authorization_information assert_epp_response :invalid_authorization_information
end end
def test_no_domain_transfer def test_no_domain_transfer
domains(:shop).transfers.delete_all domains(:shop).transfers.delete_all
post '/epp/command/transfer', { frame: request_xml }, { 'HTTP_COOKIE' => 'session=api_bestnames' } post epp_transfer_path, { frame: request_xml }, { 'HTTP_COOKIE' => 'session=api_bestnames' }
assert_epp_response :object_does_not_exist assert_epp_response :object_does_not_exist
end end

View file

@ -13,24 +13,24 @@ class EppDomainTransferRequestTest < EppTestCase
end end
def test_transfers_domain_at_once def test_transfers_domain_at_once
post '/epp/command/transfer', { frame: request_xml }, { 'HTTP_COOKIE' => 'session=api_goodnames' } post epp_transfer_path, { frame: request_xml }, { 'HTTP_COOKIE' => 'session=api_goodnames' }
assert_epp_response :completed_successfully assert_epp_response :completed_successfully
end end
def test_creates_new_domain_transfer def test_creates_new_domain_transfer
assert_difference -> { @domain.transfers.size } do assert_difference -> { @domain.transfers.size } do
post '/epp/command/transfer', { frame: request_xml }, { 'HTTP_COOKIE' => 'session=api_goodnames' } post epp_transfer_path, { frame: request_xml }, { 'HTTP_COOKIE' => 'session=api_goodnames' }
end end
end end
def test_approves_automatically_if_auto_approval_is_enabled def test_approves_automatically_if_auto_approval_is_enabled
post '/epp/command/transfer', { frame: request_xml }, { 'HTTP_COOKIE' => 'session=api_goodnames' } post epp_transfer_path, { frame: request_xml }, { 'HTTP_COOKIE' => 'session=api_goodnames' }
assert_equal 'serverApproved', Nokogiri::XML(response.body).xpath('//domain:trStatus', 'domain' => assert_equal 'serverApproved', Nokogiri::XML(response.body).xpath('//domain:trStatus', 'domain' =>
'https://epp.tld.ee/schema/domain-eis-1.0.xsd').text 'https://epp.tld.ee/schema/domain-eis-1.0.xsd').text
end end
def test_assigns_new_registrar def test_assigns_new_registrar
post '/epp/command/transfer', { frame: request_xml }, { 'HTTP_COOKIE' => 'session=api_goodnames' } post epp_transfer_path, { frame: request_xml }, { 'HTTP_COOKIE' => 'session=api_goodnames' }
@domain.reload @domain.reload
assert_equal @new_registrar, @domain.registrar assert_equal @new_registrar, @domain.registrar
end end
@ -38,7 +38,7 @@ class EppDomainTransferRequestTest < EppTestCase
def test_regenerates_transfer_code def test_regenerates_transfer_code
@old_transfer_code = @domain.transfer_code @old_transfer_code = @domain.transfer_code
post '/epp/command/transfer', { frame: request_xml }, { 'HTTP_COOKIE' => 'session=api_goodnames' } post epp_transfer_path, { frame: request_xml }, { 'HTTP_COOKIE' => 'session=api_goodnames' }
@domain.reload @domain.reload
refute_equal @domain.transfer_code, @old_transfer_code refute_equal @domain.transfer_code, @old_transfer_code
@ -48,31 +48,31 @@ class EppDomainTransferRequestTest < EppTestCase
@old_registrar = @domain.registrar @old_registrar = @domain.registrar
assert_difference -> { @old_registrar.notifications.count } do assert_difference -> { @old_registrar.notifications.count } do
post '/epp/command/transfer', { frame: request_xml }, { 'HTTP_COOKIE' => 'session=api_goodnames' } post epp_transfer_path, { frame: request_xml }, { 'HTTP_COOKIE' => 'session=api_goodnames' }
end end
end end
def test_duplicates_registrant_admin_and_tech_contacts def test_duplicates_registrant_admin_and_tech_contacts
assert_difference -> { @new_registrar.contacts.size }, 3 do assert_difference -> { @new_registrar.contacts.size }, 3 do
post '/epp/command/transfer', { frame: request_xml }, { 'HTTP_COOKIE' => 'session=api_goodnames' } post epp_transfer_path, { frame: request_xml }, { 'HTTP_COOKIE' => 'session=api_goodnames' }
end end
end end
def test_reuses_identical_contact def test_reuses_identical_contact
post '/epp/command/transfer', { frame: request_xml }, { 'HTTP_COOKIE' => 'session=api_goodnames' } post epp_transfer_path, { frame: request_xml }, { 'HTTP_COOKIE' => 'session=api_goodnames' }
assert_equal 1, @new_registrar.contacts.where(name: 'William').size assert_equal 1, @new_registrar.contacts.where(name: 'William').size
end end
def test_saves_legal_document def test_saves_legal_document
assert_difference -> { @domain.legal_documents(true).size } do assert_difference -> { @domain.legal_documents(true).size } do
post '/epp/command/transfer', { frame: request_xml }, { 'HTTP_COOKIE' => 'session=api_goodnames' } post epp_transfer_path, { frame: request_xml }, { 'HTTP_COOKIE' => 'session=api_goodnames' }
end end
end end
def test_non_transferable_domain def test_non_transferable_domain
@domain.update!(statuses: [DomainStatus::SERVER_TRANSFER_PROHIBITED]) @domain.update!(statuses: [DomainStatus::SERVER_TRANSFER_PROHIBITED])
post '/epp/command/transfer', { frame: request_xml }, { 'HTTP_COOKIE' => 'session=api_goodnames' } post epp_transfer_path, { frame: request_xml }, { 'HTTP_COOKIE' => 'session=api_goodnames' }
domains(:shop).reload domains(:shop).reload
assert_equal registrars(:bestnames), domains(:shop).registrar assert_equal registrars(:bestnames), domains(:shop).registrar
@ -82,7 +82,7 @@ class EppDomainTransferRequestTest < EppTestCase
def test_discarded_domain_cannot_be_transferred def test_discarded_domain_cannot_be_transferred
@domain.update!(statuses: [DomainStatus::DELETE_CANDIDATE]) @domain.update!(statuses: [DomainStatus::DELETE_CANDIDATE])
post '/epp/command/transfer', { frame: request_xml }, { 'HTTP_COOKIE' => 'session=api_goodnames' } post epp_transfer_path, { frame: request_xml }, { 'HTTP_COOKIE' => 'session=api_goodnames' }
@domain.reload @domain.reload
assert_equal registrars(:bestnames), @domain.registrar assert_equal registrars(:bestnames), @domain.registrar
@ -91,7 +91,7 @@ class EppDomainTransferRequestTest < EppTestCase
def test_same_registrar def test_same_registrar
assert_no_difference -> { @domain.transfers.size } do assert_no_difference -> { @domain.transfers.size } do
post '/epp/command/transfer', { frame: request_xml }, { 'HTTP_COOKIE' => 'session=api_bestnames' } post epp_transfer_path, { frame: request_xml }, { 'HTTP_COOKIE' => 'session=api_bestnames' }
end end
assert_epp_response :use_error assert_epp_response :use_error
end end
@ -113,7 +113,7 @@ class EppDomainTransferRequestTest < EppTestCase
</epp> </epp>
XML XML
post '/epp/command/transfer', { frame: request_xml }, { 'HTTP_COOKIE' => 'session=api_goodnames' } post epp_transfer_path, { frame: request_xml }, { 'HTTP_COOKIE' => 'session=api_goodnames' }
@domain.reload @domain.reload
assert_epp_response :invalid_authorization_information assert_epp_response :invalid_authorization_information

View file

@ -34,7 +34,7 @@ class EppDomainUpdateBaseTest < EppTestCase
</epp> </epp>
XML XML
post '/epp/command/update', { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames' post epp_update_path, { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
@domain.reload @domain.reload
assert_equal 'f0ff7d17b0', @domain.transfer_code assert_equal 'f0ff7d17b0', @domain.transfer_code
assert_epp_response :completed_successfully assert_epp_response :completed_successfully
@ -56,7 +56,7 @@ class EppDomainUpdateBaseTest < EppTestCase
</epp> </epp>
XML XML
post '/epp/command/update', { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames' post epp_update_path, { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
assert_epp_response :object_status_prohibits_operation assert_epp_response :object_status_prohibits_operation
end end
@ -76,7 +76,7 @@ class EppDomainUpdateBaseTest < EppTestCase
</epp> </epp>
XML XML
post '/epp/command/update', { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames' post epp_update_path, { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
assert_epp_response :object_status_prohibits_operation assert_epp_response :object_status_prohibits_operation
response_xml = Nokogiri::XML(response.body) response_xml = Nokogiri::XML(response.body)
@ -109,7 +109,7 @@ class EppDomainUpdateBaseTest < EppTestCase
</epp> </epp>
XML XML
post '/epp/command/update', { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames' post epp_update_path, { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
@domain.reload @domain.reload
assert_epp_response :completed_successfully_action_pending assert_epp_response :completed_successfully_action_pending
@ -145,7 +145,7 @@ class EppDomainUpdateBaseTest < EppTestCase
</epp> </epp>
XML XML
post '/epp/command/update', { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames' post epp_update_path, { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
@domain.reload @domain.reload
assert_epp_response :completed_successfully_action_pending assert_epp_response :completed_successfully_action_pending
@ -179,7 +179,7 @@ class EppDomainUpdateBaseTest < EppTestCase
</epp> </epp>
XML XML
post '/epp/command/update', { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames' post epp_update_path, { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
@domain.reload @domain.reload
assert_epp_response :completed_successfully assert_epp_response :completed_successfully
@ -214,7 +214,7 @@ class EppDomainUpdateBaseTest < EppTestCase
</epp> </epp>
XML XML
post '/epp/command/update', { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames' post epp_update_path, { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
@domain.reload @domain.reload
assert_epp_response :completed_successfully assert_epp_response :completed_successfully
@ -250,7 +250,7 @@ class EppDomainUpdateBaseTest < EppTestCase
</epp> </epp>
XML XML
post '/epp/command/update', { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames' post epp_update_path, { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
@domain.reload @domain.reload
assert_epp_response :completed_successfully assert_epp_response :completed_successfully
@ -287,7 +287,7 @@ class EppDomainUpdateBaseTest < EppTestCase
</epp> </epp>
XML XML
post '/epp/command/update', { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames' post epp_update_path, { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
@domain.reload @domain.reload
assert_epp_response :completed_successfully assert_epp_response :completed_successfully

View file

@ -9,7 +9,7 @@ class EppHelloTest < EppTestCase
</epp> </epp>
XML XML
get '/epp/session/hello', { frame: request_xml }, 'HTTP_COOKIE' => 'session=non-existent' get epp_hello_path, { frame: request_xml }, 'HTTP_COOKIE' => 'session=non-existent'
response_xml = Nokogiri::XML(response.body) response_xml = Nokogiri::XML(response.body)
assert_equal 'EPP server (EIS)', response_xml.at_css('greeting > svID').text assert_equal 'EPP server (EIS)', response_xml.at_css('greeting > svID').text

View file

@ -24,7 +24,7 @@ class EppLoginCredentialsTest < EppTestCase
</epp> </epp>
XML XML
post '/epp/session/login', { frame: request_xml }, { 'HTTP_COOKIE' => 'session=new_session_id' } post epp_login_path, { frame: request_xml }, { 'HTTP_COOKIE' => 'session=new_session_id' }
assert EppSession.find_by(session_id: 'new_session_id') assert EppSession.find_by(session_id: 'new_session_id')
assert_equal users(:api_bestnames), EppSession.find_by(session_id: 'new_session_id').user assert_equal users(:api_bestnames), EppSession.find_by(session_id: 'new_session_id').user
assert_epp_response :completed_successfully assert_epp_response :completed_successfully
@ -57,7 +57,7 @@ class EppLoginCredentialsTest < EppTestCase
</epp> </epp>
XML XML
post '/epp/session/login', { frame: request_xml }, 'HTTP_COOKIE' => 'session=any_random_string' post epp_login_path, { frame: request_xml }, 'HTTP_COOKIE' => 'session=any_random_string'
assert_epp_response :authentication_error_server_closing_connection assert_epp_response :authentication_error_server_closing_connection
end end

View file

@ -25,7 +25,7 @@ class EppLoginPasswordChangeTest < EppTestCase
</epp> </epp>
XML XML
post '/epp/session/login', { frame: request_xml }, { 'HTTP_COOKIE' => 'session=new_session_id' } post epp_login_path, { frame: request_xml }, { 'HTTP_COOKIE' => 'session=new_session_id' }
assert_equal 'new-password', users(:api_bestnames).plain_text_password assert_equal 'new-password', users(:api_bestnames).plain_text_password
assert_epp_response :completed_successfully assert_epp_response :completed_successfully
end end

View file

@ -14,7 +14,7 @@ class EppLoginSessionLimitTest < EppTestCase
end end
assert_difference 'EppSession.count' do assert_difference 'EppSession.count' do
post '/epp/session/login', { frame: request_xml }, { 'HTTP_COOKIE' => 'session=new_session_id' } post epp_login_path, { frame: request_xml }, { 'HTTP_COOKIE' => 'session=new_session_id' }
end end
assert_epp_response :completed_successfully assert_epp_response :completed_successfully
end end
@ -27,7 +27,7 @@ class EppLoginSessionLimitTest < EppTestCase
end end
assert_no_difference 'EppSession.count' do assert_no_difference 'EppSession.count' do
post '/epp/session/login', { frame: request_xml }, { 'HTTP_COOKIE' => 'session=new_session_id' } post epp_login_path, { frame: request_xml }, { 'HTTP_COOKIE' => 'session=new_session_id' }
end end
assert_epp_response :authentication_error_server_closing_connection assert_epp_response :authentication_error_server_closing_connection
end end

View file

@ -2,22 +2,22 @@ require 'test_helper'
class EppLogoutTest < EppTestCase class EppLogoutTest < EppTestCase
def test_success_response def test_success_response
post '/epp/session/logout', { frame: request_xml }, { 'HTTP_COOKIE' => 'session=api_bestnames' } post epp_logout_path, { frame: request_xml }, { 'HTTP_COOKIE' => 'session=api_bestnames' }
assert_epp_response :completed_successfully_ending_session assert_epp_response :completed_successfully_ending_session
end end
def test_ends_current_session def test_ends_current_session
post '/epp/session/logout', { frame: request_xml }, { 'HTTP_COOKIE' => 'session=api_bestnames' } post epp_logout_path, { frame: request_xml }, { 'HTTP_COOKIE' => 'session=api_bestnames' }
assert_nil EppSession.find_by(session_id: 'api_bestnames') assert_nil EppSession.find_by(session_id: 'api_bestnames')
end end
def test_keeps_other_sessions_intact def test_keeps_other_sessions_intact
post '/epp/session/logout', { frame: request_xml }, { 'HTTP_COOKIE' => 'session=api_bestnames' } post epp_logout_path, { frame: request_xml }, { 'HTTP_COOKIE' => 'session=api_bestnames' }
assert EppSession.find_by(session_id: 'api_goodnames') assert EppSession.find_by(session_id: 'api_goodnames')
end end
def test_anonymous_user def test_anonymous_user
post '/epp/session/logout', { frame: request_xml }, { 'HTTP_COOKIE' => 'session=non-existent' } post epp_logout_path, { frame: request_xml }, { 'HTTP_COOKIE' => 'session=non-existent' }
assert_epp_response :authorization_error assert_epp_response :authorization_error
end end

View file

@ -15,7 +15,7 @@ class EppPollTest < EppTestCase
</command> </command>
</epp> </epp>
XML XML
post '/epp/command/poll', { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames' post epp_poll_path, { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
xml_doc = Nokogiri::XML(response.body) xml_doc = Nokogiri::XML(response.body)
assert_epp_response :completed_successfully_ack_to_dequeue assert_epp_response :completed_successfully_ack_to_dequeue
@ -36,7 +36,7 @@ class EppPollTest < EppTestCase
</command> </command>
</epp> </epp>
XML XML
post '/epp/command/poll', { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames' post epp_poll_path, { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
xml_doc = Nokogiri::XML(response.body) xml_doc = Nokogiri::XML(response.body)
namespace = 'https://epp.tld.ee/schema/changePoll-1.0.xsd' namespace = 'https://epp.tld.ee/schema/changePoll-1.0.xsd'
@ -60,7 +60,7 @@ class EppPollTest < EppTestCase
</command> </command>
</epp> </epp>
XML XML
post '/epp/command/poll', { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames' post epp_poll_path, { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
assert_epp_response :completed_successfully_no_messages assert_epp_response :completed_successfully_no_messages
end end
@ -77,7 +77,7 @@ class EppPollTest < EppTestCase
</epp> </epp>
XML XML
post '/epp/command/poll', { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames' post epp_poll_path, { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
notification.reload notification.reload
xml_doc = Nokogiri::XML(response.body) xml_doc = Nokogiri::XML(response.body)
@ -98,7 +98,7 @@ class EppPollTest < EppTestCase
</command> </command>
</epp> </epp>
XML XML
post '/epp/command/poll', { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames' post epp_poll_path, { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
notification.reload notification.reload
assert notification.unread? assert notification.unread?
@ -114,7 +114,7 @@ class EppPollTest < EppTestCase
</command> </command>
</epp> </epp>
XML XML
post '/epp/command/poll', { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames' post epp_poll_path, { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
assert_epp_response :object_does_not_exist assert_epp_response :object_does_not_exist
end end