feat: add authentication support to ntfy notifications

ntfy servers that require auth rejected every Checkmate alert because the
provider posted without an Authorization header, so alerts to protected
topics failed silently.

Adds ntfyAuthType ("none" | "token" | "basic"):
- token: Authorization: Bearer <accessToken>
- basic: Authorization: Basic base64(ntfyUsername:accessToken)

Both types store their secret in the existing accessToken field rather than
introducing a new secret, so credential handling stays in one place.

Incomplete credentials fail the send instead of falling back to an anonymous
post, and validation rejects partial auth config up front so a channel can't
be saved looking authenticated while posting anonymously.

Backend only; frontend follows once this lands.

Closes #3717
This commit is contained in:
egeoztass committed 2026-08-14 14:01:06 +03:00
1 parent f97ca8565a
commit 1c9739d1da
8 files changed
+289 -8

No files matched your search

+8 -1
View File
@@ -78,7 +78,14 @@ const notificationVariantMeta: Record<string, { component: string; example: Reco
},
ntfy: {
component: "NtfyNotification",
example: { notificationName: "ntfy topic", type: "ntfy", address: "https://ntfy.sh", topic: "checkmate-alerts" },
example: {
notificationName: "ntfy topic",
type: "ntfy",
address: "https://ntfy.sh",
topic: "checkmate-alerts",
ntfyAuthType: "token",
accessToken: "tk_your-ntfy-access-token",
},
},
};