feat(alerting): Add token authorization for ntfy (#512)

* feat(alerting): Add token authorization for ntfy

* feat(alerting): Fix suggestions for ntfy auth

---------

Co-authored-by: TwiN <twin@linux.com>
This commit is contained in:
Oskar Carl
2023-07-03 05:10:16 +02:00
committed by GitHub
parent ecda4a9987
commit 5eebe6d9cc
3 changed files with 22 additions and 1 deletions

View File

@ -24,6 +24,16 @@ func TestAlertDefaultProvider_IsValid(t *testing.T) {
provider: AlertProvider{Topic: "example", Priority: 1},
expected: true,
},
{
name: "valid-with-token",
provider: AlertProvider{Topic: "example", Priority: 1, Token: "tk_faketoken"},
expected: true,
},
{
name: "invalid-token",
provider: AlertProvider{Topic: "example", Priority: 1, Token: "xx_faketoken"},
expected: false,
},
{
name: "invalid-topic",
provider: AlertProvider{URL: "https://ntfy.sh", Topic: "", Priority: 1},