diff options
author | Pawel Chojnacki <pawel@chojnacki.ws> | 2017-07-04 23:50:18 +0200 |
---|---|---|
committer | Pawel Chojnacki <pawel@chojnacki.ws> | 2017-07-05 00:46:12 +0200 |
commit | 2f875c40374597ca98104cd40a357a9a928335ff (patch) | |
tree | 534fa9883193e9280ae9e17331335277bdc503e1 /app | |
parent | e5a6f268bd0703410781afaa62e8ecb3a1f7513d (diff) | |
download | gitlab-ce-2f875c40374597ca98104cd40a357a9a928335ff.tar.gz |
Finish refactring processed configuraiton, and add test validating ip range matching
Diffstat (limited to 'app')
-rw-r--r-- | app/controllers/concerns/requires_whitelisted_monitoring_client.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/app/controllers/concerns/requires_whitelisted_monitoring_client.rb b/app/controllers/concerns/requires_whitelisted_monitoring_client.rb index 1205dcb97c2..e77fe4026cc 100644 --- a/app/controllers/concerns/requires_whitelisted_monitoring_client.rb +++ b/app/controllers/concerns/requires_whitelisted_monitoring_client.rb @@ -1,17 +1,17 @@ module RequiresWhitelistedMonitoringClient extend ActiveSupport::Concern included do - before_action :validate_ip_whitelisted! + before_action :validate_ip_whitelisted_or_token_is_valid! end private - def validate_ip_whitelisted! + def validate_ip_whitelisted_or_token_is_valid! render_404 unless client_ip_whitelisted? || token_valid? end def client_ip_whitelisted? - Settings.monitoring.ip_whitelist.any? { |e| e.include?(Gitlab::RequestContext.client_ip) } + ip_whitelist.any? { |e| e.include?(Gitlab::RequestContext.client_ip) } end def ip_whitelist |