mirror of
https://github.com/internetee/registry.git
synced 2025-06-11 15:14:47 +02:00
parent
03c81c4c5d
commit
79d9c631f5
6 changed files with 25 additions and 17 deletions
|
@ -450,7 +450,12 @@ class Epp::Domain < Domain
|
||||||
def update(frame, current_user, verify = true)
|
def update(frame, current_user, verify = true)
|
||||||
return super if frame.blank?
|
return super if frame.blank?
|
||||||
|
|
||||||
check_discarded
|
if discarded?
|
||||||
|
throw :epp_error, {
|
||||||
|
code: '2304',
|
||||||
|
msg: 'Object status prohibits operation',
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
at = {}.with_indifferent_access
|
at = {}.with_indifferent_access
|
||||||
at.deep_merge!(attrs_from(frame.css('chg'), current_user, 'chg'))
|
at.deep_merge!(attrs_from(frame.css('chg'), current_user, 'chg'))
|
||||||
|
@ -525,7 +530,12 @@ class Epp::Domain < Domain
|
||||||
end
|
end
|
||||||
|
|
||||||
def epp_destroy(frame, user_id)
|
def epp_destroy(frame, user_id)
|
||||||
check_discarded
|
if discarded?
|
||||||
|
throw :epp_error, {
|
||||||
|
code: '2304',
|
||||||
|
msg: 'Object status prohibits operation',
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
if doc = attach_legal_document(Epp::Domain.parse_legal_document_from_frame(frame))
|
if doc = attach_legal_document(Epp::Domain.parse_legal_document_from_frame(frame))
|
||||||
frame.css("legalDocument").first.content = doc.path if doc&.persisted?
|
frame.css("legalDocument").first.content = doc.path if doc&.persisted?
|
||||||
|
@ -590,7 +600,12 @@ class Epp::Domain < Domain
|
||||||
### TRANSFER ###
|
### TRANSFER ###
|
||||||
|
|
||||||
def transfer(frame, action, current_user)
|
def transfer(frame, action, current_user)
|
||||||
check_discarded
|
if discarded?
|
||||||
|
throw :epp_error, {
|
||||||
|
code: '2106',
|
||||||
|
msg: 'Object is not eligible for transfer',
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
@is_transfer = true
|
@is_transfer = true
|
||||||
|
|
||||||
|
@ -814,15 +829,4 @@ class Epp::Domain < Domain
|
||||||
result
|
result
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
|
||||||
|
|
||||||
def check_discarded
|
|
||||||
if discarded?
|
|
||||||
throw :epp_error, {
|
|
||||||
code: '2105',
|
|
||||||
msg: I18n.t(:object_is_not_eligible_for_renewal),
|
|
||||||
}
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
|
@ -18,6 +18,7 @@ module Epp
|
||||||
parameter_value_syntax_error: 2005,
|
parameter_value_syntax_error: 2005,
|
||||||
billing_failure: 2104,
|
billing_failure: 2104,
|
||||||
object_is_not_eligible_for_renewal: 2105,
|
object_is_not_eligible_for_renewal: 2105,
|
||||||
|
object_is_not_eligible_for_transfer: 2106,
|
||||||
authorization_error: 2201,
|
authorization_error: 2201,
|
||||||
invalid_authorization_information: 2202,
|
invalid_authorization_information: 2202,
|
||||||
object_does_not_exist: 2303,
|
object_does_not_exist: 2303,
|
||||||
|
@ -43,6 +44,7 @@ module Epp
|
||||||
2005 => 'Parameter value syntax error',
|
2005 => 'Parameter value syntax error',
|
||||||
2104 => 'Billing failure',
|
2104 => 'Billing failure',
|
||||||
2105 => 'Object is not eligible for renewal',
|
2105 => 'Object is not eligible for renewal',
|
||||||
|
2106 => 'Object is not eligible for transfer',
|
||||||
2201 => 'Authorization error',
|
2201 => 'Authorization error',
|
||||||
2202 => 'Invalid authorization information',
|
2202 => 'Invalid authorization information',
|
||||||
2303 => 'Object does not exist',
|
2303 => 'Object does not exist',
|
||||||
|
|
|
@ -64,7 +64,7 @@ class EppDomainDeleteBaseTest < EppTestCase
|
||||||
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/command/delete', { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
|
||||||
end
|
end
|
||||||
assert_epp_response :object_is_not_eligible_for_renewal
|
assert_epp_response :object_status_prohibits_operation
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_requests_registrant_confirmation_when_required
|
def test_requests_registrant_confirmation_when_required
|
||||||
|
|
|
@ -47,6 +47,6 @@ class EppDomainUpdateTest < EppTestCase
|
||||||
XML
|
XML
|
||||||
|
|
||||||
post '/epp/command/update', { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
|
post '/epp/command/update', { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
|
||||||
assert_epp_response :object_is_not_eligible_for_renewal
|
assert_epp_response :object_status_prohibits_operation
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -86,7 +86,7 @@ class EppDomainTransferRequestTest < EppTestCase
|
||||||
@domain.reload
|
@domain.reload
|
||||||
|
|
||||||
assert_equal registrars(:bestnames), @domain.registrar
|
assert_equal registrars(:bestnames), @domain.registrar
|
||||||
assert_epp_response :object_is_not_eligible_for_renewal
|
assert_epp_response :object_is_not_eligible_for_transfer
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_same_registrar
|
def test_same_registrar
|
||||||
|
|
|
@ -39,6 +39,7 @@ class EppResponseResultCodeTest < ActiveSupport::TestCase
|
||||||
parameter_value_syntax_error: 2005,
|
parameter_value_syntax_error: 2005,
|
||||||
billing_failure: 2104,
|
billing_failure: 2104,
|
||||||
object_is_not_eligible_for_renewal: 2105,
|
object_is_not_eligible_for_renewal: 2105,
|
||||||
|
object_is_not_eligible_for_transfer: 2106,
|
||||||
authorization_error: 2201,
|
authorization_error: 2201,
|
||||||
invalid_authorization_information: 2202,
|
invalid_authorization_information: 2202,
|
||||||
object_does_not_exist: 2303,
|
object_does_not_exist: 2303,
|
||||||
|
@ -66,6 +67,7 @@ class EppResponseResultCodeTest < ActiveSupport::TestCase
|
||||||
2005 => 'Parameter value syntax error',
|
2005 => 'Parameter value syntax error',
|
||||||
2104 => 'Billing failure',
|
2104 => 'Billing failure',
|
||||||
2105 => 'Object is not eligible for renewal',
|
2105 => 'Object is not eligible for renewal',
|
||||||
|
2106 => 'Object is not eligible for transfer',
|
||||||
2201 => 'Authorization error',
|
2201 => 'Authorization error',
|
||||||
2202 => 'Invalid authorization information',
|
2202 => 'Invalid authorization information',
|
||||||
2303 => 'Object does not exist',
|
2303 => 'Object does not exist',
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue