diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-09-20 14:18:08 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-09-20 14:18:08 +0300 |
commit | 5afcbe03ead9ada87621888a31a62652b10a7e4f (patch) | |
tree | 9918b67a0d0f0bafa6542e839a8be37adf73102d /app/models/hooks/web_hook_log.rb | |
parent | c97c0201564848c1f53226fe19d71fdcc472f7d0 (diff) |
Add latest changes from gitlab-org/gitlab@16-4-stable-eev16.4.0-rc42
Diffstat (limited to 'app/models/hooks/web_hook_log.rb')
-rw-r--r-- | app/models/hooks/web_hook_log.rb | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/app/models/hooks/web_hook_log.rb b/app/models/hooks/web_hook_log.rb index 4c35f699468..3e0c8e7c472 100644 --- a/app/models/hooks/web_hook_log.rb +++ b/app/models/hooks/web_hook_log.rb @@ -1,7 +1,6 @@ # frozen_string_literal: true class WebHookLog < ApplicationRecord - include SafeUrl include Presentable include DeleteWithLimit include CreatedAtFilterable @@ -58,10 +57,18 @@ class WebHookLog < ApplicationRecord self[:request_headers].merge('X-Gitlab-Token' => _('[REDACTED]')) end + def url_current? + # URL hash hasn't been set, so we must assume there's no prior value to + # compare to. + return true if url_hash.nil? + + Gitlab::CryptoHelper.sha256(web_hook.interpolated_url) == url_hash + end + private def obfuscate_basic_auth - self.url = safe_url + self.url = Gitlab::UrlSanitizer.sanitize_masked_url(url) end def redact_user_emails |