Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
b4e4edc7
Commit
b4e4edc7
authored
May 11, 2021
by
Thomas Dallmair
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow masking ~ character
parent
40348e8f
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
4 additions
and
4 deletions
+4
-4
app/models/concerns/ci/maskable.rb
app/models/concerns/ci/maskable.rb
+2
-2
spec/frontend/ci_variable_list/components/ci_variable_modal_spec.js
...end/ci_variable_list/components/ci_variable_modal_spec.js
+1
-1
spec/models/concerns/ci/maskable_spec.rb
spec/models/concerns/ci/maskable_spec.rb
+1
-1
No files found.
app/models/concerns/ci/maskable.rb
View file @
b4e4edc7
...
...
@@ -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
]
}
...
...
spec/frontend/ci_variable_list/components/ci_variable_modal_spec.js
View file @
b4e4edc7
...
...
@@ -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
'
,
()
=>
{
...
...
spec/models/concerns/ci/maskable_spec.rb
View file @
b4e4edc7
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment