mirror of
https://github.com/internetee/registry.git
synced 2025-07-22 10:45:58 +02:00
parent
0893d5b6f2
commit
fc71bf93e7
46 changed files with 21 additions and 1487 deletions
|
@ -58,7 +58,7 @@ module Epp
|
|||
end
|
||||
|
||||
def validate_against_schema
|
||||
return if ['hello', 'error', 'keyrelay'].include?(params[:action])
|
||||
return if %w[hello error].include?(params[:action])
|
||||
schema.validate(params[:nokogiri_frame]).each do |error|
|
||||
epp_errors << {
|
||||
code: 2001,
|
||||
|
|
|
@ -1,63 +0,0 @@
|
|||
module Epp
|
||||
class KeyrelaysController < BaseController
|
||||
skip_authorization_check # TODO: move authorization under ability
|
||||
|
||||
def keyrelay
|
||||
# keyrelay temp turned off
|
||||
@domain = find_domain
|
||||
|
||||
handle_errors(@domain) and return unless @domain
|
||||
handle_errors(@domain) and return unless @domain.authenticate(params[:parsed_frame].css('pw').text)
|
||||
handle_errors(@domain) and return unless @domain.keyrelay(params[:parsed_frame], current_user.registrar)
|
||||
|
||||
render_epp_response '/epp/shared/success'
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def validate_keyrelay
|
||||
@prefix = 'keyrelay >'
|
||||
|
||||
requires(
|
||||
'name',
|
||||
'keyData', 'keyData > pubKey', 'keyData > flags', 'keyData > protocol', 'keyData > alg',
|
||||
'authInfo', 'authInfo > pw'
|
||||
)
|
||||
|
||||
optional 'expiry > relative', duration_iso8601: true
|
||||
optional 'expiry > absolute', date_time_iso8601: true
|
||||
|
||||
exactly_one_of 'expiry > relative', 'expiry > absolute'
|
||||
end
|
||||
|
||||
def find_domain
|
||||
domain_name = params[:parsed_frame].css('name').text.strip.downcase
|
||||
|
||||
# keyrelay temp turned off
|
||||
epp_errors << {
|
||||
code: '2307',
|
||||
msg: I18n.t(:unimplemented_object_service),
|
||||
value: { obj: 'name', val: domain_name }
|
||||
}
|
||||
nil
|
||||
# end of keyrelay temp turned off
|
||||
|
||||
# domain = Epp::Domain.includes(:registrant).find_by(name: domain_name)
|
||||
|
||||
# unless domain
|
||||
# epp_errors << {
|
||||
# code: '2303',
|
||||
# msg: I18n.t('errors.messages.epp_domain_not_found'),
|
||||
# value: { obj: 'name', val: domain_name }
|
||||
# }
|
||||
# return nil
|
||||
# end
|
||||
|
||||
# domain
|
||||
end
|
||||
|
||||
def resource
|
||||
@domain
|
||||
end
|
||||
end
|
||||
end
|
|
@ -29,11 +29,7 @@ module Epp
|
|||
end
|
||||
end
|
||||
|
||||
if @notification.attached_obj_type == 'Keyrelay'
|
||||
render_epp_response 'epp/poll/poll_keyrelay'
|
||||
else
|
||||
render_epp_response 'epp/poll/poll_req'
|
||||
end
|
||||
render_epp_response 'epp/poll/poll_req'
|
||||
end
|
||||
|
||||
def ack_poll
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue