Buckets:

download
raw
2.77 kB
{
"role_mappings": [
{
"role": "Entity",
"status": "missing",
"symbol": "",
"file": "",
"lines": "",
"notes": "Requests come from external HTTP clients outside the repo; no in-repo client targets the rate-limited service API (tests and examples excluded)."
},
{
"role": "Enforcer",
"status": "present",
"symbol": "__call__",
"file": "src/svc_infra/api/fastapi/middleware/ratelimit.py",
"lines": "75",
"notes": "__call__ of pure-ASGI SimpleRateLimitMiddleware, registered by default for every parent/child app in _setup_middlewares (src/svc_infra/api/fastapi/setup.py:225). It derives the key (X-API-Key header or client IP, optionally tenant-scoped), calls store.incr (line 122) and returns a 429 JSON response when over limit, else forwards to self.app (line 185)."
},
{
"role": "Limiter",
"status": "present",
"symbol": "__call__",
"file": "src/svc_infra/api/fastapi/middleware/ratelimit.py",
"lines": "75",
"notes": "Decision is inline in the Enforcer's __call__ (same method as Enforcer): it compares the counter returned by store.incr against eff_limit (`if count > limit`, line 126) and blocks or allows. No smaller helper performs the decision."
},
{
"role": "HistoryProvider",
"status": "present",
"symbol": "incr",
"file": "src/svc_infra/api/fastapi/middleware/ratelimit_store.py",
"lines": "48",
"notes": "Reached from Limiter __call__ via self.store.incr (ratelimit.py:122); default store is InMemoryRateLimitStore (created at ratelimit.py:71), whose incr keeps a per-key (count, window_start) dict and increments/resets it, covering both get_history and update. Alternative RedisRateLimitStore.incr (ratelimit_store.py:91) is opt-in."
},
{
"role": "PolicyProvider",
"status": "present",
"symbol": "__init__",
"file": "src/svc_infra/api/fastapi/middleware/ratelimit.py",
"lines": "44",
"notes": "SimpleRateLimitMiddleware.__init__ holds the policy as self.limit/self.window (defaults 120 requests per 60 s, assigned at line 66) plus optional limit_resolver for per-tenant overrides, read by __call__ at lines 113-119. No dedicated policy-retrieval method exists, so the constructor that sets the policy is cited."
},
{
"role": "System",
"status": "missing",
"symbol": "",
"file": "",
"lines": "",
"notes": "Library repo (rule 7): business routes are mounted by consumer apps outside the repo. The only in-repo handler behind SimpleRateLimitMiddleware is index (src/svc_infra/api/fastapi/setup.py:428), a library utility/docs landing route that is not a protected business System."
}
]
}

Xet Storage Details

Size:
2.77 kB
·
Xet hash:
40f50d2ea27af32f2e27dfcfd75d87612d12eeebd2f01c9297ed2a72b0d12a74

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.