diff options
author | Kamil Trzcinski <ayufan@ayufan.eu> | 2016-09-19 12:38:03 +0200 |
---|---|---|
committer | Kamil Trzcinski <ayufan@ayufan.eu> | 2016-09-19 12:38:10 +0200 |
commit | b51ededc5fef05f94a632aa7651b5a1f7395bd4e (patch) | |
tree | 74a4e49d7c005d67823ec206c65ab75fed5e62d6 /lib/ci | |
parent | 0ca43b1b86edea69656582b2a8febb0d41f7ef01 (diff) | |
download | gitlab-ce-b51ededc5fef05f94a632aa7651b5a1f7395bd4e.tar.gz |
Don't leak build tokens in build logs
Diffstat (limited to 'lib/ci')
-rw-r--r-- | lib/ci/mask_secret.rb | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/ci/mask_secret.rb b/lib/ci/mask_secret.rb new file mode 100644 index 00000000000..3da04edde70 --- /dev/null +++ b/lib/ci/mask_secret.rb @@ -0,0 +1,9 @@ +module Ci::MaskSecret + class << self + def mask(value, token) + return value unless value.present? && token.present? + + value.gsub(token, 'x' * token.length) + end + end +end |