Skip to content

feat: new hook rateLimit#29

Merged
fratzinger merged 1 commit intomainfrom
feat/new-hook-rateLimit
Apr 1, 2026
Merged

feat: new hook rateLimit#29
fratzinger merged 1 commit intomainfrom
feat/new-hook-rateLimit

Conversation

@fratzinger
Copy link
Copy Markdown
Member

This pull request introduces a new rateLimit hook to the codebase, enabling flexible and configurable rate limiting for Feathers services using the rate-limiter-flexible library. It also adds documentation, tests, and updates dependencies to support this new feature. Additionally, there is a minor improvement to the error message in the disallow hook.

Key changes:

New Feature: Rate Limiting

  • Added a new rateLimit hook (src/hooks/rate-limit/rate-limit.hook.ts) that integrates with rate-limiter-flexible to limit service method calls based on configurable options such as key and points. The hook supports all backends provided by the library and stores rate limit results on context.params.rateLimit.
  • Exported the new rateLimit hook in the main hooks index (src/hooks/index.ts).
  • Added comprehensive documentation for the rateLimit hook, including usage examples and advanced configuration options (src/hooks/rate-limit/rate-limit.hook.md).
  • Implemented a full test suite for the rateLimit hook to cover normal operation, custom options, error cases, and integration with Feathers hooks (src/hooks/rate-limit/rate-limit.hook.test.ts).
  • Registered the rateLimit hook in the main test runner (test/index.test.ts).

Dependency Management

  • Added rate-limiter-flexible as both a dependency and an optional peer dependency in package.json, and updated pnpm-lock.yaml to include the new package. [1] [2] [3] [4]

Configuration Updates

  • Updated .claude/settings.json to allow web fetches and additional bash/test commands, likely to support new development and CI workflows.

Minor Improvements

  • Improved the error message in the disallow hook to include the service path, making debugging easier (src/hooks/disallow/disallow.hook.ts).

@cloudflare-workers-and-pages
Copy link
Copy Markdown

Deploying feathers-utils with  Cloudflare Pages  Cloudflare Pages

Latest commit: 369c701
Status: ✅  Deploy successful!
Preview URL: https://6f921d30.feathers-utils.pages.dev
Branch Preview URL: https://feat-new-hook-ratelimit.feathers-utils.pages.dev

View logs

@fratzinger fratzinger merged commit 932a9d9 into main Apr 1, 2026
11 checks passed
@fratzinger fratzinger deleted the feat/new-hook-rateLimit branch April 1, 2026 19:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant