Commit 709fa2c
authored
fix(secrets): address fourth-round Rust PR review feedback on #624
- `normalize_repo_url`: percent-decode before comparing, so a project
named "My Project" matches whether ADO returns the encoded form
(`My%20Project`) or the decoded form. The previous implementation
assumed ADO always returns percent-encoded URLs; that assumption is
documented in code now and the comparison is encoding-independent.
New unit tests cover the encoded/decoded equivalence and the
case-insensitive/trailing-slash behaviour.
- `discovered_to_matched`: stop silently truncating consumers that
include multiple ado-aw templates. The `yaml_path` field used by
`print_matched_summary` now joins every marker source with `, ` so
e.g. `agents/a.md, agents/b.md` shows up honestly in the CLI
summary. New unit test asserts both sources are surfaced.
- `##vso[` defence-in-depth: the marker step's runtime echo already
neutralises `##vso[` and `##[` prefixes, but the same raw source
string was flowing through `MarkerMetadata` -> `MatchedDefinition::yaml_path`
-> `print_matched_summary` (which writes to stdout). When the CLI
is invoked from inside an ADO pipeline step, the agent's stdout
scanner would still pick up an attacker-controlled `##vso[...]`
payload. New `sanitize_for_vso_logging` helper in the discovery
module applies the same convention (`##vso[` -> `[vso-filtered][`,
`##[` -> `[filtered][`) when building the `yaml_path`. New unit test
asserts the sanitisation.
- `ADO_AW_PREVIEW_CONCURRENCY=0` now emits a `warn!` before clamping
to 1, instead of silently masking the typo. Operators who set `=0`
will see the warning and can correct the env value rather than
wondering why their concurrency tuning had no effect.
- New unit test for the `--source` + no-git-remote bail in
`secrets::resolve_for_command`: previously the helpful "no Azure
DevOps git remote was detected; try --all-repos" error path was
untested. Now asserted via a `tokio::test` that constructs an empty
AdoContext and verifies the error message contains both the cause
and the suggested mitigation.
All 1753 tests pass; clippy clean on touched files.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: jamesadevine <4742697+jamesadevine@users.noreply.github.com>1 parent d3c23c3 commit 709fa2c
2 files changed
Lines changed: 204 additions & 14 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
241 | 241 | | |
242 | 242 | | |
243 | 243 | | |
244 | | - | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
245 | 249 | | |
246 | | - | |
247 | | - | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
248 | 262 | | |
249 | 263 | | |
250 | 264 | | |
| |||
310 | 324 | | |
311 | 325 | | |
312 | 326 | | |
313 | | - | |
314 | | - | |
315 | | - | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
316 | 344 | | |
317 | | - | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
318 | 349 | | |
319 | 350 | | |
320 | 351 | | |
| |||
518 | 549 | | |
519 | 550 | | |
520 | 551 | | |
| 552 | + | |
| 553 | + | |
| 554 | + | |
| 555 | + | |
| 556 | + | |
| 557 | + | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
| 565 | + | |
| 566 | + | |
| 567 | + | |
| 568 | + | |
| 569 | + | |
| 570 | + | |
| 571 | + | |
| 572 | + | |
521 | 573 | | |
522 | 574 | | |
523 | 575 | | |
524 | 576 | | |
525 | | - | |
526 | | - | |
527 | | - | |
528 | | - | |
529 | | - | |
530 | | - | |
531 | | - | |
| 577 | + | |
532 | 578 | | |
533 | 579 | | |
534 | 580 | | |
535 | 581 | | |
| 582 | + | |
| 583 | + | |
| 584 | + | |
| 585 | + | |
| 586 | + | |
| 587 | + | |
| 588 | + | |
| 589 | + | |
| 590 | + | |
| 591 | + | |
| 592 | + | |
536 | 593 | | |
537 | 594 | | |
538 | 595 | | |
| |||
915 | 972 | | |
916 | 973 | | |
917 | 974 | | |
| 975 | + | |
| 976 | + | |
| 977 | + | |
| 978 | + | |
| 979 | + | |
| 980 | + | |
| 981 | + | |
| 982 | + | |
| 983 | + | |
| 984 | + | |
| 985 | + | |
| 986 | + | |
| 987 | + | |
| 988 | + | |
| 989 | + | |
| 990 | + | |
| 991 | + | |
| 992 | + | |
| 993 | + | |
| 994 | + | |
| 995 | + | |
| 996 | + | |
| 997 | + | |
| 998 | + | |
| 999 | + | |
| 1000 | + | |
| 1001 | + | |
| 1002 | + | |
| 1003 | + | |
| 1004 | + | |
| 1005 | + | |
| 1006 | + | |
| 1007 | + | |
| 1008 | + | |
| 1009 | + | |
| 1010 | + | |
| 1011 | + | |
| 1012 | + | |
| 1013 | + | |
| 1014 | + | |
| 1015 | + | |
| 1016 | + | |
| 1017 | + | |
| 1018 | + | |
| 1019 | + | |
| 1020 | + | |
| 1021 | + | |
| 1022 | + | |
| 1023 | + | |
| 1024 | + | |
| 1025 | + | |
| 1026 | + | |
| 1027 | + | |
| 1028 | + | |
| 1029 | + | |
| 1030 | + | |
| 1031 | + | |
| 1032 | + | |
| 1033 | + | |
| 1034 | + | |
| 1035 | + | |
| 1036 | + | |
| 1037 | + | |
| 1038 | + | |
| 1039 | + | |
| 1040 | + | |
| 1041 | + | |
| 1042 | + | |
| 1043 | + | |
| 1044 | + | |
| 1045 | + | |
| 1046 | + | |
| 1047 | + | |
| 1048 | + | |
| 1049 | + | |
| 1050 | + | |
| 1051 | + | |
| 1052 | + | |
| 1053 | + | |
| 1054 | + | |
| 1055 | + | |
| 1056 | + | |
| 1057 | + | |
| 1058 | + | |
| 1059 | + | |
| 1060 | + | |
| 1061 | + | |
| 1062 | + | |
| 1063 | + | |
| 1064 | + | |
| 1065 | + | |
918 | 1066 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
704 | 704 | | |
705 | 705 | | |
706 | 706 | | |
| 707 | + | |
| 708 | + | |
| 709 | + | |
| 710 | + | |
| 711 | + | |
| 712 | + | |
| 713 | + | |
| 714 | + | |
| 715 | + | |
| 716 | + | |
| 717 | + | |
| 718 | + | |
| 719 | + | |
| 720 | + | |
| 721 | + | |
| 722 | + | |
| 723 | + | |
| 724 | + | |
| 725 | + | |
| 726 | + | |
| 727 | + | |
| 728 | + | |
| 729 | + | |
| 730 | + | |
| 731 | + | |
| 732 | + | |
| 733 | + | |
| 734 | + | |
| 735 | + | |
| 736 | + | |
| 737 | + | |
| 738 | + | |
| 739 | + | |
| 740 | + | |
| 741 | + | |
| 742 | + | |
| 743 | + | |
| 744 | + | |
| 745 | + | |
| 746 | + | |
| 747 | + | |
| 748 | + | |
707 | 749 | | |
708 | 750 | | |
709 | 751 | | |
| |||
0 commit comments