Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'spec/models/hooks/web_hook_log_spec.rb')
-rw-r--r--spec/models/hooks/web_hook_log_spec.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/spec/models/hooks/web_hook_log_spec.rb b/spec/models/hooks/web_hook_log_spec.rb
index fd811d4845e..e9a2635bf28 100644
--- a/spec/models/hooks/web_hook_log_spec.rb
+++ b/spec/models/hooks/web_hook_log_spec.rb
@@ -46,6 +46,20 @@ RSpec.describe WebHookLog, feature_category: :webhooks do
end
end
+ context 'with basic auth credentials and masked components' do
+ let(:web_hook_log) { build(:web_hook_log, web_hook: hook, url: 'http://test:123@{domain}.com:{port}') }
+
+ subject { web_hook_log.save! }
+
+ it { is_expected.to eq(true) }
+
+ it 'obfuscates the basic auth credentials' do
+ subject
+
+ expect(web_hook_log.url).to eq('http://*****:*****@{domain}.com:{port}')
+ end
+ end
+
context "with users' emails" do
let(:author) { build(:user) }
let(:user) { build(:user) }