mcp: split mcp into server and client for better option grouping (#5666)

This commit is contained in:
Denis Mishin 2025-06-24 10:21:32 -07:00 committed by GitHub
parent d36c48a2bc
commit db6449ecca
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
11 changed files with 1156 additions and 934 deletions

View file

@ -912,7 +912,7 @@ func TestOptions_GetAllRouteableHTTPHosts(t *testing.T) {
assert.NoError(t, p2.Validate())
p3 := Policy{From: "https://from3.example.com", TLSDownstreamServerName: "from.example.com", To: to}
assert.NoError(t, p3.Validate())
p4 := Policy{From: "https://from4.example.com", MCP: &MCP{}, To: to}
p4 := Policy{From: "https://from4.example.com", MCP: &MCP{Server: &MCPServer{}}, To: to}
assert.NoError(t, p4.Validate())
opts := &Options{
@ -1587,15 +1587,22 @@ func TestRoute_FromToProto(t *testing.T) {
for i := range pb.LoadBalancingWeights {
pb.LoadBalancingWeights[i] = mathrand.Uint32N(10000) + 1
}
pb.Mcp.UpstreamOauth2.Oauth2Endpoint.AuthStyle = nil
case 1:
pb.Redirect, err = redirectGen.Gen()
require.NoError(t, err)
pb.Mcp.UpstreamOauth2.Oauth2Endpoint.AuthStyle = configpb.OAuth2AuthStyle_OAUTH2_AUTH_STYLE_IN_PARAMS.Enum()
pb.Mcp = &configpb.MCP{
Mode: &configpb.MCP_Client{
Client: &configpb.MCPClient{},
},
}
case 2:
pb.Response, err = responseGen.Gen()
require.NoError(t, err)
pb.Mcp.UpstreamOauth2.Oauth2Endpoint.AuthStyle = configpb.OAuth2AuthStyle_OAUTH2_AUTH_STYLE_IN_HEADER.Enum()
pb.Mcp = &configpb.MCP{
Mode: &configpb.MCP_Server{
Server: &configpb.MCPServer{},
},
}
}
return pb
}