feat(serve): add --cdm-only for a CDM backend with no REST API

Mounts only the pywidevine and pyplayready routes plus /api/health and the dashboard; no session store, service refresh or Swagger.
This commit is contained in:
imSp4rky
2026-10-06 18:24:21 -06:00
parent f86359de5d
commit 3fd69e8039
5 changed files with 88 additions and 50 deletions
+8
View File
@@ -181,3 +181,11 @@ def test_good_rate_limit_config_starts(runner: CliRunner, monkeypatch: pytest.Mo
{"tiers": {"bot": {"rate_limit": 600}}, "users": {"k": {"username": "bot", "tier": "bot"}}},
)
assert started, output
def test_serve_cdm_only_with_remote_only_rejected(runner: CliRunner) -> None:
"""`--cdm-only` is mutually exclusive with `--api-only` and `--remote-only`; the check runs before config."""
result = runner.invoke(serve, ["--cdm-only", "--remote-only"])
assert result.exit_code != 0
output = re.sub(r"\x1b\[[0-9;]*m", "", result.output or str(result.exception))
assert "Cannot use --cdm-only" in output