Plug in shunter gem

This commit is contained in:
Alex Sherman 2021-06-15 11:21:12 +05:00 committed by olegphenomenon
parent ded19f8083
commit 4db0ab558f
2 changed files with 9 additions and 0 deletions

View file

@ -6,6 +6,9 @@ module Epp
before_action :set_paper_trail_whodunnit
before_action :parse_schemas_prefix_and_version
THROTTLED_ACTIONS = %i[info renew update transfer delete].freeze
include Shunter::Integration::Throttle
def info
authorize! :info, @domain
@ -131,6 +134,11 @@ module Epp
private
def throttled_user
authorize!(:throttled_user, @domain) unless current_user
current_user
end
def validate_info
@prefix = 'info > info >'
requires('name')