Skip to content

Commit c26b3dc

Browse files
committed
Add integration tests for execution proxy
Comprehensive integration tests covering: - Basic flow: OAuth auth → service connection → token issuance → proxied request - Path restrictions: Verify glob-style allowlisting works correctly - Token expiration: Short-lived tokens (2s) expire and are rejected - Service isolation: Datadog token cannot access Linear service Test infrastructure: - FakeBackendAPI simulates external service (Datadog) on port 9091 - Captures all requests for verification - Returns mock JSON responses Test configuration: - Uses config.execution-proxy-test.json with proxy-enabled datadog service - Points to fake backend and fake service OAuth servers - Uses in-memory storage for fast testing Note: Tests follow existing integration test patterns from oauth_test.go. Could not run tests locally due to Go 1.25 module download network issues. Tests should be run in CI with proper network connectivity.
1 parent 20712d5 commit c26b3dc

File tree

2 files changed

+611
-0
lines changed

2 files changed

+611
-0
lines changed
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
{
2+
"version": "v0.0.1",
3+
"proxy": {
4+
"baseURL": "http://localhost:8080",
5+
"addr": ":8080",
6+
"name": "mcp-front-test",
7+
"auth": {
8+
"kind": "oauth",
9+
"issuer": "http://localhost:8080",
10+
"allowedDomains": ["test.com"],
11+
"allowedOrigins": ["http://localhost:8080"],
12+
"tokenTtl": "1h",
13+
"storage": "memory",
14+
"googleClientId": {"$env": "GOOGLE_CLIENT_ID"},
15+
"googleClientSecret": {"$env": "GOOGLE_CLIENT_SECRET"},
16+
"googleRedirectUri": "http://localhost:8080/oauth/callback",
17+
"jwtSecret": {"$env": "JWT_SECRET"},
18+
"encryptionKey": {"$env": "ENCRYPTION_KEY"}
19+
}
20+
},
21+
"mcpServers": {
22+
"datadog": {
23+
"transportType": "inline",
24+
"requiresUserToken": true,
25+
"userAuthentication": {
26+
"type": "oauth",
27+
"displayName": "Datadog (Test)",
28+
"clientId": {"$env": "DATADOG_CLIENT_ID"},
29+
"clientSecret": {"$env": "DATADOG_CLIENT_SECRET"},
30+
"authorizationUrl": "http://localhost:9092/oauth/authorize",
31+
"tokenUrl": "http://localhost:9092/oauth/token",
32+
"scopes": ["metrics_read", "logs_read"]
33+
},
34+
"proxy": {
35+
"enabled": true,
36+
"baseURL": "http://localhost:9091",
37+
"timeout": 30,
38+
"defaultAllowedPaths": ["/api/v1/**", "/api/v2/**"]
39+
},
40+
"inline": {
41+
"tools": [
42+
{
43+
"name": "query_metrics",
44+
"description": "Query Datadog metrics",
45+
"inputSchema": {
46+
"type": "object",
47+
"properties": {
48+
"query": {"type": "string"}
49+
},
50+
"required": ["query"]
51+
}
52+
}
53+
]
54+
}
55+
}
56+
}
57+
}

0 commit comments

Comments
 (0)