From ad8dbbb559d2f885b306da98d57a1f33917c8d4a Mon Sep 17 00:00:00 2001 From: woodsaj Date: Thu, 28 Apr 2016 18:39:23 +0800 Subject: [PATCH] allow updates to secureJsonData. SecureJsonData is stored as a json object in the DB. As the secureJsonData is never returned to the user they are unable to provide the full json object when performing updates instead the user can only provide the specific keys they wish to update. This commit ensures that only the provided keys are updated and existing keys in the secureJsonData object are left untouched. --- pkg/services/sqlstore/plugin_setting.go | 1 - 1 file changed, 1 deletion(-) diff --git a/pkg/services/sqlstore/plugin_setting.go b/pkg/services/sqlstore/plugin_setting.go index b3285e905cf..ec0b9b2e2d7 100644 --- a/pkg/services/sqlstore/plugin_setting.go +++ b/pkg/services/sqlstore/plugin_setting.go @@ -61,7 +61,6 @@ func UpdatePluginSetting(cmd *m.UpdatePluginSettingCmd) error { for key, data := range cmd.SecureJsonData { pluginSetting.SecureJsonData[key] = util.Encrypt([]byte(data), setting.SecretKey) } - pluginSetting.SecureJsonData = cmd.GetEncryptedJsonData() pluginSetting.Updated = time.Now() pluginSetting.Enabled = cmd.Enabled pluginSetting.JsonData = cmd.JsonData