Fudie.Security
1.0.12
dotnet add package Fudie.Security --version 1.0.12
NuGet\Install-Package Fudie.Security -Version 1.0.12
<PackageReference Include="Fudie.Security" Version="1.0.12" />
<PackageVersion Include="Fudie.Security" Version="1.0.12" />
<PackageReference Include="Fudie.Security" />
paket add Fudie.Security --version 1.0.12
#r "nuget: Fudie.Security, 1.0.12"
#:package Fudie.Security@1.0.12
#addin nuget:?package=Fudie.Security&version=1.0.12
#tool nuget:?package=Fudie.Security&version=1.0.12
Fudie.Security
Security infrastructure for Fudie microservices. Split into four packages with clear responsibilities.
Packages
| Package | Purpose |
|---|---|
| Fudie.Security | Core contracts (IPasswordHasher, IApiKeyGenerator, IFudieContext, ITokenGenerator, IJwtValidator) and implementations (BcryptPasswordHasher, ApiKeyGenerator) |
| Fudie.Security.Jwt | JWT token generation and validation (JwtValidator, ISigningKeyProvider) |
| Fudie.Security.Extensions | JWKS key fetching with in-memory caching |
| Fudie.Security.Http | Authorization middleware, endpoint catalog, and security requirements for HTTP APIs |
Dependency Graph
Fudie.Security.Http
-> Fudie.Security
-> Fudie.Http
-> Fudie.DependencyInjection
Fudie.Security.Extensions
-> Fudie.Security.Jwt
-> Fudie.Security
-> Fudie.DependencyInjection
Installation
Reference the packages your service needs:
- All HTTP services need
Fudie.Security.Http+Fudie.Security.Extensions - Auth service (token issuer) needs
Fudie.Security+Fudie.Security.Jwtdirectly
Configuration
1. appsettings.json
{
"Fudie": {
"Security": {
"JwksUrl": "http://auth-service:8080/auth/jwks",
"CacheRefreshMinutes": 60
}
}
}
| Key | Required | Default | Description |
|---|---|---|---|
JwksUrl |
Yes | - | Full URL of the JWKS endpoint that serves public signing keys |
CacheRefreshMinutes |
No | 60 |
Minutes to cache JWKS keys before refreshing |
2. Program.cs
// --- Service Registration ---
// Registers JWKS key provider, JWT validator, and in-memory cache.
// Reads from the Fudie:Security section in appsettings.json.
// Throws InvalidOperationException if the section or JwksUrl is missing.
builder.Services.AddFudieJwksProvider();
// --- Middleware Pipeline ---
// Enables authorization middleware, registers endpoints in the catalog,
// and maps the GET /catalog discovery endpoint.
featureBuilder.UseFudieAuthorization();
3. What each call registers
AddFudieJwksProvider() (from Fudie.Security.Extensions):
- Binds
FudieSecurityOptionsfrom configuration - Registers
IMemoryCache - Registers HTTP client for JWKS endpoint
- Registers
ISigningKeyProvider(singleton) - Registers
IJwtValidator(singleton, if not already registered)
UseFudieAuthorization() (from Fudie.Security.Http):
- Discovers
IAggregateDescriptionimplementations across loaded assemblies - Registers all feature endpoints in the
ICatalogRegistry - Adds
FudieAuthorizationMiddlewareto the pipeline - Maps the
GET /catalogdiscovery endpoint
Error Handling
The application will fail fast at startup if:
- The
Fudie:Securityconfiguration section is missing JwksUrlis empty or not provided
| Product | Versions 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. |
-
net8.0
- BCrypt.Net-Next (>= 4.0.3)
- Fudie.DependencyInjection (>= 1.0.12)
- Microsoft.IdentityModel.Tokens (>= 8.16.0)
NuGet packages (3)
Showing the top 3 NuGet packages that depend on Fudie.Security:
| Package | Downloads |
|---|---|
|
Fudie.Security.Jwt
JWT token generation and validation using ECDSA keys. |
|
|
Fudie.Security.Http
Authorization middleware, endpoint catalog, and security requirements for HTTP APIs. |
|
|
Fudie
Fudie framework — all packages in one reference. Install this to get the full framework. |
GitHub repositories
This package is not used by any popular GitHub repositories.