velxio/backend/app/api/routes
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
..
__init__.py feat: Implement Arduino Simulator with component management and simulation features 2026-03-03 00:20:49 -03:00
compile.py feat(compile): ESP-IDF compile options + request dedup 2026-05-18 21:50:45 -03:00
compile_chip.py refactor(oss-split): introduce extension hooks for auth, DB, metrics, auto-save 2026-05-14 13:24:51 -03:00
compile_rom.py feat(chips): C-to-Z80 compile via SDCC + LED chaser example 2026-05-19 00:31:10 -03:00
flash.py feat(flash): write compiled sketches to real USB boards (phases D1+D3) 2026-05-27 00:20:20 -03:00
iot_gateway.py feat(hooks): iot_gateway_gate extension point + content-negotiated 402 2026-05-29 19:44:30 +02:00
libraries.py feat: Add library version management and uninstall functionality 2026-05-02 12:54:09 +05:30
simulation.py feat(pi): pluggable slave handler + canvas wire detection for I2C/SPI/UART 2026-05-18 16:26:37 +02:00