correctly handle transforming settings into useful datastructure
This commit is contained in:
parent
c1b043bdb7
commit
de6c3597ab
|
|
@ -13,7 +13,11 @@ module RequiresWhitelistedMonitoringClient
|
|||
def client_ip_whitelisted?
|
||||
Settings.monitoring.ip_whitelist.any? { |e| e.include?(Gitlab::RequestContext.client_ip) }
|
||||
end
|
||||
|
||||
|
||||
def ip_whitelist
|
||||
@ip_whitelist ||= Settings.monitoring.ip_whitelist.map(&IPAddr.method(:new))
|
||||
end
|
||||
|
||||
def token_valid?
|
||||
token = params[:token].presence || request.headers['TOKEN']
|
||||
token.present? &&
|
||||
|
|
|
|||
|
|
@ -499,7 +499,6 @@ Settings.webpack.dev_server['port'] ||= 3808
|
|||
#
|
||||
Settings['monitoring'] ||= Settingslogic.new({})
|
||||
Settings.monitoring['ip_whitelist'] ||= %w{127.0.0.1/8}
|
||||
Settings.monitoring.ip_whitelist.map!(&IPAddr.method(:new))
|
||||
|
||||
#
|
||||
# Prometheus metrics settings
|
||||
|
|
|
|||
Loading…
Reference in New Issue