/
hed1ad
/
CloudGuard_API_Security_Platform
Обзор
Документация
Войти
/
hed1ad
/
CloudGuard_API_Security_Platform
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
master
test-api.sh
52 строки
1 KB
hed1ad
1.0.0
26 окт 2025, 14:25
26 окт 2025, 14:25
63b0f76
Код
Авторство
О чём код?
#!/bin/bash echo "==========================================" echo "API Security Scanner - API Test" echo "==========================================" echo "" API_URL="http://localhost:8000/api/v1" # Test 1: Health Check echo "Test 1: Health Check" curl -s http://localhost:8000/health | jq . echo "" # Test 2: Create a scan echo "Test 2: Creating a new scan..." SCAN_RESPONSE=$(curl -s -X POST $API_URL/scans \ -H "Content-Type: application/json" \ -d '{ "target_url": "https://jsonplaceholder.typicode.com", "endpoints": ["/users", "/posts", "/comments"] }') echo $SCAN_RESPONSE | jq . SCAN_ID=$(echo $SCAN_RESPONSE | jq -r '.id') echo "" echo "Scan ID: $SCAN_ID" echo "" # Wait for scan to complete echo "Waiting for scan to complete (this may take 10-30 seconds)..." sleep 15 # Test 3: Get scan details echo "" echo "Test 3: Getting scan details..." curl -s $API_URL/scans/$SCAN_ID | jq . echo "" # Test 4: List all scans echo "" echo "Test 4: Listing all scans..." curl -s $API_URL/scans | jq . echo "" echo "==========================================" echo "Test completed!" echo "==========================================" echo "" echo "You can view the scan in the UI:" echo "http://localhost:3000/scans/$SCAN_ID" echo ""