Alerting: use static channel configuration to determinate secure fields (#52527) (#52570)

* Alerting: use static channel configuration to determinate secure fields

* move to channels package

* introduce channel_config package to fix cyclic import

* add missing changes

* compare type to type

(cherry picked from commit ba9c18d9c3)

Co-authored-by: Jean-Philippe Quéméner <JohnnyQQQQ@users.noreply.github.com>
This commit is contained in:
Alexander Weaver
2022-07-20 17:34:58 -05:00
committed by GitHub
parent d1f1041aba
commit 795e2d0a48
4 changed files with 18 additions and 42 deletions
@@ -11,7 +11,8 @@ import (
"github.com/grafana/grafana/pkg/infra/tracing"
"github.com/grafana/grafana/pkg/models"
"github.com/grafana/grafana/pkg/services/ngalert/notifier"
"github.com/grafana/grafana/pkg/services/ngalert/notifier/channels_config"
"github.com/grafana/grafana/pkg/tests/testinfra"
)
@@ -47,7 +48,7 @@ func TestAvailableChannels(t *testing.T) {
require.NoError(t, err)
require.Equal(t, 200, resp.StatusCode)
expNotifiers := notifier.GetAvailableNotifiers()
expNotifiers := channels_config.GetAvailableNotifiers()
expJson, err := json.Marshal(expNotifiers)
require.NoError(t, err)
require.Equal(t, string(expJson), string(b))