Buckets:
AnonymousSpottedToad/candidate_bucket / preliminary /mappings /python /limit_request_rate /luxman89_TradeArena.json
| { | |
| "role_mappings": [ | |
| { | |
| "role": "Entity", | |
| "status": "present", | |
| "symbol": "emit", | |
| "file": "sdk/client.py", | |
| "lines": "112", | |
| "notes": "In-repo SDK client (TradeArenaClient.emit) POSTs to {base_url}/signal with an X-API-Key header via httpx (sdk/client.py:126-130); this request passes through the traced Enforcer RateLimitMiddleware.dispatch (per-key and per-IP limits)." | |
| }, | |
| { | |
| "role": "Enforcer", | |
| "status": "present", | |
| "symbol": "dispatch", | |
| "file": "src/tradearena/api/rate_limit.py", | |
| "lines": "150", | |
| "notes": "dispatch of RateLimitMiddleware (Starlette BaseHTTPMiddleware), registered via app.add_middleware(RateLimitMiddleware) at src/tradearena/api/main.py:661. It derives the id (client IP via _client_ip, SHA-256 of x-api-key), calls self._check (lines 159, 174, 189) for auth/key/IP layers and returns HTTP 429 when blocked, else call_next (line 197)." | |
| }, | |
| { | |
| "role": "Limiter", | |
| "status": "present", | |
| "symbol": "_check", | |
| "file": "src/tradearena/api/rate_limit.py", | |
| "lines": "127", | |
| "notes": "Called from dispatch (rate_limit.py:159/174/189); sliding-window decision returning (allowed, remaining): prunes old hits, compares count to rate, appends the new hit. Uses _redis_check (line 65) only when REDIS_URL is set; default (no REDIS_URL) is the in-memory branch." | |
| }, | |
| { | |
| "role": "HistoryProvider", | |
| "status": "present", | |
| "symbol": "_hits", | |
| "file": "src/tradearena/api/rate_limit.py", | |
| "lines": "123", | |
| "notes": "Reached from _check (mem_store[key] at line 143, prune at 144, append at 147); in-memory defaultdict of per-IP request timestamps, with sibling stores _key_hits/_auth_hits (lines 124-125). No dedicated get/update method exists, so the field is cited; optional Redis sorted-set store via _redis_check (line 65) when REDIS_URL is set." | |
| }, | |
| { | |
| "role": "PolicyProvider", | |
| "status": "present", | |
| "symbol": "__init__", | |
| "file": "src/tradearena/api/rate_limit.py", | |
| "lines": "105", | |
| "notes": "RateLimitMiddleware.__init__ sets the rate/window policies (rate, key_rate, auth_rate and windows) from module constants DEFAULT_RATE/KEY_RATE/AUTH_RATE (rate_limit.py:19-28); dispatch selects the applicable policy per path/key (_AUTH_PATHS line 34) and passes it to _check." | |
| }, | |
| { | |
| "role": "System", | |
| "status": "present", | |
| "symbol": "emit_signal", | |
| "file": "src/tradearena/api/routes/signals.py", | |
| "lines": "31", | |
| "notes": "POST /signal handler reached via call_next in dispatch (rate_limit.py:197) when the limits pass; it is the target of the SDK emit call. It additionally applies a per-creator SignalRateLimiter.check (signals.py:42, rate_limit.py:214) as a second limiter." | |
| } | |
| ] | |
| } | |
Xet Storage Details
- Size:
- 2.83 kB
- Xet hash:
- 4e496db3c560dc21d4f8874848a300d2d576a118a525baa5ff580d1343249b93
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.