Skip to content

feat: Add per-sidecar injection controls to agent and tool import - #1174

Merged
mrsabath merged 2 commits into
rossoctl:mainfrom
mrsabath:feat/per-sidecar-injection-controls
Apr 9, 2026
Merged

mrsabath merged 2 commits into
rossoctl:mainfrom
mrsabath:feat/per-sidecar-injection-controls

Conversation

@mrsabath

@mrsabath mrsabath commented Apr 8, 2026

Copy link
Copy Markdown
Member

Summary

  • Wire envoyProxyInject, spiffeHelperInject, and clientRegistrationInject through the full stack (React UI, API types, FastAPI backend, Go TUI) so users can opt-out individual AuthBridge sidecars at import time
  • Agents default AuthBridge ON; tools default OFF (visible checkbox, user can opt-in)
  • "Advanced Injection Controls" section appears when AuthBridge is enabled on either page
  • Backend sets kagenti.io/envoy-proxy-inject, kagenti.io/spiffe-helper-inject, and kagenti.io/client-registration-inject labels on workload pod templates
  • Shipwright build annotations and finalize flow propagate the per-sidecar fields

Files changed

Layer Files Changes
Backend constants.py, agents.py, tools.py Per-sidecar label constants, request model fields, label builder logic, Shipwright annotation storage, finalize flow
Frontend ImportAgentPage.tsx, ImportToolPage.tsx, api.ts State variables, Advanced Injection Controls UI, API type fields
TUI types.go *bool fields on CreateAgentRequest and CreateToolRequest

How it works

User checks "Enable AuthBridge" → Advanced controls appear:
  ☑ Envoy Proxy (default: on)
  ☑ SPIFFE Helper (default: on)
  ☐ Legacy Client Registration Sidecar (default: off)

Backend sets labels → Webhook reads labels → Sidecars injected/skipped

Test plan

  • Python backend compiles (py_compile on all 3 files)
  • TypeScript type-check passes for our files (no errors in ImportAgentPage, ImportToolPage, api.ts)
  • Go vet passes on TUI types.go
  • Pre-commit hooks pass (ruff, go-fmt, go-vet, etc.)
  • CI pipeline passes
  • Manual UI verification: agent import shows AuthBridge ON + Advanced Controls
  • Manual UI verification: tool import shows AuthBridge OFF, opt-in works

Closes #836
Ref #1167, #1168

@huang195

huang195 commented Apr 8, 2026

Copy link
Copy Markdown
Member

@mrsabath since we have client registrations disabled in both paths: i) sidecar, ii) operator, can we enable sidecar client registration by default? Then in another PR later, we can enable operator and disable sidecar for client registration.

@huang195 huang195 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cześć Mariusz! Solid PR — wires three new per-sidecar injection controls (envoyProxyInject, spiffeHelperInject, clientRegistrationInject) cleanly through the full stack: React UI, TypeScript API types, FastAPI backend, Go TUI structs.

The implementation is consistent across all layers:

  • Field names match across Python, TypeScript, and Go (with correct json:"..." tags and omitempty/Optional[bool] for tri-state semantics)
  • Label logic is correct: envoy/spiffe are opt-out (is False → "false"), client-registration is opt-in (is True → "true")
  • The _build_common_labels pattern in agents.py propagates to pod templates via labels.copy(), and tools.py sets both labels and pod_labels explicitly — both achieve the same result
  • Finalize flows in both agents.py and tools.py correctly merge request overrides with stored config using the request.field if not None else stored pattern
  • Frontend correctly guards sidecar fields behind authBridgeEnabled in the submit handler

No security issues, no hardcoded secrets, no unused imports. The one commit is properly signed-off and follows conventions.

Areas reviewed: Python, Frontend (React/TS), Go/TUI
Commits: 1 commit, signed-off: ✅
CI status: All checks passing (E2E HyperShift pending manual trigger)

Dobra robota! Na zdrowie! 🍻

Comment thread kagenti/backend/app/routers/agents.py Resolved
@mrsabath

mrsabath commented Apr 8, 2026

Copy link
Copy Markdown
Member Author

Done in 987cf19 — client-registration sidecar now defaults to enabled (checkbox ON) on both agent and tool import pages. When the operator path is ready, we can flip the default back to off in a follow-up PR.

@mrsabath

mrsabath commented Apr 8, 2026

Copy link
Copy Markdown
Member Author

/run-e2e

@github-actions github-actions Bot added the safe-to-test Maintainer reviewed - safe to run E2E tests label Apr 8, 2026
@github-actions

