Commit b9fd669
fix(secrets): address second-round Rust PR review feedback on #624
- `AdoAwMarkerExtension`: neutralise `##vso[` and `##[` logging-command
prefixes in the source path before embedding it in the marker step's
runtime `echo` line. Without this, a markdown filename like
`agents/##vso[task.setvariable variable=FOO]value.md` would echo a
literal `##vso[...]` sequence that the ADO build agent's stdout
scanner treats as a task command — a logging-command-injection
primitive any attacker controlling a filename could trigger. New
`sanitize_for_vso_logging` helper mirrors the existing convention in
`crate::agent_stats::sanitize_for_markdown` (`[vso-filtered][` /
`[filtered][`). The `# ado-aw-metadata:` JSON line keeps the raw
value (it's a YAML comment, not echoed to stdout). Two new tests:
the sanitiser unit test and an end-to-end attack-payload roundtrip
asserting the echo line is neutralised.
- `resolve_definitions_via_discovery`: the previous skip-counter
implementation counted `UnknownRequiredParams` / `Forbidden` /
`PreviewFailed` failures *before* applying `source_filter`, so under
`--source agents/foo.md` the warnings would tell the user "N
definitions skipped requiring template parameters" for definitions
that had nothing to do with `agents/foo.md`. Split the counting:
* without `--source`: per-status counts are honest (we're operating
on every ado-aw pipeline) and the existing three warnings stand;
* with `--source`: a single conservative `uninspectable` counter,
surfaced as one warning that explicitly acknowledges we can't tell
whether any of those skipped definitions would have been consumers
of the filtered template.
- `src/ado/discovery.rs`: drop the file-level `#![allow(dead_code)]`.
`resolve_definitions_via_discovery` and `discovered_to_matched` are
now wired into `secrets.rs`; the suppression was hiding future
dead-code regressions. Build is clean without it.
- `src/main.rs` (`SecretsCmd`): clarified `--source` help text — calls
out that **without `--all-repos`, only the current repository is
searched**. Saves the user-confusion case "I ran `secrets set
GITHUB_TOKEN --source agents/foo.md` and got zero results" when
they're in a different repo than the consumer pipelines.
All 1743 tests pass; clippy clean on touched files.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>1 parent 862707e commit b9fd669
3 files changed
Lines changed: 140 additions & 24 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
34 | | - | |
35 | | - | |
36 | 34 | | |
37 | 35 | | |
38 | 36 | | |
| |||
509 | 507 | | |
510 | 508 | | |
511 | 509 | | |
512 | | - | |
513 | | - | |
514 | | - | |
515 | | - | |
516 | | - | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
517 | 526 | | |
518 | 527 | | |
519 | 528 | | |
| |||
527 | 536 | | |
528 | 537 | | |
529 | 538 | | |
| 539 | + | |
530 | 540 | | |
531 | 541 | | |
532 | 542 | | |
533 | 543 | | |
534 | | - | |
535 | | - | |
536 | | - | |
537 | | - | |
538 | | - | |
| 544 | + | |
| 545 | + | |
| 546 | + | |
| 547 | + | |
| 548 | + | |
| 549 | + | |
| 550 | + | |
| 551 | + | |
| 552 | + | |
| 553 | + | |
| 554 | + | |
| 555 | + | |
| 556 | + | |
| 557 | + | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
| 565 | + | |
| 566 | + | |
| 567 | + | |
| 568 | + | |
539 | 569 | | |
540 | | - | |
541 | | - | |
| 570 | + | |
| 571 | + | |
542 | 572 | | |
543 | 573 | | |
544 | 574 | | |
| |||
561 | 591 | | |
562 | 592 | | |
563 | 593 | | |
| 594 | + | |
| 595 | + | |
| 596 | + | |
| 597 | + | |
| 598 | + | |
| 599 | + | |
| 600 | + | |
| 601 | + | |
| 602 | + | |
564 | 603 | | |
565 | 604 | | |
566 | 605 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
69 | 69 | | |
70 | 70 | | |
71 | 71 | | |
72 | | - | |
73 | | - | |
74 | | - | |
75 | | - | |
76 | | - | |
77 | | - | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
78 | 87 | | |
79 | 88 | | |
80 | 89 | | |
| |||
97 | 106 | | |
98 | 107 | | |
99 | 108 | | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
100 | 118 | | |
101 | 119 | | |
102 | 120 | | |
| |||
207 | 225 | | |
208 | 226 | | |
209 | 227 | | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
210 | 284 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
70 | 70 | | |
71 | 71 | | |
72 | 72 | | |
73 | | - | |
74 | | - | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
75 | 76 | | |
76 | 77 | | |
77 | 78 | | |
| |||
93 | 94 | | |
94 | 95 | | |
95 | 96 | | |
96 | | - | |
| 97 | + | |
| 98 | + | |
97 | 99 | | |
98 | 100 | | |
99 | 101 | | |
| |||
116 | 118 | | |
117 | 119 | | |
118 | 120 | | |
119 | | - | |
| 121 | + | |
| 122 | + | |
120 | 123 | | |
121 | 124 | | |
122 | 125 | | |
| |||
0 commit comments