[PR #2112] [MERGED] refactor: Extract ratelimiter into separate plugin #1984

Closed
opened 2026-03-02 12:00:03 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/karakeep-app/karakeep/pull/2112
Author: @MohamedBassem
Created: 11/9/2025
Status: Merged
Merged: 11/9/2025
Merged by: @MohamedBassem

Base: mainHead: claude/extract-ratelimiter-plugin-011CUwC9u7ysUAYLVrZEWTJv


📝 Commits (9)

  • f4496ae refactor(trpc): extract rate limiter into dedicated plugin
  • 13fab1f refactor(plugins): decouple rate limiter from tRPC
  • 9f116b2 refactor(plugins): integrate rate limiter with plugin registry
  • 00c31bc refactor(trpc): move rate limit middleware to trpc package
  • b806f96 refactor(plugins): rename to ratelimit-memory and add tests
  • a0ecd37 change the api to only take the key
  • cbc7419 move the serverConfig check to the trpc
  • 4741cc6 fix lockfile
  • 17a0612 get rid of the timer

📊 Changes

12 files changed (+451 additions, -75 deletions)

View changed files

📝 packages/plugins/package.json (+1 -0)
packages/plugins/ratelimit-memory/index.ts (+13 -0)
packages/plugins/ratelimit-memory/src/index.test.ts (+253 -0)
packages/plugins/ratelimit-memory/src/index.ts (+86 -0)
📝 packages/shared-server/src/plugins.ts (+1 -0)
📝 packages/shared/plugins.ts (+4 -0)
packages/shared/ratelimiting.ts (+38 -0)
📝 packages/trpc/index.ts (+3 -3)
packages/trpc/lib/rateLimit.ts (+48 -0)
📝 packages/trpc/package.json (+1 -0)
packages/trpc/rateLimit.ts (+0 -72)
📝 pnpm-lock.yaml (+3 -0)

📄 Description

No description provided


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/karakeep-app/karakeep/pull/2112 **Author:** [@MohamedBassem](https://github.com/MohamedBassem) **Created:** 11/9/2025 **Status:** ✅ Merged **Merged:** 11/9/2025 **Merged by:** [@MohamedBassem](https://github.com/MohamedBassem) **Base:** `main` ← **Head:** `claude/extract-ratelimiter-plugin-011CUwC9u7ysUAYLVrZEWTJv` --- ### 📝 Commits (9) - [`f4496ae`](https://github.com/karakeep-app/karakeep/commit/f4496ae2a247e0d8026ae6207ab0043c2ebc4ca4) refactor(trpc): extract rate limiter into dedicated plugin - [`13fab1f`](https://github.com/karakeep-app/karakeep/commit/13fab1f647a8e6b12a505b00d9b431662a9d8a30) refactor(plugins): decouple rate limiter from tRPC - [`9f116b2`](https://github.com/karakeep-app/karakeep/commit/9f116b2233c468b9a421463af02603a261099a60) refactor(plugins): integrate rate limiter with plugin registry - [`00c31bc`](https://github.com/karakeep-app/karakeep/commit/00c31bc84eeca7a8f9091fd318dd6dcee5937354) refactor(trpc): move rate limit middleware to trpc package - [`b806f96`](https://github.com/karakeep-app/karakeep/commit/b806f961580e5639d0acfddb3703c3b794e7f27b) refactor(plugins): rename to ratelimit-memory and add tests - [`a0ecd37`](https://github.com/karakeep-app/karakeep/commit/a0ecd376da393c3fd6959eaf697d0a67aef94eb7) change the api to only take the key - [`cbc7419`](https://github.com/karakeep-app/karakeep/commit/cbc74192aed9d4106b41a3e2c39e6bb04dfdd0cf) move the serverConfig check to the trpc - [`4741cc6`](https://github.com/karakeep-app/karakeep/commit/4741cc6ec096100035f9f0b7f821957cf41cfbe8) fix lockfile - [`17a0612`](https://github.com/karakeep-app/karakeep/commit/17a0612d0055f152560b44a3ec96c30afdc3488b) get rid of the timer ### 📊 Changes **12 files changed** (+451 additions, -75 deletions) <details> <summary>View changed files</summary> 📝 `packages/plugins/package.json` (+1 -0) ➕ `packages/plugins/ratelimit-memory/index.ts` (+13 -0) ➕ `packages/plugins/ratelimit-memory/src/index.test.ts` (+253 -0) ➕ `packages/plugins/ratelimit-memory/src/index.ts` (+86 -0) 📝 `packages/shared-server/src/plugins.ts` (+1 -0) 📝 `packages/shared/plugins.ts` (+4 -0) ➕ `packages/shared/ratelimiting.ts` (+38 -0) 📝 `packages/trpc/index.ts` (+3 -3) ➕ `packages/trpc/lib/rateLimit.ts` (+48 -0) 📝 `packages/trpc/package.json` (+1 -0) ➖ `packages/trpc/rateLimit.ts` (+0 -72) 📝 `pnpm-lock.yaml` (+3 -0) </details> ### 📄 Description _No description provided_ --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-02 12:00:03 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/karakeep#1984
No description provided.