TaskHub.Shared

TaskHub.Shared.RateLimiter

Reusable rate-limiting primitives and policies for protecting APIs.

Contents

Summary

This module provides pre-defined rate limiting policies based on the .NET 7+ Rate Limiting middleware.

Policies

Fixed Window

Allows a specific number of requests in a fixed time window.

Configuration

"RateLimiter": {
  "PermitLimit": 100,
  "WindowInSeconds": 60
}

Usage

Apply the rate limiter to a controller or endpoint:

[EnableRateLimiting("fixed")]
public class MyController : ControllerBase { }