Commit Graph

7 Commits

Author SHA1 Message Date
LORDBABUINO 25a0594f74 refactor(api): remove preflight descriptor validation
The Bitcoin Core node is the authority on descriptor validity.
Reimplementing descriptor shape/prefix/checksum checks here creates
a divergence risk with the node's own validator and adds maintenance
surface for no real safety gain. Invalid descriptors now fail at the
node, surfaced through AnalysisError.

- delete api/src/preflight.rs and its module declaration
- drop ValidationError from ApiError (no remaining producers)
- remove the validate() call from the scan handler
- drop the two tests that asserted preflight-specific rejection codes
2026-05-11 20:21:23 -03:00
LORDBABUINO 2dcb2d244c refactor(api): use read_cookie_file in e2e regtest tests
Replace the inline cookie split with stealth_bitcoincore::read_cookie_file,
which already implements the same parsing with proper error handling.
Removes duplication and keeps the cookie format in one place.
2026-05-11 20:19:48 -03:00
LORDBABUINO 446fb9eb45 refactor(api): use match for scan input validation
The if-chain and counter pattern is a 5-arm tuple match in disguise.
Pattern match on (descriptor, descriptors, utxos) directly: every
valid case picks exactly one variant, the empty tuple is a clear
missing-input error, and the wildcard catches mutual-exclusion
violations.
2026-05-11 20:18:52 -03:00
LORDBABUINO ca827db53e feat(api): add permissive CORS layer
Browser-based frontends need CORS to call the API. Apply
tower_http::cors::CorsLayer::permissive() at the router level so
the frontend (and other origins during development) can reach the
scan endpoint.
2026-05-11 20:18:31 -03:00
LORDBABUINO 3ab2fb3c9c refactor(api): drop dead-code cookie loop in detect_cookie_file
The second loop is unreachable: the first loop returns as soon as it
finds an existing candidate. Collapse to a single iterator chain.
2026-05-11 20:17:58 -03:00
Renato Britto 780c3122bd feat(docs): add docs for api package 2026-04-09 17:55:36 -03:00
Renato Britto 720342f880 refactor(api): expand and test api as stealth http interface 2026-04-09 17:55:34 -03:00