FIX: use allowlist and blocklist terminology (#10209)

This is a PR of the renaming whitelist to allowlist and blacklist to the blocklist.
This commit is contained in:
Krzysztof Kotlarek
2020-07-27 10:23:54 +10:00
committed by GitHub
parent 5077cf52fd
commit e0d9232259
130 changed files with 676 additions and 570 deletions

View File

@ -10,6 +10,9 @@ class EmbeddableHost < ActiveRecord::Base
self.host.sub!(/\/.*$/, '')
end
# TODO(2021-07-23): Remove
self.ignored_columns = ["path_whitelist"]
def self.record_for_url(uri)
if uri.is_a?(String)
@ -31,9 +34,9 @@ class EmbeddableHost < ActiveRecord::Base
path << "?" << uri.query if uri.query.present?
where("lower(host) = ?", host).each do |eh|
return eh if eh.path_whitelist.blank?
return eh if eh.allowed_paths.blank?
path_regexp = Regexp.new(eh.path_whitelist)
path_regexp = Regexp.new(eh.allowed_paths)
return eh if path_regexp.match(path) || path_regexp.match(UrlHelper.unencode(path))
end
@ -78,6 +81,6 @@ end
# category_id :integer not null
# created_at :datetime not null
# updated_at :datetime not null
# path_whitelist :string
# allowed_paths :string
# class_name :string
#