security(phase-1): bundle push size gates
Three gates, zero trust:
1. presign rejects size_bytes > bundle_max_bytes → 413 Fires before the presigned URL is issued.
2. unpack-bundle rejects wire_bytes > bundle_max_bytes → 422 Defends against direct MinIO PUT bypassing presign.
3. unpack-bundle rejects commits_count / objects_count above caps → 422 Bounds client-supplied logging inputs; prevents absurd allocations in the background worker.
All caps live in Settings (config.py) — tunable per environment: bundle_max_bytes = 512 MB bundle_max_commits = 100k bundle_max_objects = 1M
TDD: test_bundle_size_gates.py — 6 tests green.
sha256:9076f2e667fe458121f908717e4d396f07e4b29a1fefb082ec0bda6cd45109b3
sha
+25
~4
symbols
sha256:133bfe57e5842bbe6057a2e79bd59a92d8535e3ca70c08983d9f75d51dbc878d
snapshot
+25
symbols added
~4
symbols modified
0
dead code introduced
Semantic Changes
29 symbols
+
test_presign_accepts_bundle_at_limit
function
async_function test_presign_accepts_bundle_at_limit L104–129
+
test_presign_rejects_oversized_bundle
function
async_function test_presign_rejects_oversized_bundle L74–100
+
test_unpack_bundle_accepts_counts_at_limit
function
async_function test_unpack_bundle_accepts_counts_at_limit L239–280
+
test_unpack_bundle_rejects_absurd_commits_count
function
async_function test_unpack_bundle_rejects_absurd_commits_count L183–207
+
test_unpack_bundle_rejects_absurd_objects_count
function
async_function test_unpack_bundle_rejects_absurd_objects_count L211–235
+
test_unpack_bundle_rejects_oversized_wire_bytes
function
async_function test_unpack_bundle_rejects_oversized_wire_bytes L135–177
~
Settings
0 comments
To add a comment, use the Muse CLI:
muse hub commit comment sha256:9076f2e667fe458121f908717e4d396f07e4b29a1fefb082ec0bda6cd45109b3 --body "your comment"
No comments yet. Be the first to start the discussion.