Repository navigation
Commit 38d422f
fix(routes): a document or log path is not an HTTP route literal
Distilled from #1245 by Andrew Hundt (a slice of 0370d52).
detect_url_in_args in the parallel resolver runs for every resolved call
with no callee gating. A first argument like "/new/file.txt" clears
normalize_url_arg (it has a second slash and no whitespace) and then
reaches cbm_service_pattern_is_http_route_literal, whose filesystem
extension list knew about config, key and socket files but not about
documents or logs. So
open_file("/new/file.txt")
read_file("/docs/guide.md")
write_file("/data/app.log")
each minted a Route node and an HTTP_CALLS edge -- the graph reported a
web endpoint where the program opens a file. Five extensions join the
list: .log .md .pdf .rst .txt, alphabetical order preserved.
Two things the tests are careful about, because the obvious fixture
would not have been RED. A bare Python builtin open(...) never resolves
to an indexed target, so it never reaches the URL detector at all; the
bug shows only for calls that resolve to a project symbol, which is what
the fixture defines. And /var/... is already rejected by the filesystem
ROOT list, so the fixture paths start with segments that list does not
know, leaving the extension guard as the only thing that can reject them.
RED before the fix:
infrascan_http_route_literal_guard_rejects_document_extensions
FAIL tests/test_infrascan.c:44:
ASSERT(!(cbm_service_pattern_is_http_route_literal("/new/file.txt", "open")))
pipeline_arg_url_rejects_document_file_paths
FAIL tests/test_pipeline.c:6652:
count_nodes_named(s, project, "/new/file.txt") == 1, expected 0 == 0
The pipeline test keeps a positive control above that line -- a genuine
requests.get("/api/items") still yields its Route node and HTTP_CALLS
edge -- so the guard cannot pass by rejecting everything.
GREEN after: infrascan 4 passed; pipeline 282 passed; extraction
edge_types_probe route_canon 420 passed.
Co-authored-by: Andrew Hundt <ATHundt@gmail.com>
Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>1 parent bedbc0a commit 38d422f
3 files changed
Lines changed: 118 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
752 | 752 | | |
753 | 753 | | |
754 | 754 | | |
755 | | - | |
756 | | - | |
757 | | - | |
| 755 | + | |
| 756 | + | |
| 757 | + | |
758 | 758 | | |
759 | 759 | | |
760 | 760 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
225 | 225 | | |
226 | 226 | | |
227 | 227 | | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
228 | 247 | | |
229 | 248 | | |
230 | 249 | | |
| |||
305 | 324 | | |
306 | 325 | | |
307 | 326 | | |
| 327 | + | |
308 | 328 | | |
309 | 329 | | |
310 | 330 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7517 | 7517 | | |
7518 | 7518 | | |
7519 | 7519 | | |
| 7520 | + | |
| 7521 | + | |
| 7522 | + | |
| 7523 | + | |
| 7524 | + | |
| 7525 | + | |
| 7526 | + | |
| 7527 | + | |
| 7528 | + | |
| 7529 | + | |
| 7530 | + | |
| 7531 | + | |
| 7532 | + | |
| 7533 | + | |
| 7534 | + | |
| 7535 | + | |
| 7536 | + | |
| 7537 | + | |
| 7538 | + | |
| 7539 | + | |
| 7540 | + | |
| 7541 | + | |
| 7542 | + | |
| 7543 | + | |
| 7544 | + | |
| 7545 | + | |
| 7546 | + | |
| 7547 | + | |
| 7548 | + | |
| 7549 | + | |
| 7550 | + | |
| 7551 | + | |
| 7552 | + | |
| 7553 | + | |
| 7554 | + | |
| 7555 | + | |
| 7556 | + | |
| 7557 | + | |
| 7558 | + | |
| 7559 | + | |
| 7560 | + | |
| 7561 | + | |
| 7562 | + | |
| 7563 | + | |
| 7564 | + | |
| 7565 | + | |
| 7566 | + | |
| 7567 | + | |
| 7568 | + | |
| 7569 | + | |
| 7570 | + | |
| 7571 | + | |
| 7572 | + | |
| 7573 | + | |
| 7574 | + | |
| 7575 | + | |
| 7576 | + | |
| 7577 | + | |
| 7578 | + | |
| 7579 | + | |
| 7580 | + | |
| 7581 | + | |
| 7582 | + | |
| 7583 | + | |
| 7584 | + | |
| 7585 | + | |
| 7586 | + | |
| 7587 | + | |
| 7588 | + | |
| 7589 | + | |
| 7590 | + | |
| 7591 | + | |
| 7592 | + | |
| 7593 | + | |
| 7594 | + | |
| 7595 | + | |
| 7596 | + | |
| 7597 | + | |
| 7598 | + | |
| 7599 | + | |
| 7600 | + | |
| 7601 | + | |
| 7602 | + | |
| 7603 | + | |
| 7604 | + | |
| 7605 | + | |
| 7606 | + | |
| 7607 | + | |
| 7608 | + | |
| 7609 | + | |
| 7610 | + | |
| 7611 | + | |
| 7612 | + | |
| 7613 | + | |
7520 | 7614 | | |
7521 | 7615 | | |
7522 | 7616 | | |
| |||
16360 | 16454 | | |
16361 | 16455 | | |
16362 | 16456 | | |
| 16457 | + | |
16363 | 16458 | | |
16364 | 16459 | | |
16365 | 16460 | | |
| |||
0 commit comments