Skip to content

Prepare gated SRT output encryption - #45

Draft
pjeweb wants to merge 9 commits into
osb/pr/stream-id-secretfrom
osb/pr/srt-passphrase
Draft

pjeweb wants to merge 9 commits into
osb/pr/stream-id-secretfrom
osb/pr/srt-passphrase

Conversation

@pjeweb

@pjeweb pjeweb commented Nov 12, 2026 •

Copy link
Copy Markdown

Why

Streamers may want their SRT output encrypted with a passphrase. The streaming engine doesn't accept a passphrase or key length yet. If the box simply accepted an encryption setting, it could start a stream that looks encrypted in Settings but goes out unencrypted, which is worse than having no setting at all.

What

  • Write-only passphrase fields (10 to 79 UTF-8 bytes, spaces kept) and AES key-length checks. The passphrase is never sent back and is scrubbed from logs and journal exports.
  • The settings controls exist in all ten languages but stay hidden for now.
  • If encryption settings are saved anyway, Start is refused before the engine is contacted, with a clear explanation, so the box never streams unencrypted by mistake.
  • Leaving the passphrase out keeps the stored one, and an explicit empty value clears it. While the controls are hidden, streaming.setConfig({ srt_passphrase: "" }) clears both saved encryption fields.

How: the backend side is ready, but a gate stays closed until the engine publishes the capability and typed Start fields. I didn't invent any engine fields, and nothing here claims encrypted streaming works. Stream ID access control (checked by the receiver) stays separate from encryption.

Sits on #46; land that first. I merged #46's latest change in, so remote results here drop the passphrase, the Stream IDs and the "is set" flags, and the journal test also checks that a stored passphrase line never leaves the box.

Screenshots

Encryption controls are hidden by default. The after screenshots use a temporary local gate override for review; no committed code was changed.

Before After (with the gate switched on)
Before: SRT output encryption controls (390 px) After (with the gate switched on): SRT output encryption controls (390 px)
Before: SRT output encryption controls (1280 px) After (with the gate switched on): SRT output encryption controls (1280 px)

How to verify

With the gate closed, the encryption controls don't appear. Saving a passphrase through the API is refused. Put one into config.json by hand and try to start: Start is refused before the engine is contacted, and the passphrase doesn't show up in replies, logs or the journal download. Sending srt_passphrase: "" clears it again.

Latest change, testing and limits
  • Latest change: the explicit clear now runs as its own step after setConfig's destination writes (server, account, Stream ID override, protocol, ingest slot). It used to sit in the middle of them, and the integration branch has a receiver test that replays exactly that run of writes, so it refused to run once this PR was merged. Behaviour is the same. A new test checks that the clear is the only place setConfig writes the stored passphrase or key length, that it only ever empties them, and that it comes after the destination writes.
  • Merged onto the current integration branch: the full frontend suite passes (489 files, 8,009 tests, including the receiver test above), as do the focused passphrase, Stream ID, logging and Start tests (137), the remote privacy tests (26 files, 226), the rpc schema tests and the backend type check. All ran with one worker.
  • Earlier, with Treat SRT Stream IDs as write-only secrets #46's update merged in: full backend suite, rpc, translations, sender, lint, type checks and the production build pass, and all notification strings render in all ten languages.
  • Switching the gate on later needs a published engine capability and typed Start fields, restricted storage for accepted writes and a check against a real encrypted receiver.
  • Old values after a replace or clear, and unsaved values, are only scrubbed where they match the existing label patterns.

Risks

None for streaming today: the gate is closed and Start refuses any saved encryption setting.


Checklist

  • Docs updated if behavior or structure changed (Rule A: AGENTS.md within budget, README, docs/, versions.yaml)
  • User docs (Rule G): no user-visible change, OR ceralive-docs PR updates English and Spanish, plus ceralive-website PR if a landing claim changed
  • Started from updated main; branch rebased on latest canonical branch (Rule B)
  • Rule D local-scratch reference check passes for tracked files
  • Tests pass; QA evidence attached or linked

@pjeweb
pjeweb changed the base branch from osb/base/srt-passphrase to osb/pr/stream-id-secret November 14, 2026 10:28
@pjeweb pjeweb mentioned this pull request Nov 14, 2026
2 of 5 tasks
Remote config keeps withholding SRT passphrases and now also drops the Stream ID presence flags. The journal test also checks that a stored passphrase line never leaves the box.
The explicit SRT passphrase clear sat in the middle of setConfig's
destination writes (relay server, account, Stream ID override, protocol,
ingest slot). Those statements decide where the stream goes, and tests
that replay that run of writes treat any extra step there as a change
to the destination logic. Move the clear into its own step after them;
behaviour is unchanged.

Add a test that the only writes to the stored passphrase and key length
in setConfig are the clear, and that it comes after the destination
writes.
pjeweb added a commit that referenced this pull request Nov 16, 2026
Head 5be52bc. Remote-status inventory refreshed in the merge (26 local-only srt_passphrase/srt_pbkeylen leaves).
pjeweb added a commit that referenced this pull request Nov 16, 2026
@pjeweb pjeweb added stacked Depends on another pull request; review and integrate parents first. upstream: waits for intent Needs an issue or maintainer agreement before an upstream proposal. labels Nov 16, 2026
pjeweb added a commit that referenced this pull request Nov 17, 2026
pjeweb added a commit that referenced this pull request Nov 17, 2026
pjeweb added a commit that referenced this pull request Nov 18, 2026
pjeweb added a commit that referenced this pull request Nov 18, 2026
pjeweb added a commit that referenced this pull request Nov 19, 2026
@pjeweb pjeweb added the train: image-5 In the integration that ships in image 5; the label moves on when images advance. label Nov 21, 2026
pjeweb added a commit that referenced this pull request Nov 21, 2026
pjeweb added a commit that referenced this pull request Nov 22, 2026
pjeweb added a commit that referenced this pull request Nov 23, 2026
pjeweb added a commit that referenced this pull request Nov 24, 2026
pjeweb added a commit that referenced this pull request Nov 24, 2026
@pjeweb pjeweb added train: image-6 In the integration that ships in image 6; the label moves on when images advance. and removed train: image-5 In the integration that ships in image 5; the label moves on when images advance. labels Nov 24, 2026
pjeweb added a commit that referenced this pull request Nov 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

stacked Depends on another pull request; review and integrate parents first. train: image-6 In the integration that ships in image 6; the label moves on when images advance. upstream: waits for intent Needs an issue or maintainer agreement before an upstream proposal.

Development

Successfully merging this pull request may close these issues.

1 participant