diff options
author | Matija Čupić <matteeyah@gmail.com> | 2018-03-16 16:54:36 +0100 |
---|---|---|
committer | Matija Čupić <matteeyah@gmail.com> | 2018-03-16 16:56:42 +0100 |
commit | 28a5f8c60a29445e147614767a8452b3141ef868 (patch) | |
tree | 72f8bda91908354d72d5267bf6e1b75dbd807b87 /app/controllers/projects/variables_controller.rb | |
parent | 79aa00321063daf8f650683373db29832c8e13f1 (diff) | |
download | gitlab-ce-28a5f8c60a29445e147614767a8452b3141ef868.tar.gz |
Use secret_key and secret_value in Variables controller
Diffstat (limited to 'app/controllers/projects/variables_controller.rb')
-rw-r--r-- | app/controllers/projects/variables_controller.rb | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/app/controllers/projects/variables_controller.rb b/app/controllers/projects/variables_controller.rb index 7eb509e2e64..3cbfe7b3cc1 100644 --- a/app/controllers/projects/variables_controller.rb +++ b/app/controllers/projects/variables_controller.rb @@ -32,10 +32,15 @@ class Projects::VariablesController < Projects::ApplicationController end def variables_params - params.permit(variables_attributes: [*variable_params_attributes]) + filtered_params = params.permit(variables_attributes: [*variable_params_attributes]) + filtered_params["variables_attributes"].each do |variable| + variable["key"] = variable.delete("secret_key") + variable["value"] = variable.delete("secret_value") + end + filtered_params end def variable_params_attributes - %i[id key value protected _destroy] + %i[id secret_key secret_value protected _destroy] end end |