salvo-rate-limiter

Implement IP-, user-, and API-key-based rate limiting for Salvo Rust microservices.

1|Updated Mar 16, 2024
One-click install
npx skills add https://github.com/tdcare/genies --skill salvo-rate-limiter-tdcare
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: salvo-rate-limiter
Source: https://github.com/tdcare/genies/tree/main/.qoder/skills/salvo-rate-limiter
Command: npx skills add https://github.com/tdcare/genies --skill salvo-rate-limiter-tdcare

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Rate limiting to protect APIs from abuse and ensure fair resource usage, preventing traffic spikes and DoS-like scenarios.

Core Features & Use Cases

  • Built-in quota strategies (per second/minute/hour) with easy composition
  • IP-based, user-based, and API-key-based throttling
  • Seamless integration with Salvo router and custom rate issuers

Quick Start

Attach a RateLimiter to your Salvo router and start the server to enforce rate limits.

Frequently Asked Questions about salvo-rate-limiter

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I implement rate limiting in a Rust microservice to prevent API abuse?

You can enforce rate limiting by attaching a RateLimiter directly to your Salvo router. This setup applies structured API quotas and immediately starts protecting your endpoints from traffic spikes upon server startup.

Can I throttle API requests based on IP, user, and API keys simultaneously?

Yes, you can apply IP-based, user-based, and API-key-based throttling simultaneously. This approach ensures fair resource usage by applying distinct quota limits to different client identifiers across your endpoints.

Does the Salvo framework support sliding window rate limiting for Rust APIs?

Yes, the Salvo framework supports sliding window rate limiting for Rust APIs. It provides built-in quota strategies that allow you to configure both fixed and sliding guards to precisely control traffic spikes.

What is the best way to store state for API quotas in a Rust microservice?

Storing state for API quotas in a Rust microservice is handled via MokaStore. This storage-backed state mechanism tracks per-second and per-minute quotas accurately across your Salvo router endpoints.

How do I configure per-minute and per-second quotas for API protection in Rust?

Configuring per-minute and per-second quotas for API protection in Rust involves applying built-in quota strategies. You can easily compose these limits on a RateLimiter attached to your Salvo router to prevent abuse.