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

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaxim Rydkin <maks.rydkin@gmail.com>2017-09-06 14:26:15 +0300
committerMaxim Rydkin <maks.rydkin@gmail.com>2017-09-12 22:32:02 +0300
commit5b296f81e2f49fc7dc2d3b091340a9a8b86eae97 (patch)
treef2a1681807ed6cb937ce41d038f435a949f363f4 /lib/gitlab/ci/mask_secret.rb
parentc45ace8972f18af1f232f9074d6e4104fc4f0c14 (diff)
move `lib/ci/mask_secret.rb` into `lib/gitlab/ci/mask_secret.rb`
Diffstat (limited to 'lib/gitlab/ci/mask_secret.rb')
-rw-r--r--lib/gitlab/ci/mask_secret.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/gitlab/ci/mask_secret.rb b/lib/gitlab/ci/mask_secret.rb
new file mode 100644
index 00000000000..0daddaa638c
--- /dev/null
+++ b/lib/gitlab/ci/mask_secret.rb
@@ -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