(t *testing.T)
| 173 | } |
| 174 | |
| 175 | func TestInterceptor_MCP_TAT(t *testing.T) { |
| 176 | interceptor := &Interceptor{key: []byte("key"), sidecarHost: "127.0.0.1:16384"} |
| 177 | |
| 178 | req, _ := http.NewRequest("POST", "https://mcp.feishu.cn/mcp/v1/tools/call", bytes.NewReader([]byte(`{}`))) |
| 179 | req.Header.Set(sidecar.HeaderMCPTAT, sidecar.SentinelTAT) |
| 180 | |
| 181 | interceptor.PreRoundTrip(req) |
| 182 | |
| 183 | if identity := req.Header.Get(sidecar.HeaderProxyIdentity); identity != sidecar.IdentityBot { |
| 184 | t.Errorf("identity = %q, want %q", identity, sidecar.IdentityBot) |
| 185 | } |
| 186 | if ah := req.Header.Get(sidecar.HeaderProxyAuthHeader); ah != sidecar.HeaderMCPTAT { |
| 187 | t.Errorf("auth header = %q, want %q", ah, sidecar.HeaderMCPTAT) |
| 188 | } |
| 189 | } |
| 190 | |
| 191 | func TestInterceptor_StandardAuth_SetsAuthorizationHeader(t *testing.T) { |
| 192 | interceptor := &Interceptor{key: []byte("key"), sidecarHost: "127.0.0.1:16384"} |
nothing calls this directly
no test coverage detected