Commit 3b69456b authored by Robert Speicher's avatar Robert Speicher

Merge branch 'avoid_instance_level_check' into 'master'

Avoid restricting the revocation token work for GitLab.com only

See merge request gitlab-org/gitlab!50087
parents e7dc8660 991baaf2
...@@ -17,8 +17,7 @@ module EE ...@@ -17,8 +17,7 @@ module EE
private private
def revoke_secret_detection_token?(build) def revoke_secret_detection_token?(build)
::Gitlab.com? && ::Gitlab::CurrentSettings.secret_detection_token_revocation_enabled? &&
::Gitlab::CurrentSettings.secret_detection_token_revocation_enabled? &&
secret_detection_vulnerability_found?(build) secret_detection_vulnerability_found?(build)
end end
......
---
title: Automatic token revocation no longer restricted to gitlab.com
merge_request: 50087
author:
type: changed
...@@ -23,20 +23,15 @@ RSpec.describe BuildFinishedWorker do ...@@ -23,20 +23,15 @@ RSpec.describe BuildFinishedWorker do
describe '#revoke_secret_detection_token?' do describe '#revoke_secret_detection_token?' do
using RSpec::Parameterized::TableSyntax using RSpec::Parameterized::TableSyntax
where(:dot_com, :token_revocation_enabled, :secret_detection_vulnerability_found, :expected_result) do where(:token_revocation_enabled, :secret_detection_vulnerability_found, :expected_result) do
true | true | true | true true | true | true
true | true | false | false true | false | false
true | false | true | false false | true | false
true | false | false | false false | false | false
false | true | true | false
false | true | false | false
false | false | true | false
false | false | false | false
end end
with_them do with_them do
before do before do
allow(Gitlab).to receive(:com?) { dot_com }
stub_application_setting(secret_detection_token_revocation_enabled: token_revocation_enabled) stub_application_setting(secret_detection_token_revocation_enabled: token_revocation_enabled)
allow_next_instance_of(described_class) do |build_finished_worker| allow_next_instance_of(described_class) do |build_finished_worker|
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment