host: /api rate limit is easy to hit and shows up as "signed out" in the UI
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 45/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 活跃
- 技术栈
- typescript
调研方向
Start by reading the host's SecurityMiddleware configuration and tracing how 429 responses from /api/auth/get-session reach the UI. Reproduce with bos dev and repeated page loads; the issue names no source files or tests, so locate the middleware and UI handling first. Done means rate limiting no longer creates misleading signed-out or not-found states, with behavior for shared IPs and trusted proxy headers addressed.
由索引模型根据 Issue 内容生成。
描述
The host's SecurityMiddleware (hono-rate-limiter) limits /api/* to RATE_LIMIT_MAX (300) requests per RATE_LIMIT_WINDOW_MS (900000, 15 min) per IP. The key is the first x-forwarded-for entry, else the socket IP, and the store is in-memory.
That's lower than it looks. A nearbuilders.org page load makes about 9 API calls signed out and more signed in, so 20–30 page loads in 15 minutes trips it. bos dev loads the same host bundle, so it hits local dev too, where all traffic comes from 127.0.0.1.
What happens when it trips: /api/auth/get-session returns 429 along with everything else. The UI treats that as no session, so the user looks signed out, and project pages show "Project not found". Nothing says it's a rate limit.
Repro (local):
bos devin nearbuilders.org, sign in.- Click around / reload ~30 times within 15 minutes.
/api/*calls start returning 429; the header shows signed out and project pages say "Project not found".
Other concerns:
- People behind one IP (city node events, offices, conference wifi) share one bucket, so one busy room can lock everyone out.
- The first
x-forwarded-forentry is set by the client, so anyone can pick a fresh key per request and skip the limit. The rightmost entry added by the trusted proxy is the safer one. - In-memory store means the limit is per instance and resets on restart.
Suggestions:
- Raise the default, or key signed-in requests by session/user and fall back to IP only when signed out.
- Exempt
/api/auth/get-session(or give it its own, higher limit). - Handle 429 in the UI: show a "too many requests, try again shortly" message instead of signed-out / not-found states.
- Take the client IP from the trusted proxy hop, not the first
x-forwarded-forvalue. - Document
RATE_LIMIT_MAX/RATE_LIMIT_WINDOW_MSfor local dev (settingRATE_LIMIT_MAX=5000in.envworks around it).
- 主要语言
- TypeScript
- 星标
- 5
- 派生
- 3
- 平均合并
- 9 小时 37 分钟
- 30 天内合并 PR
- 157
环境准备
- 提供 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
NEARBuilders/everything-dev 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 77/100
NEARBuilders/everything-dev#628 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
NEARBuilders/everything-dev#400 ·
维护者通常 1 天内回复
-
enhancement
难度 5/5 一周以上 新手友好度 35/100
NEARBuilders/everything-dev#667 ·
维护者通常 1 天内回复
-
难度 4/5 3-5 天 新手友好度 42/100
NEARBuilders/everything-dev#666 ·
维护者通常 1 天内回复
-
难度 4/5 3-5 天 新手友好度 42/100
NEARBuilders/everything-dev#665 ·
维护者通常 1 天内回复
查看 NEARBuilders/everything-dev 的全部 Issue
相似的 Issue
-
bug triage
难度 2/5 1-3 小时 新手友好度 74/100
维护者通常 1 天内回复
-
hemi-earn
难度 2/5 1-3 小时 新手友好度 82/100
vetro-protocol/vetro-monorepo#1043 ·
维护者通常 1 天内回复
-
stage 2: bare names resolve against PATH differently from the shell (empty and relative entries)未关闭
难度 2/5 1-3 小时 新手友好度 82/100
STRML/omp-classifier#206 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 70/100
atlassian-labs/mermaid-diagrams-viewer#188 ·
维护者通常 1 天内回复
-
dashboard enhancement
难度 2/5 1-3 小时 新手友好度 76/100
Olanetsoft/agent-lookout#225 ·
维护者通常 1 天内回复