|
|
@@ -37,6 +37,7 @@ docker run -d --name svapi-dev -p 8080:8080 -e SMARTBOTIC_VECTORAPI_KEY=dev svap
|
|
|
- `src/` - the server. `vectorapi_core` static lib + `main.cpp`. Namespace `svapi`. Flat headers, quoted includes.
|
|
|
- `db_gateway` (`qualify(project,coll)` + `DbGateway` over `smartbotic::database::Client`), `settings_store` (global settings **and per-project embedding overrides**, hot-reload, one subscribe stream for both), `project_settings` (`ProjectEmbeddingSettings` + the pure `resolveEmbedding()`), `outbound_http` (User-Agent + TLS defaults for every external call), `key_store` (API keys, hot-reload, bootstrap admin key), `collection_registry` (per-project metadata), `embeddings` (OpenAI), `auth` (sessions, bearer/cookie), `server` (ApiServer + auth helpers), `handlers/*` (one file per route group).
|
|
|
- Auth model: pre-routing **authenticates** `/api/*` (401); each handler **authorizes** via `requireKey` → `requireAdmin` / `requireProjectAccess` (403). Keys are referenced by a stable **`id`** (not the secret).
|
|
|
+ **CONSEQUENCE WORTH KNOWING BEFORE YOU PROBE ANYTHING: an unauthenticated request to a NONEXISTENT `/api/*` path answers 401, not 404**, because the pre-routing filter runs before routing and never consults the route table. So a 401 cannot distinguish "the route exists and I lack a key" from "there is no such route" - and reading one as "the service is alive" is a check that answers confidently about a different question. Measured during the 0.12.0 deploy: `/api/v1/healthz` gave 401 unauthenticated and **404 with a valid admin key**, because the health route is `/healthz` and is NOT under `/api/`. Probe liveness at `/healthz`, and when a path matters, send a key so the 404 can reach you.
|
|
|
- `webui/` - React 19 + Vite + TS (strict, `erasableSyntaxOnly`) + Tailwind + Monaco. **`npx tsc --noEmit` is NOT the build check** - it passed on a malformed import that `npm run build` (`tsc -b && vite build`) rejected, because the project build uses different settings. Verify a UI change with `npm run build`.
|
|
|
- **A `Functions` settings tab exists and is ADMIN-ONLY**, matching its route (`requireAdmin`, not `requireProjectManage`): it bounds what one project may take from a runner every other project shares. It carries the per-kind wall caps and `network_egress`, both of which were previously reachable only by curl - and a control nobody can see is a control nobody knows exists, which mattered most for egress, where an operator could not tell whether a project's functions had outbound access. Egress renders THREE states, because `network_egress` is the effective value and `network_egress_set` says whether it was chosen or inherited: "allow (inherited)" is a different statement from "allow, set here". An empty wall-cap field means NO project cap, which is not a cap of zero, so it is held as a string to keep an empty input and a zero distinguishable all the way to the request.
|
|
|
- **The documents filter builder DISABLES the field input for `search`**, rather than annotating it. `search` ignores the field - it is a case-insensitive substring over the whole document, id and keys included - and the three inputs read as field/op/value, which asserts a scope it does not have. A control that cannot affect the result must not look like it can. The hint points at `regex` for a field-scoped substring, and `contains` gets its own hint because array membership is equally easy to misread as a substring.
|