Commit e469843a authored by Jose Ivan Vargas's avatar Jose Ivan Vargas

Merge branch '330650-add-tilde-masking' into 'master'

Allow masking ~ character

See merge request gitlab-org/gitlab!61517
parents e0804ae1 4667abe0
......@@ -9,9 +9,9 @@ module Ci
# * No variables
# * No spaces
# * Minimal length of 8 characters
# * Characters must be from the Base64 alphabet (RFC4648) with the addition of '@', ':' and '.'
# * Characters must be from the Base64 alphabet (RFC4648) with the addition of '@', ':', '.', and '~'
# * Absolutely no fun is allowed
REGEX = /\A[a-zA-Z0-9_+=\/@:.-]{8,}\z/.freeze
REGEX = /\A[a-zA-Z0-9_+=\/@:.~-]{8,}\z/.freeze
included do
validates :masked, inclusion: { in: [true, false] }
......
---
title: Allows masking ~ character.
merge_request: 61517
author: Thomas Dallmair
type: changed
......@@ -298,6 +298,7 @@ The value of the variable must:
- Characters from the Base64 alphabet (RFC4648).
- The `@` and `:` characters ([In GitLab 12.2](https://gitlab.com/gitlab-org/gitlab-foss/-/issues/63043) and later).
- The `.` character ([In GitLab 12.10](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/29022) and later).
- The `~` character ([In GitLab 13.12](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/61517) and later).
- Not match the name of an existing predefined or custom CI/CD variable.
### Protect a CI/CD variable
......
......@@ -226,7 +226,7 @@ describe('Ci variable modal', () => {
};
createComponent(mount);
store.state.variable = validMaskandKeyVariable;
store.state.maskableRegex = /^[a-zA-Z0-9_+=/@:-]{8,}$/;
store.state.maskableRegex = /^[a-zA-Z0-9_+=/@:.~-]{8,}$/;
});
it('does not disable the submit button', () => {
......
......@@ -66,7 +66,7 @@ RSpec.describe Ci::Maskable do
end
it 'matches valid strings' do
expect(subject.match?('Hello+World_123/@:-.')).to eq(true)
expect(subject.match?('Hello+World_123/@:-~.')).to eq(true)
end
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment