refactor(api): answer every API key question from one KeyPolicy

This commit is contained in:
imSp4rky
2026-11-25 21:14:09 -07:00
parent 2da0043d17
commit 9febbb20c5
29 changed files with 721 additions and 646 deletions
+2 -2
View File
@@ -55,7 +55,7 @@ def cli_search(monkeypatch: pytest.MonkeyPatch, tmp_path: Path) -> click.Context
def rest_handlers(monkeypatch: pytest.MonkeyPatch) -> tuple[Any, dict]:
"""The handlers module with the service, its config, CDM and proxy stubbed, and the context it builds."""
from unshackle.core.api import handlers
from unshackle.core.api import handlers, key_policy
seen: dict = {}
@@ -63,7 +63,7 @@ def rest_handlers(monkeypatch: pytest.MonkeyPatch) -> tuple[Any, dict]:
seen["ctx"] = parent_ctx
return SimpleNamespace(authenticate=lambda cookies, credential: None)
monkeypatch.setattr(handlers, "load_service_config", lambda tag: {})
monkeypatch.setattr(key_policy, "load_service_config", lambda tag: {})
monkeypatch.setattr(handlers, "resolve_handler_proxy", lambda *a: (None, []))
monkeypatch.setattr(handlers, "load_full_cdm", lambda *a: None)
monkeypatch.setattr(handlers.Services, "load", lambda tag: SimpleNamespace())