add secureJsonData to appSettings model.

- adds the new column to the DB table.
- data stored in the DB is encrypted
- update appRouteHeaders templates to use the jsonData and
decrypted secureJsonData
This commit is contained in:
Anthony Woods
2016-01-23 06:17:22 +08:00
parent ab3b586838
commit 32f78d465b
5 changed files with 53 additions and 18 deletions
+9 -2
View File
@@ -94,8 +94,15 @@ func NewApiPluginProxy(ctx *middleware.Context, proxyPath string, route *plugins
ctx.JsonApiErr(500, "failed to get AppSettings.", err)
return
}
err = t.Execute(&contentBuf, query.Result.JsonData)
type templateData struct {
JsonData map[string]interface{}
SecureJsonData map[string]string
}
data := templateData{
JsonData: query.Result.JsonData,
SecureJsonData: query.Result.SecureJsonData.Decrypt(),
}
err = t.Execute(&contentBuf, data)
if err != nil {
ctx.JsonApiErr(500, fmt.Sprintf("failed to execute header content template for header %s.", header.Name), err)
return