Commit 8e639cc6 authored by Matija Čupić's avatar Matija Čupić

Allow masking @ and : characters

parent d892e80b
...@@ -9,7 +9,7 @@ module Maskable ...@@ -9,7 +9,7 @@ module Maskable
# * No spaces # * No spaces
# * Minimal length of 8 characters from the Base64 alphabets (RFC4648) # * Minimal length of 8 characters from the Base64 alphabets (RFC4648)
# * Absolutely no fun is allowed # * 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 included do
validates :masked, inclusion: { in: [true, false] } validates :masked, inclusion: { in: [true, false] }
......
...@@ -224,7 +224,7 @@ describe('AjaxFormVariableList', () => { ...@@ -224,7 +224,7 @@ describe('AjaxFormVariableList', () => {
describe('maskableRegex', () => { describe('maskableRegex', () => {
it('takes in the regex provided by the data attribute', () => { it('takes in the regex provided by the data attribute', () => {
expect(container.dataset.maskableRegex).toBe('^[a-zA-Z0-9_+=/-]{8,}$'); expect(container.dataset.maskableRegex).toBe('^[a-zA-Z0-9_+=/@:-]{8,}$');
expect(ajaxVariableList.maskableRegex).toBe(container.dataset.maskableRegex); expect(ajaxVariableList.maskableRegex).toBe(container.dataset.maskableRegex);
}); });
}); });
......
...@@ -162,7 +162,7 @@ describe('VariableList', () => { ...@@ -162,7 +162,7 @@ describe('VariableList', () => {
}); });
it('has a regex provided via a data attribute', () => { it('has a regex provided via a data attribute', () => {
expect($wrapper.attr('data-maskable-regex')).toBe('^[a-zA-Z0-9_+=/-]{8,}$'); expect($wrapper.attr('data-maskable-regex')).toBe('^[a-zA-Z0-9_+=/@:-]{8,}$');
}); });
it('allows values that are 8 characters long', done => { it('allows values that are 8 characters long', done => {
......
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