diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-05-19 10:33:21 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-05-19 10:33:21 +0300 |
commit | 36a59d088eca61b834191dacea009677a96c052f (patch) | |
tree | e4f33972dab5d8ef79e3944a9f403035fceea43f /spec/support/shared_examples/requests/rack_attack_shared_examples.rb | |
parent | a1761f15ec2cae7c7f7bbda39a75494add0dfd6f (diff) |
Add latest changes from gitlab-org/gitlab@15-0-stable-eev15.0.0-rc42
Diffstat (limited to 'spec/support/shared_examples/requests/rack_attack_shared_examples.rb')
-rw-r--r-- | spec/support/shared_examples/requests/rack_attack_shared_examples.rb | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/spec/support/shared_examples/requests/rack_attack_shared_examples.rb b/spec/support/shared_examples/requests/rack_attack_shared_examples.rb index 68cb91d7414..d4417b23a5f 100644 --- a/spec/support/shared_examples/requests/rack_attack_shared_examples.rb +++ b/spec/support/shared_examples/requests/rack_attack_shared_examples.rb @@ -149,6 +149,7 @@ RSpec.shared_examples 'rate-limited token requests' do arguments = a_hash_including({ message: 'Rack_Attack', + status: 429, env: :throttle, remote_ip: '127.0.0.1', request_method: request_method, @@ -314,6 +315,7 @@ RSpec.shared_examples 'rate-limited web authenticated requests' do arguments = a_hash_including({ message: 'Rack_Attack', + status: 429, env: :throttle, remote_ip: '127.0.0.1', request_method: request_method, @@ -391,14 +393,16 @@ RSpec.shared_examples 'tracking when dry-run mode is set' do end it 'logs RackAttack info into structured logs' do - arguments = a_hash_including({ - message: 'Rack_Attack', - env: :track, - remote_ip: '127.0.0.1', - matched: throttle_name - }) + expect(Gitlab::AuthLogger).to receive(:error) do |arguments| + expect(arguments).to include( + message: 'Rack_Attack', + env: :track, + remote_ip: '127.0.0.1', + matched: throttle_name + ) - expect(Gitlab::AuthLogger).to receive(:error).with(arguments) + expect(arguments).not_to have_key(:status) + end (1 + requests_per_period).times do do_request @@ -576,6 +580,7 @@ RSpec.shared_examples 'rate-limited unauthenticated requests' do arguments = a_hash_including({ message: 'Rack_Attack', + status: 429, env: :throttle, remote_ip: '127.0.0.1', request_method: 'GET', |