Module: Gitlab::Ci::MaskSecret

Defined in:
lib/gitlab/ci/mask_secret.rb

Class Method Summary collapse

Class Method Details

.mask!(value, token) ⇒ Object


6
7
8
9
10
11
12
13
14
15
16
17
18
# File 'lib/gitlab/ci/mask_secret.rb', line 6

def mask!(value, token)
  return value unless value.present? && token.present?

  # We assume 'value' must be mutable, given
  # that frozen string is enabled.

  ##
  # TODO We need to remove this because it is going to change checksum of
  # a trace.
  #
  value.gsub!(token, 'x' * token.length)
  value
end