From c91e5adfcc18b3118ee2937ea5a8daea34d0cb8b Mon Sep 17 00:00:00 2001 From: Marcus Efraimsson Date: Wed, 8 Jul 2020 19:13:59 +0200 Subject: [PATCH] Alerting: Don't encrypt username for webhook notifier (#26170) Can be hard for users to understand what user is configured when encrypting the username field why this reverts to store the username in cleartext. Also, we don't encrypt username for data sources. Ref #25967 --- pkg/services/alerting/notifiers/webhook.go | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/pkg/services/alerting/notifiers/webhook.go b/pkg/services/alerting/notifiers/webhook.go index 8d5f3f2a6ea..e9894c7b076 100644 --- a/pkg/services/alerting/notifiers/webhook.go +++ b/pkg/services/alerting/notifiers/webhook.go @@ -29,19 +29,8 @@ func init() {
-
-
- - -
-
- - reset -
+ Username +
@@ -106,13 +95,12 @@ func NewWebHookNotifier(model *models.AlertNotification) (alerting.Notifier, err return nil, alerting.ValidationError{Reason: "Could not find url property in settings"} } - username := model.DecryptedValue("username", model.Settings.Get("username").MustString()) password := model.DecryptedValue("password", model.Settings.Get("password").MustString()) return &WebhookNotifier{ NotifierBase: NewNotifierBase(model), URL: url, - User: username, + User: model.Settings.Get("username").MustString(), Password: password, HTTPMethod: model.Settings.Get("httpMethod").MustString("POST"), log: log.New("alerting.notifier.webhook"),