iCal / calendar feed export of the resolved event schedule #16
Labels
No labels
area/ai
area/backend
area/frontend
area/infra
area/scheduler
area/wled
good-first-issue
priority/high
priority/low
priority/medium
type/bug
type/chore
type/ci-cd
type/docs
type/feature
type/qa
v1.0.0
v1.1.0
v1.2.0
v2.0.0
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
rbrooks/Iris-WLED#16
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?
Goal
Publish the resolved event calendar (with the day's primary event / scheme) as a subscribable iCal feed.
Why it's valuable
Iris already computes a rich, priority-resolved, multi-source calendar of holidays and events. Exposing it as an
.icsfeed lets users see "what will the lights do" inside Google Calendar / Apple Calendar / their HA dashboard — reusing data Iris already has.Sketch
GET /export/calendar.ics(token-scoped or behind auth) producing a VEVENT per resolved event day.Acceptance criteria
Proposed enhancement (not in the original spec).
Done — #120 merged, all seven CI jobs green.
VALUE=DATE,X-PUBLISHED-TTL, exclusiveDTEND.The two criteria conflict
A calendar client polls a URL and cannot complete an OIDC flow, so "subscribable" and "access-controlled" cannot both be met by the session cookie. Resolved the way Nextcloud and Radicale do: an install-wide token in the URL, kept out of
GET /settingsbecause it is a bearer credential rather than a preference, and rotatable to revoke every subscriber at once. The endpoint accepts a session as well, so the UI can link to it.Two things in the auth path worth recording:
token_matchesdeliberately does not create a token, so an unauthenticated request cannot bring a credential into existence as a side effect._has_sessionmirrorsget_current_user's expiry check rather than merely looking the row up — without it a stale cookie would read the feed indefinitely, a lower bar than every other endpoint applies.Validity is checked with a real parser
icalendarwas added as a dev-only dependency and the generated document is parsed back, rather than asserting against our own strings — which would prove only self-consistency, and "valid iCal feed" is the first criterion. That is what covers the parts of RFC 5545 that are quietly easy to get wrong:DTEND— treat it as inclusive and every event renders a day short.🎄 × 60and a long accented name.;or,is read as a property separator and corrupts the document.Note for #51
The complement (iCal import) will need
icalendarat runtime rather than dev-only. Flagging here so the dependency move is not a surprise in that PR.