SakurWebApiUtilities 1.1.1

There is a newer version of this package available.
See the version list below for details.
dotnet add package SakurWebApiUtilities --version 1.1.1                
NuGet\Install-Package SakurWebApiUtilities -Version 1.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="SakurWebApiUtilities" Version="1.1.1" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add SakurWebApiUtilities --version 1.1.1                
#r "nuget: SakurWebApiUtilities, 1.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.
// Install SakurWebApiUtilities as a Cake Addin
#addin nuget:?package=SakurWebApiUtilities&version=1.1.1

// Install SakurWebApiUtilities as a Cake Tool
#tool nuget:?package=SakurWebApiUtilities&version=1.1.1                

WebApiUtilities

Tiny nuget package to help with web api development in asp.net core. Nuget link: https://www.nuget.org/packages/SakurWebApiUtilities/

Rate limiting

Requires a distributed memory cache:

(in Program.cs or where your webapi is built)

builder.Services.AddDistributedMemoryCache();

Then add rate limiting:

app.UseRateLimiting();

Above controller methods you can now add:

[Limit(MaxRequests = 20, TimeWindow = 10)]

MaxRequests: The amount of requests allowed during the time specified in seconds in TimeWindow TimeWindow: The time window in seconds during which MaxRequests amount of requests are allowed

Auth

(in Program.cs or where your webapi is built)

builder.Services.SetupAuth();

/// <summary> /// Will setup the authentication for the service collection /// </summary> /// <param name="services">The service collection to use</param> /// <param name="authDomain">The domain for the auth</param> /// <param name="authAudience">The audience for the auth</param> /// <param name="roles">The roles to have in the auth</param> /// <param name="authenticationScheme">The scheme to use, default is "Bearer"</param> /// <returns>The service collection again so that calls can be chained</returns>

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. 
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
1.2.1 141 10/30/2024
1.2.0 77 10/29/2024
1.1.3 79 10/25/2024
1.1.2 83 10/25/2024
1.1.1 150 9/17/2024
1.1.0 124 7/8/2024
1.0.0 2,065 5/22/2021