Skip to content

Commit f3196ca

Browse files
committed
update api
Signed-off-by: Huabing Zhao <[email protected]>
1 parent 76f8729 commit f3196ca

File tree

3 files changed

+20
-0
lines changed

3 files changed

+20
-0
lines changed

api/v1alpha1/mcp_route.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -259,11 +259,17 @@ type MCPRouteAuthorizationRule struct {
259259
//
260260
// +kubebuilder:validation:Required
261261
Target MCPAuthorizationTarget `json:"target"`
262+
263+
// Action defines whether to allow or deny requests that match this rule.
264+
//
265+
// +kubebuilder:validation:Required
266+
Action egv1a1.AuthorizationAction `json:"action"`
262267
}
263268

264269
type MCPAuthorizationTarget struct {
265270
// Tools defines the list of tools this rule applies to.
266271
//
272+
// +kubebuilder:validation:Required
267273
// +kubebuilder:validation:MinItems=1
268274
// +kubebuilder:validation:MaxItems=16
269275
Tools []ToolCall `json:"tools"`
@@ -280,6 +286,7 @@ type JWTSource struct {
280286
// Scopes defines the list of JWT scopes required for the rule.
281287
// If multiple scopes are specified, all scopes must be present in the JWT for the rule to match.
282288
//
289+
// +kubebuilder:validation:Required
283290
// +kubebuilder:validation:MinItems=1
284291
// +kubebuilder:validation:MaxItems=16
285292
Scopes []egv1a1.JWTScope `json:"scopes"`

manifests/charts/ai-gateway-crds-helm/templates/aigateway.envoyproxy.io_mcproutes.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -603,6 +603,13 @@ spec:
603603
MCPRouteAuthorizationRule defines an authorization rule for MCPRoute based on the MCP authorization spec.
604604
Reference: https://modelcontextprotocol.io/specification/draft/basic/authorization#scope-challenge-handling
605605
properties:
606+
action:
607+
description: Action defines whether to allow or deny
608+
requests that match this rule.
609+
enum:
610+
- Allow
611+
- Deny
612+
type: string
606613
source:
607614
description: Source defines the authorization source
608615
for this rule.
@@ -653,6 +660,7 @@ spec:
653660
- tools
654661
type: object
655662
required:
663+
- action
656664
- source
657665
- target
658666
type: object

site/docs/api/api.mdx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1684,6 +1684,11 @@ Reference: https://modelcontextprotocol.io/specification/draft/basic/authorizati
16841684
type="[MCPAuthorizationTarget](#mcpauthorizationtarget)"
16851685
required="true"
16861686
description="Target defines the authorization target for this rule."
1687+
/><ApiField
1688+
name="action"
1689+
type="[AuthorizationAction](#authorizationaction)"
1690+
required="true"
1691+
description="Action defines whether to allow or deny requests that match this rule."
16871692
/>
16881693

16891694

0 commit comments

Comments
 (0)