summaryrefslogtreecommitdiff
path: root/spec/support/helpers/stub_configuration.rb
diff options
context:
space:
mode:
authorStan Hu <stanhu@gmail.com>2019-06-27 15:44:46 -0700
committerStan Hu <stanhu@gmail.com>2019-06-27 23:16:11 -0700
commit82c31a9addfe87e91b512abb982d2223fa4ed730 (patch)
tree56e0570df7f3999d633372bd6d285297d3732169 /spec/support/helpers/stub_configuration.rb
parentae68c7ea142b12fe179a4027b17d31ac6fb2649c (diff)
downloadgitlab-ce-82c31a9addfe87e91b512abb982d2223fa4ed730.tar.gz
Support CIDR notation in IP rate limitersh-support-subnets-ip-rate-limiter
This will make it possible to whitelist multiple IP addresses (e.g. 192.168.0.1/24).
Diffstat (limited to 'spec/support/helpers/stub_configuration.rb')
-rw-r--r--spec/support/helpers/stub_configuration.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/spec/support/helpers/stub_configuration.rb b/spec/support/helpers/stub_configuration.rb
index 0d591f038ce..c372a3f0e49 100644
--- a/spec/support/helpers/stub_configuration.rb
+++ b/spec/support/helpers/stub_configuration.rb
@@ -95,6 +95,11 @@ module StubConfiguration
allow(Gitlab.config.gitlab_shell).to receive_messages(to_settings(messages))
end
+ def stub_rack_attack_setting(messages)
+ allow(Gitlab.config.rack_attack).to receive(:git_basic_auth).and_return(messages)
+ allow(Gitlab.config.rack_attack.git_basic_auth).to receive_messages(to_settings(messages))
+ end
+
private
# Modifies stubbed messages to also stub possible predicate versions