Files
Tomas DvorakandDevin f3143af351 feat(api): phase 5 — alerts, agent depth, subdomains, auth, boards
P5b: notifier transport registry (webhook/slack/discord/telegram/
gotify/ntfy/smtp via net/smtp), per-monitor+domain alert rules
(failsBeforeDown, latencyWarn, certDays, mute).

P5c: per-container cpu/mem, optional SMART/ZFS/GPU exec-or-skip
collectors, crt.sh subdomain discovery with daily sweep.

P5d: opt-in auth (bcrypt, sqlite sessions, 7d rotating cookie, login
rate limit, public-route bypass) and multiple boards (boards table,
sections.board_id, /api/boards CRUD, slug routing).

Authored By: TDvorak <[email protected]>

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-22 12:49:44 +02:00

30 lines
608 B
Go

package domain
import "testing"
func TestFilterCTNames(t *testing.T) {
raw := []string{
"api.example.com\nwww.example.com",
"*.example.com",
"example.com",
"other.com",
"api.example.com", // dup
"sub.api.example.com",
"evil name.example.com",
"example.com.evil.com",
}
got := FilterCTNames(raw, "example.com")
want := map[string]bool{
"api.example.com": true, "www.example.com": true,
"example.com": true, "sub.api.example.com": true,
}
if len(got) != len(want) {
t.Fatalf("got %v", got)
}
for _, n := range got {
if !want[n] {
t.Fatalf("unexpected name %q", n)
}
}
}