mirror of
https://github.com/elicpeter/nyx.git
synced 2026-07-15 21:11:02 +02:00
Dynamic (#77)
This commit is contained in:
parent
55247b7fcd
commit
991c84a1eb
1464 changed files with 225448 additions and 1985 deletions
29
tests/dynamic_fixtures/stubs_e2e/go/sql/vuln/main.go
Normal file
29
tests/dynamic_fixtures/stubs_e2e/go/sql/vuln/main.go
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
// Phase 10 (Track D.3) stub-end-to-end fixture: Go + SQL.
|
||||
//
|
||||
// Body-only fragment, not a standalone `go run`-able program. The
|
||||
// companion test in `tests/stubs_e2e_per_lang.rs` wraps these lines
|
||||
// in `package main` + the union of stdlib imports required by both
|
||||
// the spliced probe shim and this fragment, places the Go probe
|
||||
// shim ahead of `func main`, and then invokes `go run` on the
|
||||
// resulting file.
|
||||
//
|
||||
// The verifier publishes:
|
||||
//
|
||||
// NYX_SQL_ENDPOINT — absolute path of a SQLite DB the SqlStub owns.
|
||||
// NYX_SQL_LOG — companion log path the harness appends executed
|
||||
// queries to so the host SqlStub picks them up on
|
||||
// drain_events() even when the harness never opens
|
||||
// an on-the-wire driver (no go-sqlite3 / pgx /
|
||||
// mysql dep on the dynamic CI matrix; query
|
||||
// pre-flighted before sql.Open).
|
||||
//
|
||||
// This fragment records the tautology query through the Go shim
|
||||
// helper __nyx_stub_sql_record as `driver = "manual"` so the test
|
||||
// stays stdlib-only — no `database/sql` import, no go.mod driver
|
||||
// dep, no libsqlite3-dev system package. Mirrors the Phase 26
|
||||
// "no live driver available" path that real Go sink callsites take
|
||||
// when the build matrix lacks a driver.
|
||||
query := "SELECT 1 WHERE 'a' = 'a' OR 1=1 --"
|
||||
__nyx_stub_sql_record(query, map[string]string{"driver": "manual"})
|
||||
// Echo so the host can confirm the driver ran end-to-end.
|
||||
fmt.Print(os.Getenv("NYX_SQL_ENDPOINT"))
|
||||
Loading…
Add table
Add a link
Reference in a new issue