Public Link Admin Console #7

Closed
opened 2026-06-23 23:14:57 +00:00 by rbrooks · 2 comments
Owner

Target release: v1.1.0

Operators need an authenticated in-app place to discover, inspect, copy/open, filter, and revoke generated public links across NWS alert pages and SPC outlook impact pages. Implement as shared public-link administration (target type is first-class metadata), not per-product.

Acceptance

  • Authenticated admin/operator view listing recent public tokens / alert pages with location, event/product, status, created/updated time, public expiry, enabled/revoked state, and canonical /p/{token} path.
  • Filters/search for token, location, event/product text, target type, status, active/expired/revoked, and recent creation/update window.
  • Copy/open actions for the resolved outbound URL using the SHORT_LINK_BASE_URLPUBLIC_LINK_BASE_URLAPP_BASE_URL preference.
  • Revoke/disable actions using the existing public-token revocation API, with status feedback.
  • Diagnostic metadata explaining why a notification did/didn't include a public link (missing base URL, token unavailable, expired/revoked, message budget omission).
  • Table/target-type design accommodates NWS alert, SPC outlook, public location, and future historical event pages in one surface.

Source: docs/ROADMAP.md → Planned → Public Link Admin Console.

**Target release:** v1.1.0 Operators need an authenticated in-app place to discover, inspect, copy/open, filter, and revoke generated public links across NWS alert pages and SPC outlook impact pages. Implement as shared public-link administration (target type is first-class metadata), not per-product. **Acceptance** - [ ] Authenticated admin/operator view listing recent public tokens / alert pages with location, event/product, status, created/updated time, public expiry, enabled/revoked state, and canonical `/p/{token}` path. - [ ] Filters/search for token, location, event/product text, target type, status, active/expired/revoked, and recent creation/update window. - [ ] Copy/open actions for the resolved outbound URL using the `SHORT_LINK_BASE_URL` → `PUBLIC_LINK_BASE_URL` → `APP_BASE_URL` preference. - [ ] Revoke/disable actions using the existing public-token revocation API, with status feedback. - [ ] Diagnostic metadata explaining why a notification did/didn't include a public link (missing base URL, token unavailable, expired/revoked, message budget omission). - [ ] Table/target-type design accommodates NWS alert, SPC outlook, public location, and future historical event pages in one surface. Source: `docs/ROADMAP.md` → Planned → Public Link Admin Console.
Contributor

Audit note (2026-07-18)

From the 2026-07 codebase audit (docs/.internal/report-2026-07-17.md), finding F-34.

Backend primitives for this console already exist — this is smaller than the body implies:

  • Admin-gated, CSRF-protected POST /api/public-tokens/{token}/revoke (app/api/public.py:305).
  • revoke_public_token helper (app/services/public_alerts.py:481).
  • Token/page listing queries (app/api/public.py:181, app/api/spc_impacts.py:118).

No template references any of it (grep: zero hits in app/templates). Remaining scope is the listing/console UI plus a list endpoint with filters (location, product, status, expiry, enabled/revoked).

Consider pairing with the public_enabled revoke-on-toggle behavior from the public-surface privacy issue (#60, audit F-21) — both touch token revocation.

## Audit note (2026-07-18) From the 2026-07 codebase audit (`docs/.internal/report-2026-07-17.md`), finding **F-34**. Backend primitives for this console already exist — this is smaller than the body implies: - Admin-gated, CSRF-protected `POST /api/public-tokens/{token}/revoke` (`app/api/public.py:305`). - `revoke_public_token` helper (`app/services/public_alerts.py:481`). - Token/page listing queries (`app/api/public.py:181`, `app/api/spc_impacts.py:118`). No template references any of it (grep: zero hits in `app/templates`). **Remaining scope is the listing/console UI** plus a list endpoint with filters (location, product, status, expiry, enabled/revoked). Consider pairing with the `public_enabled` revoke-on-toggle behavior from the public-surface privacy issue (**#60**, audit F-21) — both touch token revocation.
Contributor

Done in #97 (merged). Added the admin GET /api/public-tokens list endpoint (unions the NWS-alert and SPC-outlook target types, with token/free-text/type/status/window filters and derived status) and a /public-links admin console page with per-row status, copy (resolved outbound URL via SHORT→PUBLIC→APP), open, and revoke (reuses the existing admin revoke endpoint). Admin nav link added. Note: there's no "public-location token" type in the codebase, so the console covers the two real types — a future type slots in with one more outerjoin.

Done in #97 (merged). Added the admin `GET /api/public-tokens` list endpoint (unions the NWS-alert and SPC-outlook target types, with token/free-text/type/status/window filters and derived status) and a `/public-links` admin console page with per-row status, copy (resolved outbound URL via SHORT→PUBLIC→APP), open, and revoke (reuses the existing admin revoke endpoint). Admin nav link added. Note: there's no "public-location token" type in the codebase, so the console covers the two real types — a future type slots in with one more outerjoin.
Sign in to join this conversation.
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
rbrooks/WeatherBot#7
No description provided.