Stored redirect-token table and open-redirect-safe short links #13
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
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
rbrooks/WeatherBot#13
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?
Target release: v1.2.0
Add a short-link/redirect-token storage layer so that when
SHORT_LINK_BASE_URLpoints at a redirect-only domain, tokens resolve only to stored WeatherBot-generated targets (or a tightly allowlisted set of external official/weather-media URLs). Avoid any generic unauthenticated open redirect.Acceptance
outbound_url()can emit short redirect URLs when a redirect-only short domain is configured.Source:
docs/ROADMAP.md→ Notification Message Budget and Compact Link System.Done in #99 (merged). Added a
redirect_tokenstable (token → stored canonical target, deduped by hash) and an open-redirect-safeGET /r/{token}resolver — the 302 target is read only from the store, never from the request, and external targets must be host-allowlisted (SHORT_LINK_EXTERNAL_ALLOWLIST); unknown tokens 404. Notification links opt into{SHORT_LINK_BASE_URL}/r/{token}short links viaSHORT_LINK_REDIRECT_MODE(default off keeps the existing compact-base proxy model, so no behavior change unless enabled). Tests cover resolution, open-redirect rejection, external passthrough, and the redirect-mode wiring.