diff --git a/app/controllers/concerns/epp_requestable.rb b/app/controllers/concerns/epp_requestable.rb index 87f441d46..806842971 100644 --- a/app/controllers/concerns/epp_requestable.rb +++ b/app/controllers/concerns/epp_requestable.rb @@ -2,7 +2,7 @@ module EppRequestable extend ActiveSupport::Concern included do - before_action :validate_epp_user, only: :create + # before_action :validate_epp_user, only: :create end def create @@ -14,37 +14,37 @@ module EppRequestable private - def validate_epp_user - return unless handle_hello_request + # def validate_epp_user + # return unless handle_hello_request - handle_login_request - server.close_connection - rescue OpenSSL::SSL::SSLError => e - Rails.logger.error "INVALID CERT: #{e}" - Rails.logger.error "INVALID CERT DEBUG INFO: epp_hostname: #{ENV['epp_hostname']}," \ - "port: #{ENV['epp_port']}, cert_path: #{ENV['cert_path']}, key_path: #{ENV['key_path']}" - handle_non_epp_errors(nil, I18n.t('errors.messages.invalid_cert')) - end + # handle_login_request + # server.close_connection + # rescue OpenSSL::SSL::SSLError => e + # Rails.logger.error "INVALID CERT: #{e}" + # Rails.logger.error "INVALID CERT DEBUG INFO: epp_hostname: #{ENV['epp_hostname']}," \ + # "port: #{ENV['epp_port']}, cert_path: #{ENV['cert_path']}, key_path: #{ENV['key_path']}" + # handle_non_epp_errors(nil, I18n.t('errors.messages.invalid_cert')) + # end - def handle_hello_request - res = server.open_connection - unless Nokogiri::XML(res).css('greeting') - server.close_connection # just in case - handle_non_epp_errors(nil, I18n.t('errors.messages.failed_epp_conn')) and return false - end - true - end + # def handle_hello_request + # res = server.open_connection + # unless Nokogiri::XML(res).css('greeting') + # server.close_connection # just in case + # handle_non_epp_errors(nil, I18n.t('errors.messages.failed_epp_conn')) and return false + # end + # true + # end - def handle_login_request - tag = current_user.username - ex = EppXml::Session.new(cl_trid_prefix: tag) - xml = ex.login(clID: { value: tag }, pw: { value: current_user.plain_text_password }) - res = server.send_request(xml) + # def handle_login_request + # tag = current_user.username + # ex = EppXml::Session.new(cl_trid_prefix: tag) + # xml = ex.login(clID: { value: tag }, pw: { value: current_user.plain_text_password }) + # res = server.send_request(xml) - return if Nokogiri::XML(res).css('result').first['code'] == '1000' + # return if Nokogiri::XML(res).css('result').first['code'] == '1000' - handle_non_epp_errors(nil, Nokogiri::XML(res).css('result').text) - end + # handle_non_epp_errors(nil, Nokogiri::XML(res).css('result').text) + # end def server client_cert = File.read(ENV['cert_path']) diff --git a/test/integration/repp/v1/registrar/xml_console_test.rb b/test/integration/repp/v1/registrar/xml_console_test.rb index 19c82496f..bb3d7d7a3 100644 --- a/test/integration/repp/v1/registrar/xml_console_test.rb +++ b/test/integration/repp/v1/registrar/xml_console_test.rb @@ -21,7 +21,9 @@ class ReppV1RegistrarXmlConsoleTest < ActionDispatch::IntegrationTest end def test_check_schema_path - post repp_v1_registrar_xml_console_path, params: { xml_console: { payload: payload } }.to_json, + @auth_headers['Content-Type'] = 'application/json' + params = { xml_console: { payload: payload } } + post repp_v1_registrar_xml_console_path, params: params.to_json, headers: @auth_headers assert_response :ok