Commit b4e4edc7 authored by Thomas Dallmair's avatar Thomas Dallmair

Allow masking ~ character

parent 40348e8f
......@@ -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] }
......
......@@ -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