Skip to content

Commit 84e7064

Browse files
committed
fix test
Signed-off-by: Huabing Zhao <[email protected]>
1 parent a7689a9 commit 84e7064

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

internal/mcpproxy/authorization.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,6 @@ func compileAuthorization(auth *filterapi.MCPRouteAuthorization) (*compiledAutho
8686
}
8787

8888
// authorizeRequest authorizes the request based on the given MCPRouteAuthorization configuration.
89-
9089
func (m *MCPProxy) authorizeRequest(authorization *compiledAuthorization, headers http.Header, backendName, toolName string, arguments any) (bool, []string) {
9190
if authorization == nil {
9291
return true, nil

tests/e2e/mcp_route_authorization_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ func TestMCPRouteAuthorization(t *testing.T) {
139139
})
140140
require.Error(t, err)
141141
errMsg := strings.ToLower(err.Error())
142-
require.True(t, strings.Contains(errMsg, "403") || strings.Contains(errMsg, "authorization"), "unexpected error: %v", err)
142+
require.True(t, strings.Contains(errMsg, "forbidden"), "unexpected error: %v", err)
143143
})
144144

145145
t.Run("missing scopes fall back to deny", func(t *testing.T) {
@@ -166,7 +166,7 @@ func TestMCPRouteAuthorization(t *testing.T) {
166166
})
167167
require.Error(t, err)
168168
errMsg := strings.ToLower(err.Error())
169-
require.True(t, strings.Contains(errMsg, "403") || strings.Contains(errMsg, "authorization"), "unexpected error: %v", err)
169+
require.True(t, strings.Contains(errMsg, "forbidden"), "unexpected error: %v", err)
170170
})
171171

172172
t.Run("WWW-Authenticate on insufficient scope", func(t *testing.T) {

0 commit comments

Comments
 (0)