mirror of
https://github.com/internetee/registry.git
synced 2025-06-08 21:54:48 +02:00
Merge pull request #1363 from internetee/handle-epp-contact-transfer
Handle EPP contact:transfer
This commit is contained in:
commit
8b3b8a38c8
5 changed files with 34 additions and 0 deletions
|
@ -76,6 +76,12 @@ module Epp
|
|||
handle_errors
|
||||
end
|
||||
|
||||
def transfer
|
||||
authorize! :transfer, Epp::Contact
|
||||
epp_errors << { code: '2101', msg: t(:'errors.messages.unimplemented_command') }
|
||||
handle_errors
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def find_password
|
||||
|
|
|
@ -64,6 +64,7 @@ class Ability
|
|||
can(:update, Epp::Contact) { |c, pw| c.registrar_id == @user.registrar_id || c.auth_info == pw }
|
||||
can(:delete, Epp::Contact) { |c, pw| c.registrar_id == @user.registrar_id || c.auth_info == pw }
|
||||
can(:renew, Epp::Contact)
|
||||
can(:transfer, Epp::Contact)
|
||||
can(:view_password, Epp::Contact) { |c, pw| c.registrar_id == @user.registrar_id || c.auth_info == pw }
|
||||
end
|
||||
|
||||
|
|
|
@ -16,6 +16,7 @@ module Epp
|
|||
required_parameter_missing: 2003,
|
||||
parameter_value_range_error: 2004,
|
||||
parameter_value_syntax_error: 2005,
|
||||
unimplemented: 2101,
|
||||
billing_failure: 2104,
|
||||
object_is_not_eligible_for_renewal: 2105,
|
||||
object_is_not_eligible_for_transfer: 2106,
|
||||
|
@ -43,6 +44,7 @@ module Epp
|
|||
2003 => 'Required parameter missing',
|
||||
2004 => 'Parameter value range error',
|
||||
2005 => 'Parameter value syntax error',
|
||||
2101 => 'Unimplemented command',
|
||||
2104 => 'Billing failure',
|
||||
2105 => 'Object is not eligible for renewal',
|
||||
2106 => 'Object is not eligible for transfer',
|
||||
|
|
23
test/integration/epp/contact/transfer/base_test.rb
Normal file
23
test/integration/epp/contact/transfer/base_test.rb
Normal file
|
@ -0,0 +1,23 @@
|
|||
require 'test_helper'
|
||||
|
||||
class EppContactTransferBaseTest < EppTestCase
|
||||
# https://github.com/internetee/registry/issues/676
|
||||
def test_not_implemented
|
||||
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>
|
||||
<transfer op="request">
|
||||
<contact:transfer xmlns:contact="https://epp.tld.ee/schema/contact-ee-1.1.xsd">
|
||||
<contact:id>any</contact:id>
|
||||
</contact:transfer>
|
||||
</transfer>
|
||||
</command>
|
||||
</epp>
|
||||
XML
|
||||
|
||||
post epp_transfer_path, { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
|
||||
|
||||
assert_epp_response :unimplemented
|
||||
end
|
||||
end
|
|
@ -38,6 +38,7 @@ class EppResponseResultCodeTest < ActiveSupport::TestCase
|
|||
parameter_value_range_error: 2004,
|
||||
parameter_value_syntax_error: 2005,
|
||||
billing_failure: 2104,
|
||||
unimplemented: 2101,
|
||||
object_is_not_eligible_for_renewal: 2105,
|
||||
object_is_not_eligible_for_transfer: 2106,
|
||||
authorization_error: 2201,
|
||||
|
@ -66,6 +67,7 @@ class EppResponseResultCodeTest < ActiveSupport::TestCase
|
|||
2003 => 'Required parameter missing',
|
||||
2004 => 'Parameter value range error',
|
||||
2005 => 'Parameter value syntax error',
|
||||
2101 => 'Unimplemented command',
|
||||
2104 => 'Billing failure',
|
||||
2105 => 'Object is not eligible for renewal',
|
||||
2106 => 'Object is not eligible for transfer',
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue