Commit ad8dbbb5 by woodsaj

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.
parent 5a241a82
...@@ -61,7 +61,6 @@ func UpdatePluginSetting(cmd *m.UpdatePluginSettingCmd) error { ...@@ -61,7 +61,6 @@ func UpdatePluginSetting(cmd *m.UpdatePluginSettingCmd) error {
for key, data := range cmd.SecureJsonData { for key, data := range cmd.SecureJsonData {
pluginSetting.SecureJsonData[key] = util.Encrypt([]byte(data), setting.SecretKey) pluginSetting.SecureJsonData[key] = util.Encrypt([]byte(data), setting.SecretKey)
} }
pluginSetting.SecureJsonData = cmd.GetEncryptedJsonData()
pluginSetting.Updated = time.Now() pluginSetting.Updated = time.Now()
pluginSetting.Enabled = cmd.Enabled pluginSetting.Enabled = cmd.Enabled
pluginSetting.JsonData = cmd.JsonData pluginSetting.JsonData = cmd.JsonData
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment