mirror of
https://github.com/internetee/registry.git
synced 2025-07-31 15:06:23 +02:00
Add rate limiting to all repp actions
This commit is contained in:
parent
fb60466194
commit
2a58bf3849
48 changed files with 757 additions and 16 deletions
|
@ -2,6 +2,9 @@ module Repp
|
|||
module V1
|
||||
module Domains
|
||||
class AdminContactsController < BaseContactsController
|
||||
THROTTLED_ACTIONS = %i[update].freeze
|
||||
include Shunter::Integration::Throttle
|
||||
|
||||
def update
|
||||
super
|
||||
|
||||
|
|
|
@ -4,6 +4,9 @@ module Repp
|
|||
class ContactsController < BaseContactsController
|
||||
before_action :set_domain, only: %i[index create destroy]
|
||||
|
||||
THROTTLED_ACTIONS = %i[index create destroy update].freeze
|
||||
include Shunter::Integration::Throttle
|
||||
|
||||
def_param_group :contacts_apidoc do
|
||||
param :contacts, Array, required: true, desc: 'Array of new linked contacts' do
|
||||
param :code, String, required: true, desc: 'Contact code'
|
||||
|
|
|
@ -4,6 +4,9 @@ module Repp
|
|||
class DnssecController < BaseController
|
||||
before_action :set_domain, only: %i[index create destroy]
|
||||
|
||||
THROTTLED_ACTIONS = %i[index create destroy].freeze
|
||||
include Shunter::Integration::Throttle
|
||||
|
||||
def_param_group :dns_keys_apidoc do
|
||||
param :flags, String, required: true, desc: '256 (KSK) or 257 (ZSK)'
|
||||
param :protocol, String, required: true, desc: 'Key protocol (3)'
|
||||
|
|
|
@ -5,6 +5,9 @@ module Repp
|
|||
before_action :set_domain, only: %i[index create destroy]
|
||||
before_action :set_nameserver, only: %i[destroy]
|
||||
|
||||
THROTTLED_ACTIONS = %i[index create destroy].freeze
|
||||
include Shunter::Integration::Throttle
|
||||
|
||||
api :GET, '/repp/v1/domains/:domain_name/nameservers'
|
||||
desc "Get domain's nameservers"
|
||||
def index
|
||||
|
|
|
@ -6,6 +6,9 @@ module Repp
|
|||
before_action :select_renewable_domains, only: [:bulk_renew]
|
||||
before_action :set_domain, only: [:create]
|
||||
|
||||
THROTTLED_ACTIONS = %i[create bulk_renew].freeze
|
||||
include Shunter::Integration::Throttle
|
||||
|
||||
api :POST, 'repp/v1/domains/:domain_name/renew'
|
||||
desc 'Renew domain'
|
||||
param :renews, Hash, required: true, desc: 'Renew parameters' do
|
||||
|
|
|
@ -5,6 +5,9 @@ module Repp
|
|||
before_action :set_domain, only: %i[update destroy]
|
||||
before_action :verify_status
|
||||
|
||||
THROTTLED_ACTIONS = %i[update destroy].freeze
|
||||
include Shunter::Integration::Throttle
|
||||
|
||||
api :DELETE, '/repp/v1/domains/:domain_name/statuses/:status'
|
||||
param :domain_name, String, desc: 'Domain name'
|
||||
desc 'Remove status from specific domain'
|
||||
|
|
|
@ -4,6 +4,9 @@ module Repp
|
|||
class TransfersController < BaseController
|
||||
before_action :set_domain, only: [:create]
|
||||
|
||||
THROTTLED_ACTIONS = %i[create].freeze
|
||||
include Shunter::Integration::Throttle
|
||||
|
||||
api :POST, 'repp/v1/domains/:domain_name/transfer'
|
||||
desc 'Transfer a specific domain'
|
||||
param :transfer, Hash, required: true, desc: 'Renew parameters' do
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue