Skip to content

Commit b884649

Browse files
authored
Main CI Fixes (#222)
1 parent 028b44c commit b884649

File tree

2 files changed

+0
-30
lines changed

2 files changed

+0
-30
lines changed

cmd/docker-mcp/catalog/reset_test.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package catalog
22

33
import (
4-
"context"
54
"os"
65
"path/filepath"
76
"testing"

pkg/gateway/auth_test.go

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -228,32 +228,3 @@ func TestFormatBearerToken(t *testing.T) {
228228
t.Errorf("expected result to start with 'Authorization: Bearer ', got %q", result)
229229
}
230230
}
231-
232-
func TestAuthenticationMiddleware_ContainerMode(t *testing.T) {
233-
// Set container environment variable
234-
os.Setenv("DOCKER_MCP_IN_CONTAINER", "1")
235-
defer os.Unsetenv("DOCKER_MCP_IN_CONTAINER")
236-
237-
authToken := "test-token-123"
238-
handler := http.HandlerFunc(func(w http.ResponseWriter, _ *http.Request) {
239-
w.WriteHeader(http.StatusOK)
240-
_, _ = w.Write([]byte("success"))
241-
})
242-
243-
secured := authenticationMiddleware(authToken, handler)
244-
245-
// Should allow request without auth token when in container mode
246-
req := httptest.NewRequest(http.MethodPost, "/mcp", nil)
247-
// No Authorization header
248-
249-
rr := httptest.NewRecorder()
250-
secured.ServeHTTP(rr, req)
251-
252-
if rr.Code != http.StatusOK {
253-
t.Errorf("Expected 200 in container mode, got %d", rr.Code)
254-
}
255-
256-
if rr.Body.String() != "success" {
257-
t.Errorf("Expected 'success', got %q", rr.Body.String())
258-
}
259-
}

0 commit comments

Comments
 (0)