Add tiered LOTL mining onion and fleet recon so agents can fallback across execution tiers while operators see spread and vuln posture in Crucible. Includes triple-onion chain, spread cred graph, and full Go/TS/E2E test validation.
This commit is contained in:
30
server/internal/api/vuln_handler_test.go
Normal file
30
server/internal/api/vuln_handler_test.go
Normal file
@@ -0,0 +1,30 @@
|
||||
package api
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"net/http"
|
||||
"net/http/httptest"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestVulnCatalogEndpoint(t *testing.T) {
|
||||
h := NewVulnHandler()
|
||||
req := httptest.NewRequest(http.MethodGet, "/api/v1/vuln/catalog", nil)
|
||||
w := httptest.NewRecorder()
|
||||
h.Catalog(w, req)
|
||||
if w.Code != http.StatusOK {
|
||||
t.Fatalf("status %d", w.Code)
|
||||
}
|
||||
var body struct {
|
||||
Catalog []struct {
|
||||
ID string `json:"id"`
|
||||
} `json:"catalog"`
|
||||
Source string `json:"source"`
|
||||
}
|
||||
if err := json.Unmarshal(w.Body.Bytes(), &body); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if body.Source != "embedded" || len(body.Catalog) < 10 {
|
||||
t.Fatalf("unexpected catalog response: %+v", body)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user