Welcome to mirror list, hosted at ThFree Co, Russian Federation.

mask_secret.rb « ci « gitlab « lib - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: e5a7151b82353df37da8860870a7f975a94432e9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# frozen_string_literal: true

module Gitlab
  module Ci::MaskSecret
    class << self
      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
    end
  end
end