Add public pricing proxy endpoint (forwards to Vela Platform P&L)

This commit is contained in:
root
2026-06-20 19:29:33 +00:00
parent 8da70dbdb8
commit e7b0522f38
+15
View File
@@ -165,6 +165,21 @@ class AnalyzeBody(BaseModel):
submission_ids: list[int] = []
all: bool = False
# ---- Public Pricing Proxy (fetches from P&L Platform on CT 125) ----
@app.get("/api/public/pricing")
async def proxy_public_pricing():
"""Proxy: fetch live pricing from Vela Platform P&L manager."""
import urllib.request, json
try:
req = urllib.request.Request("http://192.168.1.125/api/public/pricing")
with urllib.request.urlopen(req, timeout=5) as resp:
return json.loads(resp.read().decode())
except Exception as e:
raise HTTPException(502, f"P&L backend unavailable: {e}")
# ---- Auth ----
@app.post("/admin/login")