Repository navigation
fix: remove built-in identity/auth logic from agents - #140
Conversation
With AuthBridge, sidecars handle all identity and auth concerns: SPIFFE identity (spiffe-helper), client registration (kagenti-client-registration), inbound JWT validation and outbound token exchange (envoy-proxy + go-processor). Remove redundant SVID probing, JWT validation middleware, and token exchange code from agents so they start cleanly without auth warnings. Agents are now pure application logic — identity is transparent via AuthBridge. - Delete auth.py from git_issue_agent and slack_researcher - Remove SVID functions, jwt imports, and auth config fields from config.py files - Simplify a2a_agent.py execute() to use GITHUB_TOKEN only or let AuthBridge handle outbound auth transparently - Remove AuthenticationMiddleware and JWKS conditional logic from run() - Always register agent-card.json route (no longer gated on JWKS_URI) - Remove JWTVerifier and SVID probing from slack_tool and reservation_tool MCP servers - Remove Keycloak/AuthBridge token settings from .env files Closes rossoctl#129 Co-Authored-By: Claude Opus 4.6 <[email protected]> Signed-off-by: Mariusz Sabath <[email protected]>
mrsabath
left a comment
There was a problem hiding this comment.
Code Review
Overall: Well-motivated, clean deletion PR. The premise is sound -- with AuthBridge handling identity/auth at the sidecar layer, agents should not duplicate this logic. Removing ~613 lines of redundant auth code is the right move. CI is green. I would approve with a few items to address.
What looks good
- Consistent approach across all 5 agents/tools -- same pattern applied uniformly: delete
auth.py, strip SVID/JWT/token-exchange fields fromconfig.py, remove middleware wiring, removeJWTVerifierfrom MCP servers. git_issue_agentfallback logic is well-handled -- cleanly supports bothGITHUB_TOKENmode and AuthBridge-transparent mode.- Agent card route always registered now -- previously gated on
not settings.JWKS_URI, which was confusing. - Whitespace cleanup -- trailing whitespace fixes and missing newlines at EOF. Good hygiene.
- No changes to
mcp/github_tool-- correctly identified Go tool does not need changes.
Issues I will fix in a follow-up commit
1. slack_tool.py: dead imports get_access_token / AccessToken
With auth=verifier removed, FastMCP will not inject access tokens into tool handlers. The get_access_token and AccessToken imports are unused. Also, the scope-based Slack client selection in get_slack_client() will silently degrade (access_token always None, falls through to ADMIN_SLACK_BOT_TOKEN). Will clean up the dead imports.
2. Missing requirements.txt cleanup
auth.py files imported authlib, httpx, and jwt (PyJWT). If those are no longer used elsewhere, they should be removed from dependency files to reduce CVE surface.
3. git_issue_agent: silent failure when neither GITHUB_TOKEN nor AuthBridge present
Old code raised an explicit error. New code silently sends empty headers. Will add a logging.warning() for debuggability in standalone/dev scenarios.
4. slack_researcher/a2a_agent.py: double space before as (nit)
Minor style inconsistency -- will fix.
I will push a follow-up commit addressing these items.
Remove authlib, PyJWT, python-keycloak, and httpx from pyproject.toml files where they are no longer imported after the auth.py deletions. Remove dead get_access_token/AccessToken imports and scope-based client selection from slack_tool (broken without JWTVerifier). Add warning log when git_issue_agent runs without GITHUB_TOKEN. Fix double-space style nit in slack_researcher. Co-Authored-By: Claude Opus 4.6 <[email protected]> Signed-off-by: Mariusz Sabath <[email protected]> Made-with: Cursor
Summary
With AuthBridge, sidecars handle all identity and auth concerns (SPIFFE identity, client registration, inbound JWT validation, outbound token exchange). The agents themselves contained redundant SVID probing, JWT validation middleware, and token exchange code that produced noisy warnings at startup and served no purpose with AuthBridge.
This PR removes all built-in auth logic so agents start cleanly as pure application logic -- identity is transparent via AuthBridge.
Changes across 5 agents/tools:
10 files changed, +23 / -613 lines
Test plan
Closes #129
Generated with Claude Code