feat: proxy feedback-scoped admin attachments#2059
Conversation
Co-authored-by: npub1dccv64krpcpse5cmkzfeh998cftungyatw3djt8jwdw6g43f7fyqzzmrf7 <6e30cd56c30e030cd31bb0939b94a7c257c9a09d5ba2d92cf2735da45629f248@sprout-oss.stage.blox.sqprod.co> Signed-off-by: npub1dccv64krpcpse5cmkzfeh998cftungyatw3djt8jwdw6g43f7fyqzzmrf7 <6e30cd56c30e030cd31bb0939b94a7c257c9a09d5ba2d92cf2735da45629f248@sprout-oss.stage.blox.sqprod.co>
wesbillman
left a comment
There was a problem hiding this comment.
Reviewed at 35ebaa9f. The route fails closed across the important boundaries: exact admin host/origin gate, feedback-row lookup, persisted imeta hash plus source-host/path match, host-to-community re-resolution checked against the feedback FK, and tenant-scoped sidecar lookup before shared CAS access. The dashboard no longer receives a reusable Blossom URL or credential; media serving retains safe disposition/CSP/nosniff behavior, while admin middleware forces no-store. Adversarial route/helper coverage is appropriate. Code review approved; merge after the remaining CI jobs complete successfully.
wesbillman
left a comment
There was a problem hiding this comment.
The code is unchanged from the reviewed/approved head and all current checks are green, but approval cannot stand at the merge gate because main moved from merge-base 9f8285095 to 79598bdb3 after this CI run. Please rebase onto current main and let CI rerun; I will re-approve once the rebased head is green. This is a freshness gate, not a new code finding.
Summary
GET/HEAD /api/admin/v1/feedback/:id/attachments/:sha256endpointimetahash/source URLSecurity model
The request supplies only a feedback ID and lowercase SHA-256. The server loads the feedback row, derives its tenant and community from persisted provenance, requires the hash to match both the
imetaxfield and exact source-community media URL, verifies the resolved community ID, then reuses tenant-scoped media sidecar/blob serving. A known or existing but unreferenced hash is insufficient. There is no generic admin media route or browser bearer credential.The endpoint retains the dashboard's existing WARP/private-ingress plus exact admin Host boundary. It does not add per-human operator identity. Existing community
/media/*GET/HEAD authorization andBUZZ_REQUIRE_MEDIA_GET_AUTHremain unchanged.Validation
cargo test -p buzz-relay api::admin::tests::feedback_attachment— 7 passedcargo test -p buzz-relay api::media::tests::media_get_auth_flag_on_rejects_unauthenticated_get_and_head_before_sidecar_gate— passedcargo check -p buzz-relay— passed before rebase; focused Rust tests passed after rebasepnpm checkinadmin-web— passedpnpm test:e2einadmin-web— 8 passedflutteris unavailable, so the already validated push used--no-verify