SeliseBlocks.Genesis.Framework.Api 10.0.2.2

dotnet add package SeliseBlocks.Genesis.Framework.Api --version 10.0.2.2
                    
NuGet\Install-Package SeliseBlocks.Genesis.Framework.Api -Version 10.0.2.2
                    
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="SeliseBlocks.Genesis.Framework.Api" Version="10.0.2.2" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="SeliseBlocks.Genesis.Framework.Api" Version="10.0.2.2" />
                    
Directory.Packages.props
<PackageReference Include="SeliseBlocks.Genesis.Framework.Api" />
                    
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 SeliseBlocks.Genesis.Framework.Api --version 10.0.2.2
                    
#r "nuget: SeliseBlocks.Genesis.Framework.Api, 10.0.2.2"
                    
#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 SeliseBlocks.Genesis.Framework.Api@10.0.2.2
                    
#: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=SeliseBlocks.Genesis.Framework.Api&version=10.0.2.2
                    
Install as a Cake Addin
#tool nuget:?package=SeliseBlocks.Genesis.Framework.Api&version=10.0.2.2
                    
Install as a Cake Tool

SeliseBlocks.Genesis.Framework.Api

ASP.NET Core Web API foundation with JWT authentication, Swagger documentation, and endpoint protection middleware.

Project Name & Purpose

SeliseBlocks.Genesis.Framework.Api provides the foundational Web API infrastructure for the Genesis platform. It implements JWT bearer authentication, endpoint protection via custom attributes, Swagger/OpenAPI documentation setup, claims transformation, and middleware for auditing and exception handling. All API controllers and web-facing services in the platform reference this library.

Tech Stack

  • .NET 10.0 (net10.0)
  • ASP.NET Core 10.0 (via Microsoft.AspNetCore.App framework reference)
  • Key Libraries:
    • Microsoft.AspNetCore.Authentication.JwtBearer (10.0.0) - JWT Bearer authentication
    • Swashbuckle.AspNetCore (7.2.0) - Swagger/OpenAPI documentation
    • Microsoft.AspNetCore.Mvc.NewtonsoftJson (10.0.0) - Newtonsoft.Json MVC integration
    • log4net (3.3.2) - Logging framework
    • SharpCompress (0.50.4) / Snappier (1.3.1) - Compression utilities

Dependencies

Internal Project References

Project Version Purpose
SeliseBlocks.Genesis.Framework.Logger.File 10.0.0.2 File-based logging
SeliseBlocks.Genesis.Framework.RedisClient 10.0.0.2 Redis caching
SeliseBlocks.Genesis.Framework.Repositories 10.0.0.1 MongoDB repositories
SeliseBlocks.Genesis.Framework.ServiceClient 10.0.0.1 Service-to-service communication

NuGet Packages

Package Version Purpose
Microsoft.AspNetCore.Authentication.JwtBearer 10.0.0 JWT authentication
Swashbuckle.AspNetCore 7.2.0 Swagger documentation
Microsoft.AspNetCore.Mvc.NewtonsoftJson 10.0.0 JSON serialization
log4net 3.3.2 Logging
SharpCompress 0.50.4 Compression
Snappier 1.3.1 Compression

Structure

ApiDocuments/
  - BlocksSwaggerInstance.cs
  - BlocksSwaggerOptions.cs
  - BlocksSwaggerStartupFilter.cs
  - BlocksApiDocExtensions.cs
  - OpenApiDocumentCache.cs
  - SwaggerDocumentFilter.cs
  - FakeApiDescriptionGroupCollectionProvider.cs

Root level:
  - Security: SecurityKeyProvider.cs, SecurityContextProvider.cs, ClaimsTransformerProvider.cs
  - Authentication: JwtBearerAuthorizationExtension.cs
  - Authorization: ProtectedEndPointAttribute.cs, ProtectedEndpointAccessRequirement.cs,
                   ProtectedEndpointAccessHandler.cs, AnonymousEndPointAttribute.cs,
                   AnonymousEndpointAccessRequirement.cs, AnonymousEndpointAccessHandler.cs,
                   HasAccessQuery.cs, AuthorizationHandlerContextExtensions.cs
  - Middleware: TracingMiddleware.cs, GlobalExceptionHandlerMiddleware.cs,
                AuditLoggerMiddleware.cs, ApplicationBuilderExtensions.cs
  - API: ManagementController.cs, EndPointProtector.cs, EndPointProtectorCacheOptions.cs
  - Configuration: AppSettingsProvider.cs, EnvironmentHelper.cs
  - Utilities: HttpRequestPayloadExtractor.cs, HttpContextExtensions.cs,
              ErrorVerbosities.cs, BlocksWebApiPipelineBuilder.cs,
              BlocksWebApiPipelineBuilderOptions.cs

