You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit bcc1b3e
Browse filesBrowse the repository at this point in the historyBrowse files
fix(web-search): assess the bridge search endpoint as a destination (#4519)
providers.<name>.webSearchBridge.endpoint names the URL that receives that
provider's own API key as a Bearer token when the ollama bridge backend runs a
search. Two checks stood in front of it and neither was a destination assessment:
providerWebSearchBridgeConfigError did new URL plus an http/https protocol test,
and resolveOllamaWebSearchEndpoint returned the configured value whenever originOf
parsed it. Provider baseUrl has had the real assessment for a long time; the
endpoint had none, so endpoint: "http://169.254.169.254/latest/meta-data" was
accepted and the key was sent there.
Both boundaries now run the existing providerDestinationConfigError. Metadata
destinations are refused unconditionally. Loopback, localhost and private space are
refused unless the provider sets allowPrivateNetwork or its name is a registry entry
that is local by definition, which is what keeps a self-hosted Ollama working.
The plan-time check is the load-bearing one, not a second opinion. A hand-edited
config file, ocx config set and ocx config import all reach configSchema only and
never call providerWebSearchBridgeConfigError, and resolveOllamaWebSearchEndpoint is
the only reader of this field in the tree, so a value that survives file load still
cannot be spent. It refuses silently by design; config-time is where the operator is
told why.
Both checks are synchronous and literal-only and resolve no DNS, so a hostname that
resolves into metadata or private space still passes. No new classifier was written
and no DNS was added at this boundary.
Copy file name to clipboardExpand all lines: structure/runtime.md
+19Lines changed: 19 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -261,6 +261,25 @@ value import of the barrel; the barrel re-exports it.
261
261
`tests/web-search/web-search-passthrough-bridge.test.ts` covers the mismatch and matching cases for
262
262
anthropic, xai, and gemini, plus the unset-backend default.
263
263
264
+
`providers.<name>.webSearchBridge.endpoint` names the destination that receives that provider's own
265
+
API key, so it carries the same literal destination assessment as `baseUrl`:
266
+
`providerDestinationConfigError` runs both at management write time, inside
267
+
`providerWebSearchBridgeConfigError`, and at plan time inside `resolveOllamaWebSearchEndpoint`.
268
+
Metadata destinations are refused unconditionally; loopback, localhost, and private space need the
269
+
provider's `allowPrivateNetwork` opt-in or a registry entry that is local by default, which is what
270
+
keeps a self-hosted Ollama on `127.0.0.1` working. Both checks are synchronous and literal-only and
271
+
resolve no DNS, so a hostname that resolves into metadata or private space is a disclosed residual
272
+
rather than a blocked case. That residual is strictly larger than `baseUrl`'s: `baseUrl` also runs
273
+
the async `providerDestinationResolvedError` at management write, which the endpoint does not, and
274
+
parity there would still leave the hand-edited-file path uncovered because the plan-time boundary is
275
+
synchronous. The plan-time check is the
276
+
authorization boundary rather than a second opinion: a hand-edited config file, `ocx config set`,
277
+
and `ocx config import` all reach `configSchema` only and never call
278
+
`providerWebSearchBridgeConfigError`, and `resolveOllamaWebSearchEndpoint` is the only reader of
279
+
this field in the tree, so a value that survives file load still cannot be spent. It refuses
280
+
silently by design; config-time is where the operator is told why. The planner requires the
281
+
provider name for that assessment, so `planPassthroughWebSearchBridge` takes it explicitly.
282
+
264
283
## Remote Hub hardening ownership
265
284
266
285
`src/remote/protocol.ts` owns pure interval/feature negotiation. `src/remote/hub-state.ts` owns the `GET|HEAD /v1/hub-state` contract, its caps, and the parser both sides share. `src/client/hub-client.ts` owns bounded, schema-validated remote catalog consumption, hub-state reads, and key-id probes; `src/client/hub-state.ts` owns the resolution and the owner-stamped 0600 cache, and a failed read reports "unavailable" rather than degrading to the client's own local provider and login state. `src/client/hub-relay.ts` is a fixed-authority management relay with URL, header, body, redirect, and stream bounds. The public data listener remains the direct client→hub path; the loopback management ingress never serves data-plane routes.
0 commit comments