mirror of
https://github.com/internetee/registry.git
synced 2025-06-08 21:54:48 +02:00
Merge pull request #1276 from internetee/handle-anonymous-user
Handle anonymous user in EPP poll request
This commit is contained in:
commit
c1b3a3f81d
2 changed files with 17 additions and 2 deletions
|
@ -1,8 +1,7 @@
|
||||||
module Epp
|
module Epp
|
||||||
class PollsController < BaseController
|
class PollsController < BaseController
|
||||||
skip_authorization_check # TODO: move authorization under ability
|
|
||||||
|
|
||||||
def poll
|
def poll
|
||||||
|
authorize! :manage, :poll
|
||||||
req_poll if params[:parsed_frame].css('poll').first['op'] == 'req'
|
req_poll if params[:parsed_frame].css('poll').first['op'] == 'req'
|
||||||
ack_poll if params[:parsed_frame].css('poll').first['op'] == 'ack'
|
ack_poll if params[:parsed_frame].css('poll').first['op'] == 'ack'
|
||||||
end
|
end
|
||||||
|
|
|
@ -124,4 +124,20 @@ class EppPollTest < EppTestCase
|
||||||
|
|
||||||
assert_epp_response :object_does_not_exist
|
assert_epp_response :object_does_not_exist
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def test_anonymous_user_cannot_access
|
||||||
|
request_xml = <<-XML
|
||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
|
<epp xmlns="https://epp.tld.ee/schema/epp-ee-1.0.xsd">
|
||||||
|
<command>
|
||||||
|
<poll op="req"/>
|
||||||
|
</command>
|
||||||
|
</epp>
|
||||||
|
XML
|
||||||
|
|
||||||
|
post '/epp/command/poll', params: { frame: request_xml },
|
||||||
|
headers: { 'HTTP_COOKIE' => 'session=non-existent' }
|
||||||
|
|
||||||
|
assert_epp_response :authorization_error
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue