fix: isolate Snowball replication trust per entry

Evaluate PutObject and ReplicateObject permissions with immutable per-entry request snapshots during concurrent Snowball extraction. Preserve the first API error without sharing mutable handler state, and cover prefix-scoped trust under the race detector.

Signed-off-by: Feng Ruohang <rh@vonng.com>
This commit is contained in:
Feng Ruohang
2026-09-01 23:45:02 +08:00
parent c9ad746732
commit ff44527a3c
4 changed files with 207 additions and 21 deletions
+2 -4
View File
@@ -106,11 +106,9 @@ func hasReplicationRequestHeaders(h http.Header) bool {
}
func cloneRequestWithoutReplicationHeaders(r *http.Request, ctx context.Context) *http.Request {
clone := new(http.Request)
*clone = *r
clone.Header = r.Header.Clone()
clone := r.Clone(ctx)
stripReplicationRequestHeaders(clone.Header)
return clone.WithContext(ctx)
return clone
}
// applyReplicationTrust binds the handler context to the effective request.