velxio/backend/app/api
David Montero 594291c830 feat(hooks): iot_gateway_gate extension point + content-negotiated 402
Adds a generic gating hook so a private overlay can restrict the IoT
gateway proxy to paid plans without the OSS image carrying any plan
logic.  register_iot_gateway_gate() installs an async callback that
returns None to allow or a detail dict to block; the OSS default (no
overlay) allows everyone, and a failing gate fails OPEN so the gateway
can never be taken down by a buggy overlay.

gateway_proxy() calls the gate first.  When blocked it content-
negotiates the 402: browsers (Accept: text/html — the frontend opens
the gateway via window.open) get a small styled upgrade page with a
link to /pricing; programmatic fetch/XHR callers get the JSON detail.

No behaviour change for the open-source image — the gate is a no-op
there.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-29 19:44:30 +02:00
..
routes feat(hooks): iot_gateway_gate extension point + content-negotiated 402 2026-05-29 19:44:30 +02:00
__init__.py