Skip to content

feat(launcher): regenerate the operator token - #140

Merged
Ezo-mas merged 3 commits into
mainfrom
feat/launcher-token-regen
Nov 25, 2026
Merged

Ezo-mas merged 3 commits into
mainfrom
feat/launcher-token-regen

Conversation

@Ezo-mas

@Ezo-mas Ezo-mas commented Nov 24, 2026 •

Copy link
Copy Markdown
Member

Last launcher backlog item: Regenerate the operator token.

What

  • Advanced → Network shows New operator token whenever network access is selected. It asks once ("Devices with the current token lose operator access until they enter the new one"), then saves a fresh token to launcher.json.
  • Only while stopped (owner's choice): the server and pipeline read BIBLELIVE_OPERATOR_TOKEN at start, so the button is disabled while live with "Stop BibleLive to make a new token." The new token takes effect at the next Start, and it then shows in the network details and QR as usual.
  • Devices with the old token are rejected (401 / WS 1008). The operator page drops its stored token and asks for the new one. No server, auth or protocol change.
  • If saving fails, the old token stays in memory and on disk, and the console says so. The token is never logged.

Backend: LauncherController.regenerate_token() + bridge method (webui.py), EN/LT log strings. Frontend: TokenRenewal in Settings.tsx, bridge type, demo bridge, EN/LT messages. Changelog entry; backlog item removed.

Security review

Done on the diff (token change, per SECURITY.md). No findings. Checked:

  • the token comes from secrets (existing generator);
  • the token is not in the log or the diagnostics bundle (it is redacted there);
  • the bridge method takes no input and never returns the token;
  • revocation works end to end: build_plan sets the env token explicitly, _probe_plan only feeds the mic meter, and the CLI and Tk fallback reload settings from disk.

Checks

  • ruff check, ruff format --check, mypy (117 files): clean.
  • pytest backend/tests: 2295 passed, 5 skipped. The skips are POSIX process groups ×3 and Quartz/AVFoundation on macOS ×2.
  • Frontend lint, typecheck, format:check: clean. Vitest: 755 passed.

A New operator token button replaces the saved network-mode token, which
locks out every device it was shared with. It is only available while
BibleLive is stopped, because the server and pipeline read the token at
start; the new one takes effect at the next Start. Asks once before it
goes ahead, keeps the old token if saving fails, and never logs the token.
The New operator token button sat in its own row below the network
fields, with the port warning's reserved line leaving a gap above it.
It is now an Operator token field under Access with a short key-icon
Replace button, and the port field spans both rows so its warning line
sits beside it.
@Ezo-mas
Ezo-mas merged commit 85cf748 into main Nov 25, 2026
4 checks passed
@Ezo-mas
Ezo-mas deleted the feat/launcher-token-regen branch November 25, 2026 16:45
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