Business intelligence made simple
Better variable names
Andrew Kane1c27a997f4bd
diff --git a/app/controllers/blazer/base_controller.rb b/app/controllers/blazer/base_controller.rbindex 583473c9..df9a8c2a 100644--- a/app/controllers/blazer/base_controller.rb+++ b/app/controllers/blazer/base_controller.rb@@ -96,12 +96,12 @@ module Blazer# when permitted parameters are passed in Rails 6,# they appear to be added as GET parameters# root_url(params.permit(:host))- BLACKLISTED_KEYS = [:controller, :action, :id, :host, :query, :dashboard, :query_id, :query_ids, :table_names, :authenticity_token, :utf8, :_method, :commit, :statement, :data_source, :name, :fork_query_id, :blazer, :run_id, :script_name, :original_script_name]+ UNPERMITTED_KEYS = [:controller, :action, :id, :host, :query, :dashboard, :query_id, :query_ids, :table_names, :authenticity_token, :utf8, :_method, :commit, :statement, :data_source, :name, :fork_query_id, :blazer, :run_id, :script_name, :original_script_name]- # remove blacklisted keys from both params and permitted keys for better sleep+ # remove unpermitted keys from both params and permitted keys for better sleepdef variable_params(resource)- permitted_keys = resource.variables - BLACKLISTED_KEYS.map(&:to_s)- params.except(*BLACKLISTED_KEYS).slice(*permitted_keys).permit!+ permitted_keys = resource.variables - UNPERMITTED_KEYS.map(&:to_s)+ params.except(*UNPERMITTED_KEYS).slice(*permitted_keys).permit!endhelper_method :variable_paramsdiff --git a/app/mailers/blazer/slack_notifier.rb b/app/mailers/blazer/slack_notifier.rbindex 7083b23f..4d1e035d 100644--- a/app/mailers/blazer/slack_notifier.rb+++ b/app/mailers/blazer/slack_notifier.rb@@ -62,7 +62,7 @@ module Blazer# checks shouldn't have variables, but in any case,# avoid passing variable params to url helpers- # (known unsafe parameters are removed, but blacklist isn't ideal)+ # (known unsafe parameters are removed, but still not ideal)def self.query_url(id)Blazer::Engine.routes.url_helpers.query_url(id, ActionMailer::Base.default_url_options)end