diff --git a/CHANGELOG.md b/CHANGELOG.md index 68391b057..ce74bbb10 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,27 @@ +20.05.2016 + +* Portal for registrars + * domain details view new displays contact name in addition to ID (#117226457) + * added an option to set veryfied = "yes" parameter to GUI for registrant change and domain delete opertions (#116209751) +* Admin interface + * BUG: fixed number of sorting issues on different views (#117350717) + * BUG: internal error on filtered list sorting (#115043065) + * BUG: account activities csv export messes up registrars (#117702653) + * usability fixes to history view (#115762063) +* Registry + * epp-xml gem reference updated to v 1.0.5 (#116209751) + * epp-xml gem is now taken from local repo https://github.com/internetee/epp-xml/blob/master, the version in RubyGems is not updated any more (#116209751) + * BUG: domains set to force delete were deleted a day ahead of time (#117131083) + * BUG: QUE - undefined method `code' for nil:NilClass - if contact is removed before Que gets to it (#117612061) + * BUG: Que - uninitialized constant RegenerateWhoisRecordJob (#117986917) +* EPP + * BUG: poll message on domain delete does not validate against .ee xml schemas (#118827261) + * BUG: internal error on domain delete (#118159567) +* RestWHOIS + * BUG: statuses not in array for not registered reserved and blocked domains (#118911315) + +... + 21.09.2015 * eis-1.0.xsd schema file updated without a new version, please publish a new updated schema file to public. diff --git a/app/controllers/epp/keyrelays_controller.rb b/app/controllers/epp/keyrelays_controller.rb index d6515758f..81ff3dd32 100644 --- a/app/controllers/epp/keyrelays_controller.rb +++ b/app/controllers/epp/keyrelays_controller.rb @@ -56,4 +56,8 @@ class Epp::KeyrelaysController < EppController # domain end + + def resource + @domain + end end diff --git a/app/controllers/epp/polls_controller.rb b/app/controllers/epp/polls_controller.rb index 531509a6c..fb032975f 100644 --- a/app/controllers/epp/polls_controller.rb +++ b/app/controllers/epp/polls_controller.rb @@ -54,4 +54,8 @@ class Epp::PollsController < EppController def validate_poll requires_attribute 'poll', 'op', values: %(ack req), allow_blank: true end + + def resource + @message + end end diff --git a/app/controllers/epp/sessions_controller.rb b/app/controllers/epp/sessions_controller.rb index c217d38aa..58a314410 100644 --- a/app/controllers/epp/sessions_controller.rb +++ b/app/controllers/epp/sessions_controller.rb @@ -137,4 +137,9 @@ class Epp::SessionsController < EppController pw = params[:parsed_frame].css('pw').first.text { username: user, password: pw } end + + private + def resource + @api_user + end end diff --git a/app/controllers/epp_controller.rb b/app/controllers/epp_controller.rb index de1002604..e7d3f0ac1 100644 --- a/app/controllers/epp_controller.rb +++ b/app/controllers/epp_controller.rb @@ -6,8 +6,15 @@ class EppController < ApplicationController before_action :generate_svtrid before_action :latin_only - before_action :validate_against_schema + before_action :validate_request + before_action :update_epp_session + + around_action :catch_epp_errors + + helper_method :current_user + helper_method :resource + def validate_against_schema return if ['hello', 'error', 'keyrelay'].include?(params[:action]) schema.validate(params[:nokogiri_frame]).each do |error| @@ -20,10 +27,7 @@ class EppController < ApplicationController handle_errors and return if epp_errors.any? end - before_action :validate_request - before_action :update_epp_session - around_action :catch_epp_errors def catch_epp_errors err = catch(:epp_error) do yield @@ -34,7 +38,6 @@ class EppController < ApplicationController handle_errors end - helper_method :current_user rescue_from StandardError do |e| @errors ||= [] @@ -367,7 +370,7 @@ class EppController < ApplicationController request: trimmed_request, request_command: request_command, request_successful: epp_errors.empty?, - request_object: params[:epp_object_type], + request_object: resource ? "#{params[:epp_object_type]}: #{resource.class} - #{resource.id} - #{resource.name}" : params[:epp_object_type], response: @response, api_user_name: @api_user.try(:username) || current_user.try(:username) || 'api-public', api_user_registrar: @api_user.try(:registrar).try(:to_s) || current_user.try(:registrar).try(:to_s), @@ -383,4 +386,9 @@ class EppController < ApplicationController return if current_user.blank? counter_update(current_user.registrar_code, ENV['iptables_server_ip']) end + + def resource + name = self.class.to_s.sub("Epp::","").sub("Controller","").underscore.singularize + instance_variable_get("@#{name}") + end end diff --git a/app/models/domain.rb b/app/models/domain.rb index 9a8ad1b07..d2a0fef68 100644 --- a/app/models/domain.rb +++ b/app/models/domain.rb @@ -741,9 +741,6 @@ class Domain < ActiveRecord::Base # rubocop: enable Metrics/CyclomaticComplexity # rubocop: enable Metrics/PerceivedComplexity - - # small optimization that we'are using to_a if it was done already - # otherwise just getting ids def children_log log = HashWithIndifferentAccess.new log[:admin_contacts] = admin_contact_ids diff --git a/config/routes.rb b/config/routes.rb index a041e41b7..39d6b3937 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -7,7 +7,7 @@ Rails.application.routes.draw do post 'command/:action', controller: 'domains', constraints: EppConstraint.new(:domain) post 'command/:action', controller: 'contacts', constraints: EppConstraint.new(:contact) - post 'command/poll', to: 'polls#poll', constraints: EppConstraint.new(:poll) + post 'command/poll', to: 'polls#poll', constraints: EppConstraint.new(:poll) post 'command/keyrelay', to: 'keyrelays#keyrelay', constraints: EppConstraint.new(:keyrelay) post 'command/:command', to: 'errors#not_found', constraints: EppConstraint.new(:not_found) # fallback route