diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-06-02 00:10:06 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-06-02 00:10:06 +0300 |
commit | f7bc7dc5eafc4eef9043a3d1b2dcbc15ca76a571 (patch) | |
tree | 8577ded3a5ac4c2b76d7194066fccf9882159956 /spec/initializers/lograge_spec.rb | |
parent | c3afdb42ddc7f24d51032ed0daef071a2dafdc93 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/initializers/lograge_spec.rb')
-rw-r--r-- | spec/initializers/lograge_spec.rb | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/spec/initializers/lograge_spec.rb b/spec/initializers/lograge_spec.rb index abb1673bb88..421f6373eff 100644 --- a/spec/initializers/lograge_spec.rb +++ b/spec/initializers/lograge_spec.rb @@ -173,6 +173,27 @@ RSpec.describe 'lograge', type: :request do end end + describe 'with access token in url' do + before do + event.payload[:location] = 'http://example.com/auth.html#access_token=secret_token&token_type=Bearer' + end + + it 'strips location from sensitive information' do + subscriber.redirect_to(event) + subscriber.process_action(event) + + expect(log_data['location']).not_to include('secret_token') + expect(log_data['location']).to include('filtered') + end + + it 'leaves non-sensitive information from location' do + subscriber.redirect_to(event) + subscriber.process_action(event) + + expect(log_data['location']).to include('&token_type=Bearer') + end + end + context 'with db payload' do context 'when RequestStore is enabled', :request_store do it 'includes db counters' do |