Skip to content

Conversation

@npolshakova
Copy link
Contributor

Description

Fixes MCP Auth policies parsing to look at the AgentgatewayPolicy backend config.

Change Type

/kind fix

Changelog

Fixed mcp authorization parsing for backend policy on AgentgatewayPolicy. 

Signed-off-by: npolshakova <[email protected]>
Signed-off-by: npolshakova <[email protected]>
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR fixes a bug in MCP authorization policy parsing where the function was incorrectly reading from the Traffic authorization config instead of the Backend MCP authorization config.

  • Corrected translateBackendMCPAuthorization to read from policy.Spec.Backend.MCP.Authorization instead of policy.Spec.Traffic.Authorization
  • Added nil safety checks for backend, MCP, and authorization fields
  • Added comprehensive test coverage for the fix including edge cases

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
pkg/agentgateway/plugins/backend_policies.go Fixed authorization parsing to correctly access backend MCP authorization config and added nil safety checks
pkg/agentgateway/plugins/backend_policies_test.go Added comprehensive test coverage for MCP authorization translation including nil checks, allow/deny actions, and verification that traffic authorization is properly ignored

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@npolshakova npolshakova added this pull request to the merge queue Nov 17, 2025
Merged via the queue into kgateway-dev:main with commit ef9fa6a Nov 17, 2025
34 of 35 checks passed
@npolshakova npolshakova deleted the fix-mcp-backend-auth branch November 17, 2025 14:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/fix Categorizes issue or PR as related to a bug. release-note

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants