diff options
author | Alex Lossent <alexandre.lossent@cern.ch> | 2015-10-13 11:29:57 +0200 |
---|---|---|
committer | Alex Lossent <alexandre.lossent@cern.ch> | 2015-10-14 15:27:59 +0200 |
commit | b46397548056e4e8ef00efe4f641c61ba1dd5230 (patch) | |
tree | 1f5795dfdc3ef417dced3a797c0ec7e83551cf0e /app/controllers/projects/services_controller.rb | |
parent | 07101cfab61f28c6328efebea98f018ab8356cdd (diff) | |
download | gitlab-ce-b46397548056e4e8ef00efe4f641c61ba1dd5230.tar.gz |
Improve invalidation of stored service password if the endpoint URL is changed
It now allows to specify a password at the same time as the new URL, and works
on the service template admin pages.
Diffstat (limited to 'app/controllers/projects/services_controller.rb')
-rw-r--r-- | app/controllers/projects/services_controller.rb | 8 |
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 |