Per-type channel config validation + defensive notifier parsing + schema length caps #55
Labels
No labels
area:ai
area:ci-cd
area:notifications
area:observability
area:public-pages
backlog
bug
duplicate
enhancement
help wanted
invalid
question
type:decision
type:feature
type:infra
type:maintenance
type:security
v1.0.1
v1.1.0
v1.2.0
v1.3.0
v2.0.0
wontfix
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
rbrooks/WeatherBot#55
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
_validate_channel_config(app/api/channels.py:52-60) validates only webhookand sms. Discord
int(config["channel_id"])(discord_bot.py:78 et al.),Pushover
int(priority)(pushover.py:70), and webhookmethod.upper()/{**headers}before the try block (webhook.py:140-142) all crash onmalformed stored config — at send time, on every send. Schemas also lack
max_lengthmirroringString(128)columns (DataError → 500 instead of 422).Scope: per-type Pydantic config models (discriminated on
type) applied atcreate/update; defensive parsing in notifiers (clear "bad config" log +
delivery record, not a stack trace);
max_lengthon Create/Update stringfields. Scheduled with v1.2.0 since #14's formatter migration touches every
notifier anyway; the secret-redaction issue (F-08) should land its read-side
changes first.
Acceptance criteria:
Filed from the 2026-07-17 codebase audit (
docs/.internal/report-2026-07-17.md), finding F-16.Done in #99 (merged). Per-type Pydantic config models now validate discord/matrix/pushover/webex/signal config at create/update (malformed → 422, not a later send-time crash), added alongside the existing webhook/sms validators. The notifiers gained defensive parsing at the bare-
int()/attribute-access points (discord channel_id, pushover priority, webhook method/headers) so malformed legacy config records a clear delivery failure instead of crashing. Create/Update name fields gainedmax_lengthcaps mirroring theString(128)columns (overlong → 422 instead of a 500 DataError).