summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-05-26 14:25:05 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2020-05-26 14:25:05 +0000
commitdf400447bfd5c650b32cc8d75fa80f8cc7099d94 (patch)
treea8cff21170078eb41d3fd08991c745dd7c86b176 /app
parented15b5061242cb70b2e11c3d08c727e07aa932a8 (diff)
downloadgitlab-ce-df400447bfd5c650b32cc8d75fa80f8cc7099d94.tar.gz
Add latest changes from gitlab-org/security/gitlab@13-0-stable-ee
Diffstat (limited to 'app')
-rw-r--r--app/controllers/admin/application_settings_controller.rb8
-rw-r--r--app/views/admin/application_settings/_eks.html.haml2
2 files changed, 8 insertions, 2 deletions
diff --git a/app/controllers/admin/application_settings_controller.rb b/app/controllers/admin/application_settings_controller.rb
index 355662bbb38..709834a2bec 100644
--- a/app/controllers/admin/application_settings_controller.rb
+++ b/app/controllers/admin/application_settings_controller.rb
@@ -191,8 +191,10 @@ class Admin::ApplicationSettingsController < Admin::ApplicationController
params[:application_setting][:import_sources]&.delete("")
params[:application_setting][:restricted_visibility_levels]&.delete("")
- params[:application_setting].delete(:elasticsearch_aws_secret_access_key) if params[:application_setting][:elasticsearch_aws_secret_access_key].blank?
params[:application_setting][:required_instance_ci_template] = nil if params[:application_setting][:required_instance_ci_template].blank?
+
+ remove_blank_params_for!(:elasticsearch_aws_secret_access_key, :eks_secret_access_key)
+
# TODO Remove domain_blacklist_raw in APIv5 (See https://gitlab.com/gitlab-org/gitlab-foss/issues/67204)
params.delete(:domain_blacklist_raw) if params[:domain_blacklist_file]
params.delete(:domain_blacklist_raw) if params[:domain_blacklist]
@@ -261,6 +263,10 @@ class Admin::ApplicationSettingsController < Admin::ApplicationController
render action
end
+ def remove_blank_params_for!(*keys)
+ params[:application_setting].delete_if { |setting, value| setting.to_sym.in?(keys) && value.blank? }
+ end
+
# overridden in EE
def valid_setting_panels
VALID_SETTING_PANELS
diff --git a/app/views/admin/application_settings/_eks.html.haml b/app/views/admin/application_settings/_eks.html.haml
index b1f7ed76281..d959b4f9b43 100644
--- a/app/views/admin/application_settings/_eks.html.haml
+++ b/app/views/admin/application_settings/_eks.html.haml
@@ -26,6 +26,6 @@
= f.text_field :eks_access_key_id, class: 'form-control'
.form-group
= f.label :eks_secret_access_key, 'Secret access key', class: 'label-bold'
- = f.password_field :eks_secret_access_key, value: @application_setting.eks_secret_access_key, class: 'form-control'
+ = f.password_field :eks_secret_access_key, autocomplete: 'off', class: 'form-control'
= f.submit 'Save changes', class: "btn btn-success"