Repository navigation
Commit a952534
committed
fix(media): address copilot review — fail-closed h-tag, test literals, ACL logging
- error.rs: add InvalidTag variant -> 400 Bad Request for malformed h tag
- upload.rs: extract_channel_id now Result<Option<Uuid>, MediaError>,
fails on any present-but-invalid h (missing value, parse fail, nil,
multiple conflicting UUIDs) instead of silently downgrading to unbound.
Updated 3 call sites (process_upload, process_file_upload,
process_video_upload) to propagate with ?. Fixes P0 data-leak where
typo h would over-share as relay-gated.
- upload.rs: fix 2 test BlobMeta literals (test_build_descriptor_* ) to
include channel_id: None — cargo test now builds (was E0063).
- media.rs: enforce_media_channel_acl now logs before collapsing to 404:
debug for expected ChannelNotFound/not-member, warn + buzz_media_channel_acl_db_errors_total counter for DB errors. Keeps wire 404 for anti-probing.
Addresses Copilot feedback on PR 5185 (4 comments). cargo check --tests and cargo test -p buzz-media (108 passed) ok.
Signed-off-by: Mert Cetin <[email protected]>1 parent 8805e2a commit a952534
3 files changed
Lines changed: 79 additions & 14 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| 21 | + | |
| 22 | + | |
21 | 23 | | |
22 | 24 | | |
23 | 25 | | |
| |||
151 | 153 | | |
152 | 154 | | |
153 | 155 | | |
| 156 | + | |
154 | 157 | | |
155 | 158 | | |
156 | 159 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
26 | | - | |
27 | | - | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
28 | 32 | | |
| 33 | + | |
| 34 | + | |
29 | 35 | | |
30 | 36 | | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
36 | 50 | | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
37 | 54 | | |
38 | 55 | | |
39 | 56 | | |
40 | | - | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
41 | 64 | | |
42 | 65 | | |
43 | 66 | | |
| |||
235 | 258 | | |
236 | 259 | | |
237 | 260 | | |
238 | | - | |
| 261 | + | |
239 | 262 | | |
240 | 263 | | |
241 | 264 | | |
| |||
281 | 304 | | |
282 | 305 | | |
283 | 306 | | |
284 | | - | |
| 307 | + | |
285 | 308 | | |
286 | 309 | | |
287 | 310 | | |
| |||
331 | 354 | | |
332 | 355 | | |
333 | 356 | | |
334 | | - | |
| 357 | + | |
335 | 358 | | |
336 | 359 | | |
337 | 360 | | |
| |||
631 | 654 | | |
632 | 655 | | |
633 | 656 | | |
| 657 | + | |
634 | 658 | | |
635 | 659 | | |
636 | 660 | | |
| |||
689 | 713 | | |
690 | 714 | | |
691 | 715 | | |
| 716 | + | |
692 | 717 | | |
693 | 718 | | |
694 | 719 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
534 | 534 | | |
535 | 535 | | |
536 | 536 | | |
537 | | - | |
| 537 | + | |
| 538 | + | |
| 539 | + | |
538 | 540 | | |
539 | 541 | | |
540 | 542 | | |
541 | 543 | | |
542 | | - | |
| 544 | + | |
| 545 | + | |
| 546 | + | |
| 547 | + | |
| 548 | + | |
| 549 | + | |
| 550 | + | |
| 551 | + | |
| 552 | + | |
| 553 | + | |
| 554 | + | |
| 555 | + | |
| 556 | + | |
| 557 | + | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
| 565 | + | |
543 | 566 | | |
544 | 567 | | |
545 | 568 | | |
546 | 569 | | |
547 | 570 | | |
548 | 571 | | |
549 | | - | |
| 572 | + | |
| 573 | + | |
| 574 | + | |
| 575 | + | |
| 576 | + | |
| 577 | + | |
| 578 | + | |
| 579 | + | |
| 580 | + | |
| 581 | + | |
550 | 582 | | |
| 583 | + | |
| 584 | + | |
| 585 | + | |
| 586 | + | |
| 587 | + | |
551 | 588 | | |
552 | 589 | | |
553 | 590 | | |
| |||
0 commit comments