Buckets:

download
raw
2.97 kB
{
"role_mappings": [
{
"role": "Entity",
"status": "missing",
"symbol": "",
"file": "",
"lines": "",
"notes": "Callers of the standalone FastAPI API (src/airflow_watcher/api/main.py) are external HTTP clients; no in-repo client targets the API except tests (tests/live/test_qa_deep.py), which do not count."
},
{
"role": "Enforcer",
"status": "present",
"symbol": "dispatch",
"file": "src/airflow_watcher/api/rate_limit.py",
"lines": "34",
"notes": "dispatch of RateLimitMiddleware (Starlette BaseHTTPMiddleware), registered via app.add_middleware(RateLimitMiddleware, max_requests=config.rate_limit_rpm, window_seconds=60) at src/airflow_watcher/api/main.py:273. It derives the client id from X-Forwarded-For or request.client.host (line 39), returns HTTP 429 with Retry-After when over limit (line 51), else call_next; /healthz is exempt. The decision is inline, so Enforcer and Limiter are the same method."
},
{
"role": "Limiter",
"status": "present",
"symbol": "dispatch",
"file": "src/airflow_watcher/api/rate_limit.py",
"lines": "34",
"notes": "Decision is inline in RateLimitMiddleware.dispatch (same method as Enforcer, no smaller helper): under the lock it prunes timestamps older than the window (line 47) and blocks when len(hits) >= self._max (line 49), otherwise records the hit (line 57)."
},
{
"role": "HistoryProvider",
"status": "present",
"symbol": "_hits",
"file": "src/airflow_watcher/api/rate_limit.py",
"lines": "29",
"notes": "Reached from Limiter dispatch (rate_limit.py:47, 49, 57), which reads/prunes/appends per-IP timestamp lists in the in-memory dict self._hits (defaultdict(list)) of RateLimitMiddleware; no accessor method exists, so the field is cited. Per-process only (no shared store); stale IPs purged every 5 min (lines 60-64)."
},
{
"role": "PolicyProvider",
"status": "present",
"symbol": "__init__",
"file": "src/airflow_watcher/api/rate_limit.py",
"lines": "25",
"notes": "RateLimitMiddleware.__init__ sets the policy self._max / self._window, which dispatch uses at rate_limit.py:49-50. Values come from main.py:273 (config.rate_limit_rpm, window 60s); rate_limit_rpm defaults to 120 in StandaloneConfig (src/airflow_watcher/api/standalone_config.py:32) and is overridable via AIRFLOW_WATCHER_RATE_LIMIT_RPM (standalone_config.py:116). Single global policy for all IPs."
},
{
"role": "System",
"status": "present",
"symbol": "get_overview",
"file": "src/airflow_watcher/api/routers/overview.py",
"lines": "38",
"notes": "Representative protected handler reached via call_next in dispatch (rate_limit.py:66); the overview router is mounted under /api/v1 at main.py:402 (all /api/v1 routers, e.g. failures, sla, tasks, are equally behind the middleware)."
}
]
}

Xet Storage Details

Size:
2.97 kB
·
Xet hash:
a7acf5891d70655dfaf87a1f2deef54eb879a756059ec9a9d5163a3778453d17

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