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
bbbbf9ac
Unverified
Commit
bbbbf9ac
authored
Aug 24, 2020
by
Will Browne
Committed by
GitHub
Aug 24, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Alerting: Store sensitive settings encrypted for LINE notifier (#27157)
* encrypt token * update docs
parent
ed6f0663
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
11 deletions
+21
-11
docs/sources/administration/provisioning.md
+3
-3
pkg/services/alerting/notifiers/line.go
+18
-8
No files found.
docs/sources/administration/provisioning.md
View file @
bbbbf9ac
...
...
@@ -453,9 +453,9 @@ The following sections detail the supported settings and secure settings for eac
#### Alert notification `LINE`
| Name |
| ----- |
| token |
| Name |
Secure setting |
| ----- |
- |
| token |
yes |
#### Alert notification `pagerduty`
...
...
pkg/services/alerting/notifiers/line.go
View file @
bbbbf9ac
...
...
@@ -18,13 +18,23 @@ func init() {
Heading
:
"LINE notify settings"
,
Factory
:
NewLINENotifier
,
OptionsTemplate
:
`
<div class="gf-form-group">
<h3 class="page-heading">LINE notify settings</h3>
<div class="gf-form">
<span class="gf-form-label width-14">Token</span>
<input type="text" required class="gf-form-input max-width-22" ng-model="ctrl.model.settings.token" placeholder="LINE notify token key"></input>
</div>
</div>
<h3 class="page-heading">LINE notify settings</h3>
<div class="gf-form">
<label class="gf-form-label max-width-14">Token</label>
<div class="gf-form gf-form--grow" ng-if="!ctrl.model.secureFields.token">
<input type="text"
required
class="gf-form-input max-width-22"
ng-init="ctrl.model.secureSettings.token = ctrl.model.settings.token || null; ctrl.model.settings.token = null;"
ng-model="ctrl.model.secureSettings.token"
data-placement="right">
</input>
</div>
<div class="gf-form" ng-if="ctrl.model.secureFields.token">
<input type="text" class="gf-form-input max-width-18" disabled="disabled" value="configured" />
<a class="btn btn-secondary gf-form-btn" href="#" ng-click="ctrl.model.secureFields.token = false">reset</a>
</div>
</div>
`
,
Options
:
[]
alerting
.
NotifierOption
{
{
...
...
@@ -44,7 +54,7 @@ const (
// NewLINENotifier is the constructor for the LINE notifier
func
NewLINENotifier
(
model
*
models
.
AlertNotification
)
(
alerting
.
Notifier
,
error
)
{
token
:=
model
.
Settings
.
Get
(
"token"
)
.
MustString
(
)
token
:=
model
.
DecryptedValue
(
"token"
,
model
.
Settings
.
Get
(
"token"
)
.
MustString
()
)
if
token
==
""
{
return
nil
,
alerting
.
ValidationError
{
Reason
:
"Could not find token in settings"
}
}
...
...
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