summaryrefslogtreecommitdiff
path: root/app/controllers/projects/services_controller.rb
diff options
context:
space:
mode:
authorAlex Lossent <alexandre.lossent@cern.ch>2015-10-15 09:09:01 +0200
committerAlex Lossent <alexandre.lossent@cern.ch>2015-10-15 12:07:59 +0200
commit98e666ab6a61ef67c2ba15d31839fd1cf414d587 (patch)
treeabcf4f46204ff31e353c110b5a86c6035eaa3094 /app/controllers/projects/services_controller.rb
parent976400c1e6c653ce93cd29d32a007c091a38f970 (diff)
downloadgitlab-ce-98e666ab6a61ef67c2ba15d31839fd1cf414d587.tar.gz
Improve invalidation of stored service password if the endpoint URL is changedimprove_reset_service_password_v2
Password can now be specified at the same time as the new URL, and the service template admin pages now work.
Diffstat (limited to 'app/controllers/projects/services_controller.rb')
-rw-r--r--app/controllers/projects/services_controller.rb8
1 files changed, 7 insertions, 1 deletions
diff --git a/app/controllers/projects/services_controller.rb b/app/controllers/projects/services_controller.rb
index 3047ee8a1ff..129068ef019 100644
--- a/app/controllers/projects/services_controller.rb
+++ b/app/controllers/projects/services_controller.rb
@@ -9,6 +9,10 @@ class Projects::ServicesController < Projects::ApplicationController
:note_events, :send_from_committer_email, :disable_diffs, :external_wiki_url,
:notify, :color,
:server_host, :server_port, :default_irc_uri, :enable_ssl_verification]
+
+ # Parameters to ignore if no value is specified
+ FILTER_BLANK_PARAMS = [:password]
+
# Authorize
before_action :authorize_admin_project!
before_action :service, only: [:edit, :update, :test]
@@ -59,7 +63,9 @@ class Projects::ServicesController < Projects::ApplicationController
def service_params
service_params = params.require(:service).permit(ALLOWED_PARAMS)
- service_params.delete("password") if service_params["password"].blank?
+ FILTER_BLANK_PARAMS.each do |param|
+ service_params.delete(param) if service_params[param].blank?
+ end
service_params
end
end