feat: migrate project secrets and user-scoped colors

This commit is contained in:
Gabriel20xx committed 2026-09-15 13:23:17 +02:00
1 parent dcfdb3d7af
commit 0e450d53de
9 files changed
+263 -7

No files matched your search

+1 -1
View File
@@ -97,7 +97,7 @@ core_config.on_update(lambda info: auth_client.set_base_url(info.auth_guard_url)
# in your framework's route for PUT /api/core-services/internal:
async def push_core_services(request):
if request.headers.get("X-Internal-Auth") != INTERNAL_SERVICE_SECRET:
if request.headers.get("X-Internal-Auth") != SECRET:
raise HTTPException(status_code=401)
body = await request.json()
info = core_config.set(CoreConfigInfo.from_json(body))
@@ -11,7 +11,7 @@ Framework-agnostic, like the rest of this package (see the top-level
README's "HTTP framework adapters stay in each service" note): this module
has no HTTP server of its own. A service wires the actual
PUT /api/core-services/internal route in its own framework (FastAPI,
aiohttp, ...), gated behind its own INTERNAL_SERVICE_SECRET check the same
aiohttp, ...), gated behind its own SECRET check the same
way its other internal-service routes already are, decodes the JSON body
into an `Info`, and calls `Store.set(info)` -- see `Store.set`'s doc comment
for a minimal FastAPI example.
@@ -108,7 +108,7 @@ class Store:
@app.put("/api/core-services/internal")
async def push_core_services(request: Request):
if request.headers.get("X-Internal-Auth") != INTERNAL_SERVICE_SECRET:
if request.headers.get("X-Internal-Auth") != SECRET:
raise HTTPException(status_code=401)
body = await request.json()
info = core_config_store.set(Info.from_json(body))