Skip to content

fix(hls): preserve denied broadcast reference errors - #6495

Merged
kixelated merged 6 commits into
mainfrom
codex/hls-reference-denied
Oct 24, 2026
Merged

kixelated merged 6 commits into
mainfrom
codex/hls-reference-denied

Conversation

@kixelated

@kixelated kixelated commented Oct 23, 2026 •

Copy link
Copy Markdown
Collaborator

Problem

A scoped origin may allow a catalog while denying a rendition's referenced broadcast. HLS discarded that existing typed authorization error and answered missing media or waited for readiness.

Approach

Propagate a denied binding's existing Unauthorized error through rendition playlist (ranged included), init and segment reads. Readiness settles on the refusal, and the HTTP router answers 403 with Cache-Control: no-store. Allowed sibling renditions keep serving. An authorization-only guard preserves retained media after an unrelated timeline failure. A pending media read also propagates a later refusal from its exact captured binding.

Impact

  • HTTP: denied referenced media returns an empty, uncacheable 403 instead of 404, 416 or a readiness wait. Missing/disconnected media remains 404.
  • Library: no public signatures, error variants, dependencies or package versions change. The existing Error::Mux(moq_mux::Error::Moq(moq_net::Error::Unauthorized)) reaches callers, including the segment cursor; MIGRATE.md describes the behavior.
  • MoQ wire: unchanged.

Decisions

  • Merged main's announcement-following bindings (moq-dev/moq#6254), which removed bind reissuing. The no-reissue guard for denied bindings and its unit test became moot and were dropped.
  • A denied reference takes precedence over range validation (Codex finding), so a ranged playlist read answers 403 rather than 416.
  • The segment cursor fails with the refusal instead of waiting forever on an empty window (Codex finding), including a refusal that lands while it waits for a row or for its own timeline to resolve one.

Validation

  • Before fix, the scoped HTTP segment test reproduced 404 instead of 403, and the ranged playlist case reproduced 416 instead of 403. An event-driven pending read test reproduced a later authorization refusal being swallowed by a segment fetch and hanging the segment cursor, both on an empty window and while resolving another rendition's row.
  • Focused tests cover mixed allowed/denied sibling media, playlist/ranged playlist/init/segment 403 with empty no-store responses, master exclusion, a broader Source fetching real denied-sibling frames without warming the restricted export, all-denied readiness, typed library errors and retained media after timeline failure. The existing disconnected-sibling 404 test passes.
  • just check: pass on d4b87d8.
  • quest check --base origin/main: pass.
  • just test interop --all: pass on 58679a5; the later commits only touch the HLS segment cursor.

(Written by GPT-6, updated by Claude Opus 5.5)

🤖 Generated with Claude Code

kixelated and others added 3 commits October 22, 2026 21:24
Propagate scoped-origin Unauthorized errors through rendition reads and return uncacheable HTTP 403 without reissuing the denied binding. Preserve allowed sibling playback and missing-media behavior.

Co-Authored-By: GPT-6 <noreply@openai.com>
Use the private authorization guard for media reads while preserving timeline failure checks for listings. Cover retained init and segment draining alongside denied references.

Co-Authored-By: GPT-6 <noreply@openai.com>
Co-Authored-By: GPT-6 <noreply@openai.com>
@kixelated
kixelated marked this pull request as ready for review October 23, 2026 18:16
@coderabbitai

coderabbitai Bot commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 9 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 4 included reviews currently available.

Learn how review limits work.

Review configuration:

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 418c9635-da7a-43e5-a76d-cc6275f96c37
Commits

Reviewing files that changed from the base of the PR and between a7c5f12 and d4b87d8.

Files selected for processing: 5
  • rs/moq-hls/MIGRATE.md
  • rs/moq-hls/src/export/mod.rs
  • rs/moq-hls/src/export/rendition.rs
  • rs/moq-hls/src/export/segments.rs
  • rs/moq-hls/src/server/routes.rs
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-24T02:55:48.574316Z d4b87d8 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 32f87b3439

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread rs/moq-hls/MIGRATE.md Resolved
Main's announcement-following bindings no longer reissue a failed bind, so the
denied-binding reissue guard and its unit test are dropped. A ranged playlist
read now reports a denied reference before validating the range.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 58679a5761

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread rs/moq-hls/MIGRATE.md Resolved
A cursor over a denied rendition waited forever on its empty window. It now
fails with the authorization error, including a refusal that lands while it
waits.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 645e8387cd

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread rs/moq-hls/src/export/segments.rs Resolved
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@kixelated
kixelated added this pull request to the merge queue Oct 24, 2026
Merged via the queue into main with commit e61cee5 Oct 24, 2026
10 checks passed
@kixelated
kixelated deleted the codex/hls-reference-denied branch October 24, 2026 05:34
kixelated added a commit that referenced this pull request Oct 24, 2026
Keep the authorization checks from #6495 on the parsed segment id, and adapt its tests to the trimmed routes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant