diff options
5 files changed, 11 insertions, 5 deletions
diff --git a/app/models/concerns/maskable.rb b/app/models/concerns/maskable.rb index e0f2c41b836..d70e47bc4ff 100644 --- a/app/models/concerns/maskable.rb +++ b/app/models/concerns/maskable.rb @@ -7,9 +7,10 @@ module Maskable # * No escape characters # * No variables # * No spaces - # * Minimal length of 8 characters from the Base64 alphabets (RFC4648) + # * Minimal length of 8 characters + # * 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] } diff --git a/changelogs/unreleased/mc-feature-add-at-colon-variable-masking.yml b/changelogs/unreleased/mc-feature-add-at-colon-variable-masking.yml new file mode 100644 index 00000000000..9b8eff8e043 --- /dev/null +++ b/changelogs/unreleased/mc-feature-add-at-colon-variable-masking.yml @@ -0,0 +1,5 @@ +--- +title: 'Allows masking @ and : characters.' +merge_request: 31065 +author: +type: changed diff --git a/doc/ci/variables/README.md b/doc/ci/variables/README.md index c63b1e104ed..01edd873a8d 100644 --- a/doc/ci/variables/README.md +++ b/doc/ci/variables/README.md @@ -94,7 +94,7 @@ This means that the value of the variable will be hidden in job logs, though it must match certain requirements to do so: - The value must be in a single line. -- The value must only consist of characters from the Base64 alphabet, defined in [RFC4648](https://tools.ietf.org/html/rfc4648). +- The value must only consist of characters from the Base64 alphabet ([RFC4648](https://tools.ietf.org/html/rfc4648)) with the addition of `@` and `:`. - The value must be at least 8 characters long. - The value must not use variables. diff --git a/spec/javascripts/ci_variable_list/ajax_variable_list_spec.js b/spec/javascripts/ci_variable_list/ajax_variable_list_spec.js index e6a969bd855..b2fe315f6c6 100644 --- a/spec/javascripts/ci_variable_list/ajax_variable_list_spec.js +++ b/spec/javascripts/ci_variable_list/ajax_variable_list_spec.js @@ -224,7 +224,7 @@ describe('AjaxFormVariableList', () => { describe('maskableRegex', () => { 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); }); }); diff --git a/spec/javascripts/ci_variable_list/ci_variable_list_spec.js b/spec/javascripts/ci_variable_list/ci_variable_list_spec.js index 064113e879a..c8d6f789ed0 100644 --- a/spec/javascripts/ci_variable_list/ci_variable_list_spec.js +++ b/spec/javascripts/ci_variable_list/ci_variable_list_spec.js @@ -162,7 +162,7 @@ describe('VariableList', () => { }); 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 => { |