PR Gates / CI image pin matches docker/ci (pull_request) Successful in 11s
PR Gates / Docs update reminder (pull_request) Successful in 16s
PR Gates / decisions lifecycle (pull_request) Failing after 23s
Build ErsatzTV Image / Formatting (changed .cs conform to .editorconfig) (pull_request) Successful in 1m17s
Build ErsatzTV Image / API docs in sync (OpenAPI + endpoint index) (pull_request) Successful in 1m29s
Build ErsatzTV Image / Build & test (.NET) (pull_request) Successful in 8m5s
Build ErsatzTV Image / EF migration integrity (SQLite + MySql) (pull_request) Successful in 16m5s
Build ErsatzTV Image / Functional E2E (curl + UI contracts) (pull_request) Successful in 17m6s
Build ErsatzTV Image / Build & push image (amd64) (pull_request) Has been skipped
168 records -> docs/decisions/records/<area>/<topic>.md (163 active, 23 dirs) and docs/decisions/archive/<area>/<topic>.md (5 archived). The filename IS the key, so one-active-record-per-key becomes a filesystem property rather than a validator check, and supersession becomes a `git mv`. WHY: the monolith was a concurrency problem before an aesthetic one. A 3,900-line append target made parallel sessions collide -- PR #605 and PR #614 both hit append-vs-append conflicts during routine rebases, and hand-resolving those inside the corpus is exactly the operation the rationale-rewrite guard exists to police. HOW IT IS VERIFIED: a ~170-file diff cannot be meaningfully read, so correctness does not rest on reading it. The parser was taught BOTH formats first, so the body-diff guard parses the old form at the merge-base and the new form at head -- the migration validates itself, no bypass. The proof is a field-level equivalence harness: 168 records before and after, zero lost, zero gained, zero field mismatches, zero rationale bodies differing. Reviewers should scrutinise the harness; it is the actual evidence. What measuring caught that reading would not have: - ~500 lines sit OUTSIDE any record -- decisions.md's lifecycle schema and each topic file's preamble, mostly the only copy. Source files are kept and stripped, never deleted. They also cannot be filed per-area: topic files hold several areas and 4 of 23 areas span several files. - Archive discovery was a non-recursive glob; after the split it found ZERO archived records, surfacing as four bogus "supersedes points to unknown key" errors rather than an obvious failure. - ~32 live docs point into the corpus BY DATE, which the split dangles. Each stripped file now ends with a generated "Records formerly in this file" index, which also rescues the identical breadcrumbs in old issue comments. - decisions.md's "In this file:" list was 97 same-file anchor bullets that the split makes WRONG, not merely stale. Dropped; the generated index replaces them with links that resolve. The equivalence harness now runs against a checked-in FIXTURE, not the live corpus. The earlier version migrated the real tree, which made it a one-shot: the moment the migration landed there was nothing left to move and the tests failed for reasons unrelated to the code. A fixture keeps them testing the SCRIPT rather than the repo's current state. Keys preserved verbatim, warts included: `sched` (12) and `scheduling` (1) remain two directories for one concept. Renaming a key is not a move -- it changes identity, breaks the equivalence proof, and invalidates MemPalace's per-key drawers. Taxonomy normalisation is separate work. refs #610
5.4 KiB
5.4 KiB
key, title, status, since, supersedes, superseded-by, rule, signals, mechanics
| key | title | status | since | supersedes | superseded-by | rule | signals | mechanics |
|---|---|---|---|---|---|---|---|---|
| security.iptv-access-token-transport | 2026-07-23 — access_token transport hardening: percent-encode in M3U/HLS, redact from logs, no-store on tokened manifests (#421, #559) | active | 2026-07-23 | none | none | The `/iptv` `?access_token=` value is percent-encoded (`Uri.EscapeDataString`) everywhere it is interpolated into an M3U/HLS/XMLTV URL (XMLTV additionally XML-escapes the encoded value), so a structural character can't malform the manifest or guide; Serilog logs a scrubbed request path (`access_token` → `***` via `IncludeQueryInRequestPath = false` + a `RequestPathScrubbed` enricher), so a 5xx/Debug `/iptv` request never writes the token; and every dynamic token-bearing `/iptv` manifest (`channels.m3u`, `xmltv.xml`, the HLS multi-variant/media playlists) returns `Cache-Control: private, no-store`. | access_token quote-safety, url-tvg breakout, M3U attribute escaping, XMLTV icon src encoding, request-log token redaction, no-store manifest, token replay from logs/cache · paths: `ErsatzTV.Core/Iptv/ChannelPlaylist.cs`, `ErsatzTV/Controllers/IptvController.cs`, `ErsatzTV.Application/Channels/Queries/GetChannelGuideHandler.cs`, `ErsatzTV/Middleware/RequestLogScrubber.cs`, `ErsatzTV/Startup.cs`, `ErsatzTV.Core/FFmpeg/FFmpegLibraryProcessService.cs` · issues: #421, #559, #552, #376 | `ChannelPlaylistAccessTokenTests`; `RequestLogScrubberTests`; `IptvControllerCacheHeaderTests` |
Resolves the "deferred hardening" bullet under security.iptv-browser-token (#552). The shared ?access_token=
transport had three pre-existing weaknesses that #552's short-lived browser token only bounded (not fixed);
they predate #552 because Jellyfin and the M3U playlist already pass access_token in /iptv URLs.
- Percent-encode the token in M3U/HLS URLs (#421).
ChannelPlaylist.ToM3Uinterpolates the token into quoted M3U attributes (url-tvg="...",tvg-logo="...") and bare stream URLs;IptvController.AccessTokenQueryand the internal segmenter URL (FFmpegLibraryProcessService.WrapSegmenter) do the same. A token containing a"could terminate a quoted attribute early, and an&could split the query — for strict parsers. The value is a URL query parameter, so the correct fix is percent-encoding (Uri.EscapeDataString) at each interpolation site; ASP.NET decodesRequest.Query, so the round-trip is lossless and validation is unchanged. For a normal base64url JWT this is a no-op (every character is RFC 3986 unreserved), so the M3U goldens are byte-identical. This is the M3U analogue of #376's XMLTVSecurityElement.Escapefix — #376 correctly did not apply to M3U (M3U is not XML), which is why #421 was split out. The XMLTV twin (GetChannelGuideHandler) is fixed the same way for symmetry: the token there lands in a URL query value inside an XML attribute, so it now percent-encodes then XML-escapes (SecurityElement.Escape(Uri.EscapeDataString(token))) — #376's XML-escape alone guarded XML well-formedness but not URL correctness, so a token with&would still truncate the query after the consumer XML-unescapes the attribute. - Redact the token from request logs (#559).
UseSerilogRequestLogginghadIncludeQueryInRequestPath = true, and theex != null/StatusCode > 499branches log at Error regardless of path — so a 5xx on a tokened/iptvURL wrote the replayable, globally-scoped token to the log under default settings. Fix:IncludeQueryInRequestPath = false(built-inRequestPathis now path-only) plus aRequestPathScrubbeddiagnostic-context property — built byRequestLogScrubber.ScrubbedPath, which rebuilds the query with theaccess_tokenvalue masked to***and everything else (e.g.mode=segmenter) preserved for debugging — that the message template references in place of{RequestPath}. A distinct property name is required because Serilog appends its ownRequestPathafter enriched properties, so reusing the name would let the built-in value win. Load-bearing residual: this scrubs onlyUseSerilogRequestLogging. ASP.NET's ownMicrosoft.AspNetCore.Hosting.Diagnostics"Request starting" line logs the raw query (token and all) at Information; it is suppressed today solely by the"Microsoft": "Warning"override inappsettings.json, which is not reachable from the runtime logging-settings UI (theHttpLevelSwitchoverrides onlySerilog.AspNetCore.RequestLoggingMiddleware). Keep that override — loweringMicrosoftto Information/Debug for routing/auth debugging re-leaks the token. A category-agnostic scrub filter is the follow-up if that override is ever relaxed. no-storeon token-bearing dynamic manifests (#559).channels.m3u,xmltv.xml, and the HLS multi-variant/media playlists embed the caller's token in their body/URLs but set no cache headers, so a browser or intermediary could cache the token-bearing manifest. Each now returnsCache-Control: private, no-store. This covers the Jellyfin-facing M3U/XMLTV as well as the #552 HLS preview manifests — all three share the same cache-replay risk — and does not affect Jellyfin, which refetches the playlist/guide on its own schedule regardless of HTTP cache headers. The.tslive streams and the ungated HLS segments (served byUseStaticFilesat/iptv/session, outsideConditionalIptvAuthorizeFilter) carry no token and are unchanged.