diff options
author | Thomas Nilsson <thomas.nilsson@irfu.se> | 2019-05-20 12:49:23 +0000 |
---|---|---|
committer | mfluharty <mfluharty@gitlab.com> | 2019-06-06 15:46:45 +0100 |
commit | ff3486a92bfcf00b85d45c9224c27cc5fa9c49e2 (patch) | |
tree | 6633bc6d12773a19f1dfb01e293686007f5fdc06 /app/models | |
parent | e5aba4b153d4ebaa8a6b0683f7ecae706e9c7e45 (diff) | |
download | gitlab-ce-ff3486a92bfcf00b85d45c9224c27cc5fa9c49e2.tar.gz |
Allow masking if 8 or more characters in base64
This should allow for private ssh-keys to remain private.
Solves https://gitlab.com/gitlab-org/gitlab-ce/issues/60790.
Diffstat (limited to 'app/models')
-rw-r--r-- | app/models/concerns/maskable.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/app/models/concerns/maskable.rb b/app/models/concerns/maskable.rb index 2943872ffab..e0f2c41b836 100644 --- a/app/models/concerns/maskable.rb +++ b/app/models/concerns/maskable.rb @@ -7,9 +7,9 @@ module Maskable # * No escape characters # * No variables # * No spaces - # * Minimal length of 8 characters + # * Minimal length of 8 characters from the Base64 alphabets (RFC4648) # * Absolutely no fun is allowed - REGEX = /\A\w{8,}\z/.freeze + REGEX = /\A[a-zA-Z0-9_+=\/-]{8,}\z/.freeze included do validates :masked, inclusion: { in: [true, false] } |