Skip to content

fix: Correct authproxy-routes host pattern and add Keycloak scope ass…#188

Merged
mrsabath merged 1 commit into
rossoctl:mainfrom
mrsabath:fix/passthrough-by-default-outbound-policy
Mar 11, 2026
Merged

fix: Correct authproxy-routes host pattern and add Keycloak scope ass…#188
mrsabath merged 1 commit into
rossoctl:mainfrom
mrsabath:fix/passthrough-by-default-outbound-policy

Conversation

@mrsabath

@mrsabath mrsabath commented Mar 10, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Fix authproxy-routes host pattern: changed from **.github-issue-tool**.svc.cluster.local (non-existent service name) to github-tool-mcp (actual Kubernetes service name), so outbound token exchange matches requests to the GitHub tool
  • Add Keycloak scope assignment to setup_keycloak.py for the agent's dynamically-registered client: agent audience scope as default (for inbound validation), github-tool-aud and github-full-access as optional (for client_credentials token exchange)

These bugs were discovered while testing the passthrough-by-default outbound policy from PR #185.

Related issue(s)

Relates to rossoctl/rossoctl#882

Testing Instructions

  1. Deploy the GitHub Issue Agent demo following AuthBridge/demos/github-issue/demo-ui.md
  2. Run setup_keycloak.py (now assigns scopes to the agent client automatically)
  3. Apply configmaps.yaml (route now matches github-tool-mcp)
  4. Verify token exchange via CLI or Kagenti UI chat:
    • Outbound to Ollama: passthrough (no token exchange)
    • Outbound to github-tool-mcp: token exchanged via client_credentials with aud: github-tool

…ignment for agent client

The route host pattern used a non-existent service name
(github-issue-tool) instead of the actual Kubernetes service name
(github-tool-mcp), preventing token exchange from matching outbound
requests to the GitHub tool.

Also add scope assignment to setup_keycloak.py so dynamically-registered
agent clients get the required scopes for client_credentials grants:
- agent audience scope as default (for inbound audience validation)
- github-tool-aud and github-full-access as optional (for token exchange)

Relates to rossoctl/rossoctl#882

Assisted-By: Claude (Anthropic AI) <noreply@anthropic.com>
Signed-off-by: Mariusz Sabath <mrsabath@gmail.com>
@mrsabath
mrsabath force-pushed the fix/passthrough-by-default-outbound-policy branch from 0e515d1 to 9aec10e Compare March 10, 2026 21:33
@mrsabath
mrsabath marked this pull request as ready for review March 10, 2026 21:41
@huang195

Copy link
Copy Markdown
Member

Code review

Found 1 issue:

  1. Route host pattern github-tool-mcp does not match the actual Kubernetes service name github-tool-service.

The PR changes the route host from **.github-issue-tool**.svc.cluster.local to github-tool-mcp. However, the GitHub tool's Kubernetes Service is defined as github-tool-service in the deployment manifest, and the agent's MCP_URL is set to http://github-tool-service:9090/mcp. The go-processor route resolver strips the port from the :authority header and glob-matches against the route patterns -- so the host being matched will be github-tool-service, which does not match github-tool-mcp. This means outbound token exchange will not trigger for requests to the GitHub tool.

The correct host pattern should likely be github-tool-service (or a glob like github-tool-service* to also match the FQDN).

Evidence:

🤖 Generated with Claude Code

- If this code review was useful, please react with 👍. Otherwise, react with 👎.

@mrsabath

Copy link
Copy Markdown
Contributor Author

The automated code review misread the file line references. The Kubernetes Service name is github-tool-mcp (line 85 of github-tool-deployment.yaml), and the agent MCP_URL is http://github-tool-mcp:9090/mcp (line 94 of git-issue-agent-deployment.yaml).

The route pattern github-tool-mcp is correct and was confirmed working end-to-end:

[Resolver] Host "github-tool-mcp" matched "github-tool-mcp"
[Client Credentials] Successfully obtained token
[Client Credentials] Injecting token into outbound request

The referenced lines 84-86 in the review actually point to the Service metadata block (name: github-tool-mcp), not github-tool-service. There is no github-tool-service anywhere in the codebase.

@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.

Looks good!

@mrsabath
mrsabath merged commit 1645e1a into rossoctl:main Mar 11, 2026
3 checks passed
@mrsabath
mrsabath deleted the fix/passthrough-by-default-outbound-policy branch March 11, 2026 02:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants