move lib/ci/mask_secret.rb
into lib/gitlab/ci/mask_secret.rb
This commit is contained in:
parent
c45ace8972
commit
5b296f81e2
5 changed files with 15 additions and 13 deletions
|
@ -446,8 +446,8 @@ module Ci
|
|||
return unless trace
|
||||
|
||||
trace = trace.dup
|
||||
Ci::MaskSecret.mask!(trace, project.runners_token) if project
|
||||
Ci::MaskSecret.mask!(trace, token)
|
||||
Gitlab::Ci::MaskSecret.mask!(trace, project.runners_token) if project
|
||||
Gitlab::Ci::MaskSecret.mask!(trace, token)
|
||||
trace
|
||||
end
|
||||
|
||||
|
|
|
@ -1,10 +0,0 @@
|
|||
module Ci::MaskSecret
|
||||
class << self
|
||||
def mask!(value, token)
|
||||
return value unless value.present? && token.present?
|
||||
|
||||
value.gsub!(token, 'x' * token.length)
|
||||
value
|
||||
end
|
||||
end
|
||||
end
|
12
lib/gitlab/ci/mask_secret.rb
Normal file
12
lib/gitlab/ci/mask_secret.rb
Normal file
|
@ -0,0 +1,12 @@
|
|||
module Gitlab
|
||||
module Ci::MaskSecret
|
||||
class << self
|
||||
def mask!(value, token)
|
||||
return value unless value.present? && token.present?
|
||||
|
||||
value.gsub!(token, 'x' * token.length)
|
||||
value
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
|
@ -1,6 +1,6 @@
|
|||
require 'spec_helper'
|
||||
|
||||
describe Ci::MaskSecret do
|
||||
describe Gitlab::Ci::MaskSecret do
|
||||
subject { described_class }
|
||||
|
||||
describe '#mask' do
|
Loading…
Reference in a new issue