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/groups/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/groups/variables_controller.rb')
-rw-r--r-- | app/controllers/groups/variables_controller.rb | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/app/controllers/groups/variables_controller.rb b/app/controllers/groups/variables_controller.rb index cb8771bc97e..2794d5fe6ec 100644 --- a/app/controllers/groups/variables_controller.rb +++ b/app/controllers/groups/variables_controller.rb @@ -35,11 +35,16 @@ module Groups end def group_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 def authorize_admin_build! |