Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'app/validators/cron_validator.rb')
-rw-r--r--app/validators/cron_validator.rb8
1 files changed, 4 insertions, 4 deletions
diff --git a/app/validators/cron_validator.rb b/app/validators/cron_validator.rb
index 91b9cfcccc4..c12b29410d4 100644
--- a/app/validators/cron_validator.rb
+++ b/app/validators/cron_validator.rb
@@ -1,16 +1,16 @@
# frozen_string_literal: true
class CronValidator < ActiveModel::EachValidator
- ATTRIBUTE_WHITELIST = %i[cron freeze_start freeze_end].freeze
+ ATTRIBUTE_ALLOWLIST = %i[cron freeze_start freeze_end].freeze
- NonWhitelistedAttributeError = Class.new(StandardError)
+ NonAllowlistedAttributeError = Class.new(StandardError)
def validate_each(record, attribute, value)
- if ATTRIBUTE_WHITELIST.include?(attribute)
+ if ATTRIBUTE_ALLOWLIST.include?(attribute)
cron_parser = Gitlab::Ci::CronParser.new(record.public_send(attribute), record.cron_timezone) # rubocop:disable GitlabSecurity/PublicSend
record.errors.add(attribute, " is invalid syntax") unless cron_parser.cron_valid?
else
- raise NonWhitelistedAttributeError, "Non-whitelisted attribute"
+ raise NonAllowlistedAttributeError, "Non-allowlisted attribute"
end
end
end