Skip to content

fix: Downgrade cross-mode listener fields from errors to warnings - #333

Closed
huang195 wants to merge 1 commit into
rossoctl:mainfrom
huang195:fix/relax-cross-mode-validation
Closed

huang195 wants to merge 1 commit into
rossoctl:mainfrom
huang195:fix/relax-cross-mode-validation

Conversation

@huang195

Copy link
Copy Markdown
Member

Summary

  • Cross-mode listener field checks in validateListeners() are now warnings instead of errors
  • Enables a shared per-namespace ConfigMap with ${...} placeholders for all modes
  • The required-field check (reverse_proxy_backend for proxy-sidecar) remains an error

Context

The shared authbridge-runtime-config ConfigMap uses ${ENV_VAR} expansion for
listener addresses. In envoy-sidecar mode, proxy-sidecar env vars like REVERSE_PROXY_ADDR
are unset, so Load() preserves them as literal "${REVERSE_PROXY_ADDR}" strings
(by design — see config.go:95-99). The validator was rejecting these non-empty values,
breaking envoy-sidecar startup when the ConfigMap contains proxy-sidecar placeholders.

Since cross-mode fields are unused at runtime (envoy-sidecar only starts ext_proc,
proxy-sidecar only starts reverse/forward proxy), having them set to garbage strings
causes no harm. Logging a warning preserves observability without blocking startup.

Test plan

  • TestValidate_CrossModeFieldsAreWarnings covers all 5 cross-mode combinations
  • TestValidate_ProxySidecarRequiresBackend still asserts the required-field error
  • All existing tests pass (go test ./config/ -v)

Assisted-By: Claude (Anthropic AI) [email protected]

The shared ConfigMap uses ${...} env var placeholders for listener
addresses. In envoy-sidecar mode, proxy-sidecar env vars like
REVERSE_PROXY_ADDR are unset, so Load() preserves them as literal
"${REVERSE_PROXY_ADDR}" strings. The validator was rejecting these
non-empty values, breaking envoy-sidecar startup when the ConfigMap
contains proxy-sidecar placeholders.

Cross-mode listener fields are now logged as warnings instead of
errors, since they are unused at runtime and cause no harm. The
required-field check for proxy-sidecar (reverse_proxy_backend) is
kept as an error.

Signed-off-by: Hai Huang <[email protected]>
Assisted-By: Claude (Anthropic AI) <[email protected]>
Signed-off-by: Hai Huang <[email protected]>
@huang195

Copy link
Copy Markdown
Member Author

Closing — shared ConfigMap approach doesn't work well since authbridge-runtime-config is only created by Helm for pre-declared namespaces, not at runtime by the backend.

@huang195 huang195 closed this Apr 20, 2026
@huang195
huang195 deleted the fix/relax-cross-mode-validation branch May 20, 2026 18:05
huang195 added a commit to huang195/kagenti-extensions that referenced this pull request Nov 6, 2026
Fixes review: CodeQL alert rossoctl#333 on the context-guru session id. The alert is dismissed as a false positive. The codeql comment from 716f27d did not suppress it, so this commit removes the comment.
Fixes review: raw client host in cpex boundToDestination, token-broker server_url and forwardproxy WebSocket log lines.
Fixes review: the same raw host and path values in core/auth HandleInbound and HandleOutbound, and the audience that per-host mode derives from the host.
Fixes review: raw pctx.Host as "endpoint" in inference-parser and litellm-budget-track pricing warnings.
Files:
- core/auth/auth.go
- core/auth/log_sanitize_test.go
- core/listener/forwardproxy/server.go
- core/listener/forwardproxy/websocket.go
- core/plugins/contextguru/plugin.go
- core/plugins/cpex/manager_cpex.go
- core/plugins/inferenceparser/cacheblind.go
- core/plugins/litellm_budgettrack/drift.go
- core/plugins/tokenbroker/client/client.go
- core/plugins/tokenbroker/plugin.go

Assisted-By: Claude (Anthropic AI) <[email protected]>
Signed-off-by: Hai Huang <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: New/ToDo

Development

Successfully merging this pull request may close these issues.

1 participant