Key Features

JWT Bearer Authentication

  • JwtBearerAuthorizationExtension - Configures JWT Bearer authentication
  • SecurityKeyProvider - Provides signing keys from Key Vault or configuration
  • ClaimsTransformerProvider - Transforms claims on each request

Endpoint Protection

  • ProtectedEndPointAttribute - Marks endpoints requiring authentication
  • AnonymousEndPointAttribute - Marks endpoints allowing anonymous access
  • EndPointProtector - Applies protection based on attributes
  • HasAccessQuery - Checks if current user has access to a resource
EndPointProtector cache

EndPointProtector caches the RBAC lookups in a private, size-limited in-memory cache (one per service instance): the feature ids of each endpoint (FeatureEndPointMaps) and of each role (FeatureRoleMaps), per tenant. A request is allowed when any of the user's roles shares a feature with the endpoint, so a warm request needs no MongoDB calls. Roles not cached yet (e.g. a new company's genadmin_{companyId}) are loaded on first use, and failed loads are never cached.

The cache is enabled by default. Override it per service in appsettings.{ASPNETCORE_ENVIRONMENT}.json (not in GlobalConfig.json):

"EndPointProtectorCache": {
  "Enabled": true,
  "TtlSeconds": 900,
  "SizeLimitBytes": 104857600
}
Setting Default Meaning
Enabled true false restores the uncached per-request MongoDB check
TtlSeconds 900 Absolute expiry of each entry; 0 or less disables the cache
SizeLimitBytes 104857600 (100 MB) Upper bound on the estimated cache size; 0 or less disables the cache

All settings are optional, and an unreadable section falls back to the defaults. Environment variables (EndPointProtectorCache__Enabled=false) apply only to keys not set in the appsettings file, because the file is loaded after them.

Permission changes to roles or endpoints that are already cached (e.g. removing a feature from a role) take effect after at most TtlSeconds, per instance. Seed FeatureEndPointMaps for new endpoints before they are called, otherwise "no features" is cached for up to TtlSeconds. EndPointProtector.GetCacheStatistics() returns hits, misses, entry count and estimated size (null when disabled).

Swagger / OpenAPI

  • BlocksSwaggerStartupFilter - Configures Swagger on application startup
  • BlocksSwaggerInstance - Singleton Swagger instance management
  • SwaggerDocumentFilter - Customizes OpenAPI document generation
  • OpenApiDocumentCache - Caches OpenAPI documents for performance

Middleware Pipeline

  • TracingMiddleware - Request tracing/correlation
  • GlobalExceptionHandlerMiddleware - Centralized exception handling
  • AuditLoggerMiddleware - Logs all API requests
Product 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. 
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
10.0.2.2 58 11/26/2026
10.0.2.1 270 11/24/2026
10.0.1.4-rc1 100 11/23/2026
10.0.1.3 353 11/5/2026
10.0.1.2 3,683 10/15/2026
10.0.1.2-rc1 116 10/15/2026
10.0.1.1 234 10/13/2026
10.0.0.9 981 10/11/2026
10.0.0.9-rc1 149 10/8/2026
10.0.0.8 351 10/6/2026
10.0.0.7 119 10/6/2026
10.0.0.5 564 10/5/2026
10.0.0.4 9,086 10/1/2026
10.0.0.4-rc1 242 8/29/2026
10.0.0.3 4,713 9/6/2026
10.0.0.3-rc4 660 8/27/2026
10.0.0.3-rc3 117 8/27/2026
10.0.0.3-rc2 117 8/27/2026
10.0.0.3-rc1 111 8/26/2026
10.0.0.2 9,399 8/16/2026
Loading failed