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
# 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.

  value.gsub!(token, 'x' * token.bytesize)
  value
end