feat: bundle push rate limiting and abuse defense (issue #49 phase 4)
- MusehubDailyPushBytes: per-user daily byte counter table, upserted at bundle-presign; resets each calendar day (PK: identity_id + date) - MusehubPushAnomaly: anomaly record table for >10x rolling-average spikes - record_bundle_bytes_uploaded: UPSERT helper with ON CONFLICT increment - check_push_anomaly: computes 30-day rolling average, inserts anomaly row and logs WARNING when today's upload is >10x average; never rejects - bundle-presign route: enforces daily limit (429 with 'daily' in detail); limit disabled when bundle_daily_upload_limit_bytes=0; per-user not global - GET /api/caps: public endpoint returning max_bundle_bytes, daily_upload_limit_bytes, max_commits_per_push, max_objects_per_push - 15 TDD tests in test_bundle_rate_limiting_phase4.py: all green
0 comments
muse hub commit comment sha256:29f2935a56feb415c441b14c6a891ec69e63cf5677ea7cb089b7770b2d2c078e --body "your comment"
No comments yet. Be the first to start the discussion.