Ruvio.AspNetCore.RateLimiting 0.1.1

dotnet add package Ruvio.AspNetCore.RateLimiting --version 0.1.1
                    
NuGet\Install-Package Ruvio.AspNetCore.RateLimiting -Version 0.1.1
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Ruvio.AspNetCore.RateLimiting" Version="0.1.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Ruvio.AspNetCore.RateLimiting" Version="0.1.1" />
                    
Directory.Packages.props
<PackageReference Include="Ruvio.AspNetCore.RateLimiting" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Ruvio.AspNetCore.RateLimiting --version 0.1.1
                    
#r "nuget: Ruvio.AspNetCore.RateLimiting, 0.1.1"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Ruvio.AspNetCore.RateLimiting@0.1.1
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Ruvio.AspNetCore.RateLimiting&version=0.1.1
                    
Install as a Cake Addin
#tool nuget:?package=Ruvio.AspNetCore.RateLimiting&version=0.1.1
                    
Install as a Cake Tool

Ruvio.AspNetCore.RateLimiting

Opt-in distributed, first-request-anchored fixed-window HTTP budgets using Ruvio's atomic LIMIT. This is middleware, not an implementation of the in-process ASP.NET Core RateLimiter. There is no waiting queue or background task.

using Ruvio.AspNetCore.RateLimiting;
using Ruvio.Client.AspNetCore;

builder.Services.AddRuvioClient(builder.Configuration.GetSection("Ruvio"));
builder.Services.AddRuvioRateLimiting(options =>
{
    options.KeyPrefix = "orders:rate:v1:";
    options.PartitionKey = context =>
        context.User.FindFirst("tenant_id")?.Value
        ?? throw new InvalidOperationException("An authenticated tenant is required.");
});

// After building the application:
app.UseRouting();
app.UseAuthentication();
app.UseAuthorization();
app.UseRuvioRateLimiting();
app.MapPost("/orders", HandleOrder)
    .RequireAuthorization()
    .WithMetadata(new RuvioRateLimitAttribute("create-order", 100, 60));

AddRuvioClient registers the connection owner and the shared database-scoped IRuvioClient. This middleware does not own or dispose the connection. A missing partition is a configuration error, not an anonymous shared bucket. Configure an explicit constant for global limits. Partition values must be trusted and bounded, not arbitrary client headers. The partition and policy are hashed; raw identifiers are not stored in keys or telemetry. Every application should have its own prefix.

Only opted-in endpoints resolve services or call Ruvio. Other endpoints return the next delegate's task directly: no async state machine, hashing, timers, network requests, or per-request heap allocation in the bypass path. On an opted-in endpoint there is one atomic command, no client-side counter and no extra deadline lookup. There is no change to the server's ordinary GET/SET/INCR paths.

Use the same permit count and window for every endpoint/instance sharing a policy. Changing settings during a live window does not reset its stored state. Rejected requests return 429 and a conservative full-window Retry-After, not an exact reset time. Backend failures propagate to the application's exception handler; configure that handler to return an appropriate 503. The middleware never silently fails open or retries a possibly-applied LIMIT.

Eviction, data loss, deletion and failover can reset a budget. Use suitable memory and durability policies; this is not a billing/quota ledger. Fixed windows allow bursts around window boundaries.

Optional OpenTelemetry subscriptions: ActivitySource and Meter Ruvio.AspNetCore.RateLimiting. Counters are accepted, rejected and errors; no user/key tags. No exporters or telemetry worker are installed by this package.

Build/package with dotnet pack -c Release. Targets .NET 8; requires the client and server LIMIT command. The package is versioned separately from the server.

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.1.1 0 10/12/2026
0.1.0 92 10/2/2026