Skip to content

Commit 1d1b5c9

Browse files
committed
docs: fix stale rate-limiting description in InfraLens dev docs
Still described the pre-Upstash in-memory limiter (1 req/30s) — migrated to the shared Upstash-backed policy in v1.5.0 but never updated here.
1 parent ceda416 commit 1d1b5c9

1 file changed

Lines changed: 14 additions & 6 deletions

File tree

docs/infralens/README.md

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ flowchart LR
3535
end
3636
subgraph "Next.js server (this repo)"
3737
SA["Server Action\nrunInfraChecks()"]
38-
RL["Rate limiter\n(per-IP, in-memory)"]
38+
RL["Rate limiter\n(Upstash, shared policy)"]
3939
SSRF["Target validation\n(SSRF guard, DNS pinning)"]
4040
Checks["20 checks\n(concurrency-limited pool)"]
4141
Score["Scoring + recommendations"]
@@ -107,7 +107,7 @@ src/infralens/
107107
│ ├── compare/ # Report diffing + Markdown export
108108
│ ├── history/ # Local history storage (versioned format)
109109
│ ├── recommendations/
110-
│ ├── concurrency.ts, rate-limit.ts
110+
│ ├── concurrency.ts # Bounded-concurrency check pool
111111
├── hooks/use-analysis-history.ts
112112
├── config/{constants,env,site-config}.ts
113113
└── components/
@@ -172,10 +172,14 @@ analysis-wide deadline (`ANALYSIS_TIMEOUT_MS`, 20s) as the analysis
172172
progresses; checks run through a bounded concurrency pool
173173
(`MAX_CONCURRENT_CHECKS`, 6) instead of unbounded `Promise.all`.
174174

175-
Rate limiting is in-memory, per-IP, 1 request/30s — sufficient for a
176-
single-instance deployment, not yet a hard guarantee under horizontal
177-
scaling. See [`SECURITY.md`](SECURITY.md) for how to report a
178-
vulnerability.
175+
Rate limiting is per-IP, via the shared Upstash-backed limiter
176+
(`src/lib/rate-limit/`, policy `"infralens"`: 5 requests/minute burst, 30/
177+
hour) — a real cross-instance guarantee once Redis is configured, not an
178+
in-memory approximation. Without `UPSTASH_REDIS_REST_URL`/
179+
`UPSTASH_REDIS_REST_TOKEN` (local dev, CI), it runs allow-all instead of
180+
blocking real usage; a genuine backend error fails closed rather than
181+
silently letting requests through. See [`SECURITY.md`](SECURITY.md) for
182+
how to report a vulnerability.
179183

180184
## DNS and TLS
181185

@@ -238,6 +242,10 @@ NEXT_PUBLIC_SITE_URL=
238242
Validated once at module load (`src/infralens/config/env.ts`) — consumers
239243
read the parsed `env` object instead of `process.env` directly.
240244

245+
Rate limiting is configured separately, shared with the rest of the repo
246+
(`UPSTASH_REDIS_REST_URL`, `UPSTASH_REDIS_REST_TOKEN`) — see the root
247+
[`README.md`](../../README.md#environment-variables).
248+
241249
## Development
242250

243251
InfraLens uses the same toolchain as the rest of the repository — see the

0 commit comments

Comments
 (0)