-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_api_auth.sh
More file actions
executable file
·37 lines (29 loc) · 974 Bytes
/
Copy pathtest_api_auth.sh
File metadata and controls
executable file
·37 lines (29 loc) · 974 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/bin/bash
echo "=== API Key Authentication Test ==="
echo ""
echo "1. Testing without API key (should fail):"
curl -i http://localhost:8081/health
echo ""
echo ""
echo "2. Testing with correct API key (should succeed):"
curl -i -H "X-API-Key: ${API_KEY:-your-api-key}" http://localhost:8081/health
echo ""
echo ""
echo "3. Testing with wrong API key (should fail):"
curl -i -H "X-API-Key: wrong-key" http://localhost:8081/health
echo ""
echo ""
echo "4. Testing case sensitivity (should fail):"
curl -i -H "x-api-key: ${API_KEY:-your-api-key}" http://localhost:8081/health
echo ""
echo ""
echo "5. Testing MCP endpoint with correct API key:"
curl -i -H "X-API-Key: ${API_KEY:-your-api-key}" http://localhost:8081/mcp-info
echo ""
echo ""
echo "6. Testing root endpoint with correct API key:"
curl -i -H "X-API-Key: ${API_KEY:-your-api-key}" http://localhost:8081/
echo ""
echo ""
echo "=== Current API key in container ==="
docker-compose exec app printenv API_KEY