github-actions Bot commented Apr 8, 2026

Copy link
Copy Markdown

E2E HyperShift Tests Started

Triggered by: @mrsabath
Commit: 987cf1911e25d359d234a98aa1a9e75c87495cb9
Workflow Run: View logs

Tests are running on OpenShift 4.20.11. This typically takes 30-45 minutes.


To re-run tests after new commits, comment /run-e2e again.

mrsabath added 2 commits April 8, 2026 18:01
Wire envoyProxyInject, spiffeHelperInject, and clientRegistrationInject
through the full stack (React UI, API types, FastAPI backend, TUI) so
users can opt-out individual AuthBridge sidecars at import time.

- Agents default AuthBridge ON; tools default OFF (opt-in checkbox)
- Advanced Injection Controls section appears when AuthBridge is enabled
- Backend sets kagenti.io/envoy-proxy-inject, spiffe-helper-inject, and
  client-registration-inject labels on workload pod templates
- Shipwright build annotations and finalize flow propagate the fields
- TUI request structs carry the new optional fields

Closes #836
Ref #1167, #1168

Assisted-By: Claude (Anthropic AI) <[email protected]>
Signed-off-by: Mariusz Sabath <[email protected]>
…nt-registration by default

- Fix JSX indentation inside authBridgeEnabled conditional blocks to
  follow conventional 2-level nesting (ImportAgentPage, ImportToolPage)
- Reset per-sidecar injection states to defaults when AuthBridge is
  toggled back on, preventing stale state from confusing users
- Enable client-registration sidecar by default (was opt-in) since
  operator-managed registration is not yet available; will be swapped
  in a follow-up PR
- Update checkbox label from "Legacy Client Registration Sidecar" to
  "Client Registration" with a clearer description

Signed-off-by: Mariusz Sabath <[email protected]>
@mrsabath
mrsabath force-pushed the feat/per-sidecar-injection-controls branch from 987cf19 to b997972 Compare April 8, 2026 22:01
@github-actions github-actions Bot removed the safe-to-test Maintainer reviewed - safe to run E2E tests label Apr 8, 2026
@github-actions

github-actions Bot commented Apr 8, 2026

Copy link
Copy Markdown

New Commits Detected

The safe-to-test label has been automatically removed because new commits were pushed.

New HEAD: b997972

For maintainers: Please review the new changes and comment /run-e2e to trigger E2E tests.

Security checklist

Before running E2E tests, verify the PR does NOT contain:

  • Changes to .github/workflows/ that bypass security
  • Changes to .github/scripts/ that could exfiltrate secrets
  • curl, wget, or nc commands to external URLs in scripts
  • Base64 encoding of environment variables
  • Printing secrets to logs (echo $SECRET)
  • Suspicious package installations

This is an automated security measure to prevent TOCTOU attacks

@github-actions

github-actions Bot commented Apr 8, 2026

Copy link
Copy Markdown

E2E HyperShift Tests Failed

Commit: 987cf1911e25d359d234a98aa1a9e75c87495cb9
Result: Tests failed - please check the logs
Workflow Run: View logs


To re-run tests after fixing issues, comment /run-e2e again.

@mrsabath

mrsabath commented Apr 8, 2026

Copy link
Copy Markdown
Member Author

/run-e2e

@github-actions github-actions Bot added the safe-to-test Maintainer reviewed - safe to run E2E tests label Apr 8, 2026
@github-actions

github-actions Bot commented Apr 8, 2026

Copy link
Copy Markdown

E2E HyperShift Tests Started

Triggered by: @mrsabath
Commit: b997972a6838208c91d8841527745034870a89b2
Workflow Run: View logs

Tests are running on OpenShift 4.20.11. This typically takes 30-45 minutes.


To re-run tests after new commits, comment /run-e2e again.

@github-actions

github-actions Bot commented Apr 8, 2026

Copy link
Copy Markdown

E2E HyperShift Tests Failed

Commit: b997972a6838208c91d8841527745034870a89b2
Result: Tests failed - please check the logs
Workflow Run: View logs


To re-run tests after fixing issues, comment /run-e2e again.

@mrsabath
mrsabath merged commit 7453adb into rossoctl:main Apr 9, 2026
22 checks passed
@mrsabath
mrsabath deleted the feat/per-sidecar-injection-controls branch April 9, 2026 01:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

safe-to-test Maintainer reviewed - safe to run E2E tests

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

feature: Add AuthBridge sidecar injection opt-out controls to kagenti UI

2 participants