v1.1.0 Phase 4: public-link console, rate limiting, retention, config I/O #97
No reviewers
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 milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
rbrooks/WeatherBot!97
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/v1.1.0-phase4a-publiclinks"
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?
The final v1.1.0 slice — public-surface ops and data lifecycle.
Public surface
GET /api/public-tokenslist endpoint (unions NWS-alert and SPC-outlook target types, with token/text/type/status/window filters) and a/public-linksconsole page — per-row status, copy (resolved outbound URL via SHORT→PUBLIC→APP preference), open, and revoke (reuses the existing admin revoke endpoint). Admin nav link added./p/*rate limiting: in-process sliding-window limiter on/p/{token}, keyed by client IP (X-Forwarded-For aware), returning 429 +Retry-After. Configurable; per-process (a proxy/Redis limiter is noted for multi-instance).SMS_DEFAULT_PUBLIC_LINKS=true), still subject to the SMS segment budget.Data lifecycle
sent_alerts(90d), AI records (30d), SPC pages pastretained_until+30d, snapshots (180d), and disabled public tokens (30d) — deliberately long defaults aligned with the v2.0.0 Historical Explorer (#22). MCDSentAlertrows now get a real 6h expiry (they previously never cleared/pruned), and SPC radar cache files are pruned by age (7d). Each table cleans in its own session/try-except; windows documented in README.GET /api/config/export(locations, channels, subscriptions as JSON, full config for a complete DR restore — flagged as containing secrets) andPOST /api/config/import(natural-key dedup, additive by default,replaceflag gated, triggers NWS re-resolution for new locations), with a Settings-page backup/restore UI.Config (added to
.env.example)SMS_DEFAULT_PUBLIC_LINKS,PUBLIC_RATE_LIMIT_ENABLED/REQUESTS/WINDOW_SECONDS, and sixRETENTION_*/RADAR_CACHE_RETENTION_DAYSwindows — all with safe defaults.Testing
Full suite green on the dev server: 489 passed (38 new tests). Fixed one test-isolation issue: the rate-limiter dependency now reads settings via
getattr(a v1.0.3 test patchesget_settingswith a partial stub) and is reset per-test via an autouse fixture.Notes
/p/*(the enumeration surface); the public SSE stream under/api/locations/*could optionally get the same guard later.Closes #7, #10, #11, #52, #79
🤖 Generated with Claude Code