Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions cmd/symkerneld/routes.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import (
"github.com/WasmAgent/symkernel/internal/orchestrator"
"github.com/WasmAgent/symkernel/internal/otel"
smthttp "github.com/WasmAgent/symkernel/internal/smthttp"
"github.com/WasmAgent/symkernel/internal/symbolic/taint"
"github.com/WasmAgent/symkernel/internal/verify"
)

Expand All @@ -25,6 +26,7 @@ func RegisterRoutes(mux *http.ServeMux) {
mux.Handle("POST /v1/verify/z3", verify.Handler(&verify.Z3Solver{}))
mux.Handle("POST /v1/verify/criterion", criterion.Handler())
mux.Handle("POST /v1/verify/symbolic", verify.SymbolicHandler())
mux.Handle("POST /v1/verify/taint", taint.Handler())

// Milestone 12: Z3 SMT solver integration.
mux.Handle("POST /v1/verify/smt", smthttp.Handler())
Expand Down
10 changes: 10 additions & 0 deletions cmd/symkerneld/routes_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"encoding/json"
"net/http"
"net/http/httptest"
"strings"
"testing"
)

Expand Down Expand Up @@ -72,4 +73,13 @@ func TestRegisterRoutes(t *testing.T) {
if sbody.Message != "Symbolic execution endpoint placeholder" {
t.Errorf("symbolic message = %q, want %q", sbody.Message, "Symbolic execution endpoint placeholder")
}

// The POST /v1/verify/taint route is mounted: malformed JSON is rejected by
// the taint handler (400) rather than falling through to the mux 404.
treq := httptest.NewRequest(http.MethodPost, "/v1/verify/taint", strings.NewReader("not json"))
trec := httptest.NewRecorder()
mux.ServeHTTP(trec, treq)
if trec.Code != http.StatusBadRequest {
t.Errorf("POST /v1/verify/taint status = %d, want %d; route may not be mounted; body = %s", trec.Code, http.StatusBadRequest, trec.Body.String())
}
}
Loading
Loading