* fix(api): require the consumption tier on the dub and shared-job reads
dub_export.py and dub_core.py built a bare APIRouter, so their reads carried no
principal check at all - only reject_cross_site_get, which refuses browser
cross-site requests and never looks at the caller. Dubbed audio and video, the
transcript exports (txt/srt/vtt), segment text, export bundles and the shared job
inventory were therefore reachable by any caller that could reach the backend,
while every mutation in the same modules already required the consumption tier.
A peer that is neither loopback nor in OMNIVOICE_TRUSTED_NETWORKS and presents no
credential resolves to ANONYMOUS with no capabilities. The PIN and API-key
middlewares are inert when neither is configured, so a backend published without
a credential answered those reads with user content and absolute host paths.
require_consumer cannot close this on its own: in server mode (the Docker image's
OMNIVOICE_SERVER_MODE=1) it exempts a credential-free caller so the operator's own
browser behind Docker's NAT keeps working, and that exemption cannot tell that
browser from an anonymous LAN peer. Split the gate in two - require_consumer keeps
the exemption for metadata routes, and require_consumer_credential, used by both
dub routers, requires loopback, an admin session, the API key, a share PIN or a
trusted-network client. Docker deployments satisfy it with the API key their
compose file already requires, or with a share PIN.
The census allowlist drops the keys that described these reads as undecided, and
a new census test fails if any /dub or shared-job GET loses the tier. A behaviour
test pins that server mode still exempts metadata reads while refusing the dub
reads. Tests that drive these reads as the app's own client now use the loopback
peer, the same way the sibling dub tests already model it.
* test: call the dub and job reads from loopback; document the read tier
* test: the dub/job census requires the strict consumer credential
---------
Co-authored-by: DeryFerd <deryferdikao125@gmail.com>