Conversation
tnsimon
requested review from
Fei-Guo,
rambohe-ch,
techworldhello and
zhuangqh
as code owners
September 17, 2026 09:54
Contributor
|
The change is high quality and closely matches surrounding idioms (extensive doc comments, table-driven tests, Ginkgo labels, --set-json for arrays). No hard idiom violations. All findings are
Lua correctness idioms were checked and are sound: envoy_on_response re-validates the metadata origin against allowed_origins (defends against stale/forged dynamic metadata), per-stream metadata is |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add opt-in browser CORS support to the
modelharnessGateway while preserving the existing authentication boundary.The Gateway now:
/v1browser preflights locally before authentication;CORS remains disabled by default.
Configuration
Exact-origin mode:
Exact-origin mode reflects only configured origins, supports credentials, and emits
Vary: Origin.Wildcard mode:
Wildcard mode requires
*to be the sole origin and credentials to be explicitly disabled. It emitsAccess-Control-Allow-Origin: *, never emitsAccess-Control-Allow-Credentials, accepts every non-empty incoming origin (includingOrigin: null), and omitsOriginfromVary.Partial wildcards, configured literal
null, and wildcard/exact-origin combinations are rejected.Behavior
204.403.403.OPTIONSrequests are not preflights and remain subject to authentication.Origin, and paths outside/v1, are unchanged.404responses.OPTIONSis intentionally absent fromcors.allowedMethods: that setting describes the eventual application method inAccess-Control-Request-Method(such asGETorPOST), not the preflight transport method.Implementation
gateway-corsEnvoyFilterwithkaito.corsinserted first in the Gateway HTTP filter chain.--set-json.The Lua filter is used instead of native Envoy CORS because BBR recomputes routes and the initial inference route may be a
direct_response; native Envoy CORS explicitly bypasses direct-response routes.Validation
Completed local verification:
Chart verification covered default, exact-origin, wildcard, and invalid configurations; schema-bypassed template validation; YAML parsing; and
istioctl validate.Live Gateway E2E validation passed:
The live tests covered preflight
204, local denial403, authentication failure401, upstream200, and direct/local unknown-model404response paths.