Buckets:
AnonymousSpottedToad/candidate_bucket / preliminary /mappings /python /limit_request_rate /kraftaa_transformdash.json
| { | |
| "role_mappings": [ | |
| { | |
| "role": "Entity", | |
| "status": "missing", | |
| "symbol": "", | |
| "file": "", | |
| "lines": "", | |
| "notes": "Requests come from outside clients (browser/HTTP callers). The UI templates/JS (ui/templates/login.html, ui/static/js/*.js) are git-tracked but absent from the checkout, and no other in-repo code (e.g. transformdash-cli.py) calls the rate-limited /api/auth/login or /api/query endpoints." | |
| }, | |
| { | |
| "role": "Enforcer", | |
| "status": "present", | |
| "symbol": "dispatch", | |
| "file": "rate_limiter.py", | |
| "lines": "170", | |
| "notes": "dispatch of RateLimitMiddleware (BaseHTTPMiddleware), registered via app.add_middleware(RateLimitMiddleware) at ui/app.py:122. It derives the client id via get_client_ip (rate_limiter.py:118, X-Forwarded-For only from trusted proxies), matches the path against RATE_LIMITS, calls rate_limiter.is_rate_limited at rate_limiter.py:177 and returns a 429 JSONResponse with Retry-After when blocked, else call_next." | |
| }, | |
| { | |
| "role": "Limiter", | |
| "status": "present", | |
| "symbol": "is_rate_limited", | |
| "file": "rate_limiter.py", | |
| "lines": "42", | |
| "notes": "RateLimiter.is_rate_limited, called by the Enforcer dispatch at rate_limiter.py:177. Fixed-window per (client_ip, endpoint) counter under a thread lock: resets expired windows, blocks when count >= max_requests, otherwise increments. The alternative check_rate_limit dependency (rate_limiter.py:139) is imported in ui/app.py:36 but never used." | |
| }, | |
| { | |
| "role": "HistoryProvider", | |
| "status": "present", | |
| "symbol": "requests", | |
| "file": "rate_limiter.py", | |
| "lines": "36", | |
| "notes": "In-memory dict self.requests in RateLimiter.__init__ ({ip: {endpoint: (count, window_start)}}), read at rate_limiter.py:63 and updated at :67/:76 by is_rate_limited; no dedicated getter method exists, so the field is cited. _cleanup_old_entries (rate_limiter.py:79) prunes entries older than an hour; history is per-process only." | |
| }, | |
| { | |
| "role": "PolicyProvider", | |
| "status": "present", | |
| "symbol": "RATE_LIMITS", | |
| "file": "rate_limiter.py", | |
| "lines": "107", | |
| "notes": "Module constant RATE_LIMITS mapping endpoint patterns to (max_requests, window_seconds), e.g. /api/auth/login 5 per 300s; the Enforcer dispatch iterates it at rate_limiter.py:175 with _matches_pattern (rate_limiter.py:188) and passes the limits to the Limiter. No method retrieves the policy, so the constant is cited." | |
| }, | |
| { | |
| "role": "System", | |
| "status": "present", | |
| "symbol": "login", | |
| "file": "ui/app.py", | |
| "lines": "3935", | |
| "notes": "Handler for POST /api/auth/login (decorator ui/app.py:3934), the first and strictest policy entry in RATE_LIMITS (rate_limiter.py:108); it runs after dispatch calls call_next (rate_limiter.py:185) and authenticates the user and issues a JWT. Other rate-limited handlers include /api/query (ui/app.py:1848) and /api/auth/me (ui/app.py:4003)." | |
| } | |
| ] | |
| } | |
Xet Storage Details
- Size:
- 3.04 kB
- Xet hash:
- 8bda24189bf9b598e38b22a91d850eb38ac5a0dca2955bea7f1723f90d41ac65
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.