Kck.Bundle.WebApi
5.0.0
dotnet add package Kck.Bundle.WebApi --version 5.0.0
NuGet\Install-Package Kck.Bundle.WebApi -Version 5.0.0
<PackageReference Include="Kck.Bundle.WebApi" Version="5.0.0" />
<PackageVersion Include="Kck.Bundle.WebApi" Version="5.0.0" />
<PackageReference Include="Kck.Bundle.WebApi" />
paket add Kck.Bundle.WebApi --version 5.0.0
#r "nuget: Kck.Bundle.WebApi, 5.0.0"
#:package Kck.Bundle.WebApi@5.0.0
#addin nuget:?package=Kck.Bundle.WebApi&version=5.0.0
#tool nuget:?package=Kck.Bundle.WebApi&version=5.0.0
Kck.Bundle.WebApi
One-line ASP.NET Core Web API setup: registers Serilog, Argon2 hashing, the in-memory cache, the in-memory event bus, exception handling, health check services, and rate limiting with security headers and CORS from the Kck configuration section. With Kck:Security:Jwt:Issuer set it also registers the JWT token service; ASP.NET Core authentication, persistence, the Mediator pipeline and OpenTelemetry are configured separately.
New to Kck? Your first Kck API in five minutes creates a working API with this package: dotnet new install Kck.Templates, then dotnet new kck-webapi.
Installation
dotnet add package Kck.Bundle.WebApi
Quick Start
// Program.cs
var builder = WebApplication.CreateBuilder(args);
builder.Services.AddKckWebApiDefaults(builder.Configuration);
var app = builder.Build();
app.UseKckWebApiDefaults();
app.MapControllers();
app.Run();
That is all the setup required. Add your controllers, Mediator handlers, and domain entities — the bundle wires everything else.
Configuration
| Property | Description | Default |
|---|---|---|
Kck:Security:Jwt:Issuer |
JWT token issuer; setting it registers the JWT token service | — |
Kck:Security:Jwt:Audience |
JWT token audience; required once Issuer is set |
— |
Kck:AspNetCore:RateLimitPermitLimit |
Requests per window per client IP | 100 |
Kck:AspNetCore:RateLimitWindowSeconds |
Rate limit window (seconds) | 60 |
Kck:AspNetCore:SecurityHeaders |
Adds the security headers middleware | true |
Kck:AspNetCore:CorsOrigins |
Allowed CORS origins (string array, for example ["https://myapp.com"]) |
none — CORS off |
These are the only settings the bundle reads. The cache is always the in-memory one and the health checks have no configuration; configure the providers in code for anything else.
Issuer alone is not enough: the JWT options are validated at start-up, and without Audience and an RS256 signing
key start-up fails with a JwtOptions is invalid error that lists Audience: null or empty and
RsaKeyBase64 … is empty. The bundle does not bind the key; set it (and any
other JwtOptions value, such as AccessTokenExpiration) on JwtOptions yourself:
using Kck.Security.Jwt;
builder.Services.AddKckWebApiDefaults(builder.Configuration);
builder.Services.Configure<JwtOptions>(jwt =>
jwt.RsaKeyBase64 = Environment.GetEnvironmentVariable("JWT_RSA_KEY_B64"));
Resources
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. 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. |
-
net10.0
- Kck.AspNetCore (>= 5.0.0)
- Kck.Caching.Abstractions (>= 5.0.0)
- Kck.Caching.InMemory (>= 5.0.0)
- Kck.Core.Abstractions (>= 5.0.0)
- Kck.EventBus.Abstractions (>= 5.0.0)
- Kck.EventBus.InMemory (>= 5.0.0)
- Kck.Exceptions.AspNetCore (>= 5.0.0)
- Kck.Logging.Serilog (>= 5.0.0)
- Kck.Messaging.Abstractions (>= 5.0.0)
- Kck.Observability.Abstractions (>= 5.0.0)
- Kck.Observability.OpenTelemetry (>= 5.0.0)
- Kck.Persistence.Abstractions (>= 5.0.0)
- Kck.Persistence.EntityFramework (>= 5.0.0)
- Kck.Pipeline.Mediator (>= 5.0.0)
- Kck.Security.Abstractions (>= 5.0.0)
- Kck.Security.Argon2 (>= 5.0.0)
- Kck.Security.Jwt (>= 5.0.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.