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
<PackageReference Include="SeliseBlocks.Genesis.Framework.Api" Version="10.0.2.2" />
<PackageVersion Include="SeliseBlocks.Genesis.Framework.Api" Version="10.0.2.2" />
<PackageReference Include="SeliseBlocks.Genesis.Framework.Api" />
paket add SeliseBlocks.Genesis.Framework.Api --version 10.0.2.2
#r "nuget: SeliseBlocks.Genesis.Framework.Api, 10.0.2.2"
#:package SeliseBlocks.Genesis.Framework.Api@10.0.2.2
#addin nuget:?package=SeliseBlocks.Genesis.Framework.Api&version=10.0.2.2
#tool nuget:?package=SeliseBlocks.Genesis.Framework.Api&version=10.0.2.2
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 authenticationSwashbuckle.AspNetCore(7.2.0) - Swagger/OpenAPI documentationMicrosoft.AspNetCore.Mvc.NewtonsoftJson(10.0.0) - Newtonsoft.Json MVC integrationlog4net(3.3.2) - Logging frameworkSharpCompress(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 authenticationSecurityKeyProvider- Provides signing keys from Key Vault or configurationClaimsTransformerProvider- Transforms claims on each request
Endpoint Protection
ProtectedEndPointAttribute- Marks endpoints requiring authenticationAnonymousEndPointAttribute- Marks endpoints allowing anonymous accessEndPointProtector- Applies protection based on attributesHasAccessQuery- 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 startupBlocksSwaggerInstance- Singleton Swagger instance managementSwaggerDocumentFilter- Customizes OpenAPI document generationOpenApiDocumentCache- Caches OpenAPI documents for performance
Middleware Pipeline
TracingMiddleware- Request tracing/correlationGlobalExceptionHandlerMiddleware- Centralized exception handlingAuditLoggerMiddleware- Logs all API requests
| 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
- Microsoft.AspNetCore.Authentication.JwtBearer (>= 10.0.11)
- Microsoft.AspNetCore.Mvc.NewtonsoftJson (>= 10.0.11)
- SeliseBlocks.Genesis.Framework.Logger.File (>= 10.0.2.2)
- SeliseBlocks.Genesis.Framework.PDS.Entity (>= 10.0.2.2)
- SeliseBlocks.Genesis.Framework.RedisClient (>= 10.0.2.2)
- SeliseBlocks.Genesis.Framework.Repositories (>= 10.0.2.2)
- SeliseBlocks.Genesis.Framework.ServiceClient (>= 10.0.2.2)
- Swashbuckle.AspNetCore (>= 10.2.3)
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 |