ProjectTech4DevAI / ProjectTech4DevAI/kaapi-backend
Security: Introduce rate limit per endpoint
まだ誰も着手していません。
- 主要言語
- Python
- スター
- 18
- フォーク
- 10
- 平均マージ
- 2日 20時間
- マージ済み PR(30日)
- 14
説明
Describe the current behavior
Currently, Kaapi API endpoints have no rate limiting implemented. Any user or organization can make unlimited requests to any endpoint without restrictions. This creates several issues:
- A single user or organization can overwhelm the API with requests, consuming server resources and degrading performance for other users
- There's no protection against accidental or malicious misuse, such as runaway scripts or bot activity
- Celery operations like document uploads with provider integration or collection creation can cause celery job queue bloating
Describe the enhancement you'd like
Implement api level rate limiting across relevant API routes to ensure fair resource allocation and prevent misuse. The rate limiting should be conditional based on if it is a celery job endpoint or not. celery job endpoints such as collection creation, llm calls, etc should have lower number of api calls allowed per minute as compared to non celery job endpoints such as credential, onboarding, etc which can have higher number of api calls allowed per minute.
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
まず API ルートの定義と Celery を利用するエンドポイントを特定し、次に各レート制限を適用すべき操作を洗い出します。実装前に、1 分あたりのしきい値とレート制限の仕組みを明確にします。Celery エンドポイントと非 Celery エンドポイントでリクエストが異なる方法で制限され、キューまたはリソースの過負荷が防止されれば完了です。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- python
- 領域
- api, backend-api-design, performance, security
- issue の種類
- 機能追加
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 活発さ
- 静か
- 明瞭さ
- 説明が足りない
- 初心者へのやさしさ
- 35/100