mirror of
https://github.com/internetee/registry.git
synced 2025-08-05 09:21:43 +02:00
Merge repp, epp in IP whitelist
This commit is contained in:
parent
de60ad8e76
commit
df47e21086
7 changed files with 11 additions and 26 deletions
|
@ -147,12 +147,8 @@ class Registrar < ActiveRecord::Base
|
|||
self[:code] = code.gsub(/[ :]/, '').upcase if new_record? && code.present?
|
||||
end
|
||||
|
||||
def repp_ip_white?(ip)
|
||||
white_ips.repp.pluck(:ipv4, :ipv6).flatten.include?(ip) || global_ip_white?(ip)
|
||||
end
|
||||
|
||||
def epp_ip_white?(ip)
|
||||
white_ips.epp.pluck(:ipv4, :ipv6).flatten.include?(ip) || global_ip_white?(ip)
|
||||
def api_ip_white?(ip)
|
||||
white_ips.api.pluck(:ipv4, :ipv6).flatten.include?(ip) || global_ip_white?(ip)
|
||||
end
|
||||
|
||||
def registrar_ip_white?(ip)
|
||||
|
|
|
@ -13,15 +13,12 @@ class WhiteIp < ActiveRecord::Base
|
|||
errors.add(:base, I18n.t(:ipv4_or_ipv6_must_be_present))
|
||||
end
|
||||
|
||||
EPP = 'epp'
|
||||
REPP = 'repp'
|
||||
API = 'api'
|
||||
REGISTRAR = 'registrar'
|
||||
GLOBAL = 'global'
|
||||
INTERFACES = [GLOBAL, API, REGISTRAR]
|
||||
|
||||
INTERFACES = [GLOBAL, EPP, REPP, REGISTRAR]
|
||||
|
||||
scope :epp, -> { where(interface: EPP) }
|
||||
scope :repp, -> { where(interface: REPP) }
|
||||
scope :api, -> { where(interface: API) }
|
||||
scope :registrar, -> { where(interface: REGISTRAR) }
|
||||
scope :global, -> { where(interface: GLOBAL) }
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue