Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
nexpie-grafana-theme
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Registry
Registry
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kornkitt Poolsup
nexpie-grafana-theme
Commits
224aa4dd
Unverified
Commit
224aa4dd
authored
May 05, 2020
by
Marcus Efraimsson
Committed by
GitHub
May 05, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Backend plugins: Fix incorrect JSON Unmarshal (#24243)
parent
898df2b7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
4 deletions
+5
-4
pkg/api/plugins.go
+5
-4
No files found.
pkg/api/plugins.go
View file @
224aa4dd
...
...
@@ -29,21 +29,22 @@ func (hs *HTTPServer) getPluginContext(pluginID string, user *models.SignedInUse
return
pc
,
ErrPluginNotFound
}
var
jsonData
json
.
RawMessage
var
decryptedSecureJSONData
map
[
string
]
string
jsonData
:=
json
.
RawMessage
{}
decryptedSecureJSONData
:=
map
[
string
]
string
{}
var
updated
time
.
Time
ps
,
err
:=
hs
.
getCachedPluginSettings
(
pluginID
,
user
)
if
err
!=
nil
{
// models.ErrPluginSettingNotFound is expected if there's no row found for plugin setting in database (if non-app plugin).
// If it's not this expected error something is wrong with cache or database and we return the error to the client.
if
err
!=
models
.
ErrPluginSettingNotFound
{
return
pc
,
errutil
.
Wrap
(
"Failed to get plugin settings"
,
err
)
}
}
else
{
jsonData
,
err
=
json
.
Marshal
(
ps
.
JsonData
)
if
err
!=
nil
{
return
pc
,
errutil
.
Wrap
(
"Failed to unmarshal plugin json data"
,
err
)
}
decryptedSecureJSONData
=
make
(
map
[
string
]
string
)
}
else
{
decryptedSecureJSONData
=
ps
.
DecryptedValues
()
updated
=
ps
.
Updated
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment