Cirreum.Services.Server
1.6.3
dotnet add package Cirreum.Services.Server --version 1.6.3
NuGet\Install-Package Cirreum.Services.Server -Version 1.6.3
<PackageReference Include="Cirreum.Services.Server" Version="1.6.3" />
<PackageVersion Include="Cirreum.Services.Server" Version="1.6.3" />
<PackageReference Include="Cirreum.Services.Server" />
paket add Cirreum.Services.Server --version 1.6.3
#r "nuget: Cirreum.Services.Server, 1.6.3"
#:package Cirreum.Services.Server@1.6.3
#addin nuget:?package=Cirreum.Services.Server&version=1.6.3
#tool nuget:?package=Cirreum.Services.Server&version=1.6.3
Cirreum.Services.Server
Infrastructure services for .NET server applications
Overview
Cirreum.Services.Server provides essential infrastructure services for .NET server applications (Web API and Web App). This library offers a comprehensive foundation with enterprise-grade patterns for invocation contexts, user-state assembly, exception handling, health checks, and file system operations.
Features
- Invocation Contexts: HTTP, WebSocket, and SignalR invocations behind one transport-agnostic
IInvocationContextseam consumed by framework code (CQRS handlers, authorization, audit, repositories); long-lived transports seed each invocation with the connection's authentication slots (AuthenticatedScheme,OriginScheme,ApplicationUserCache) so subject facts read uniformly across sources - Connection Registry & Termination: a per-server registry of active long-lived connections (SignalR, WebSocket) plus the framework-shipped terminator that reacts to
CredentialRevoked/UserAccountDisabled/SessionTerminationRequestedauth events by aborting the subject's live connections — revocation reaches open sockets, not just future requests. Honors Two-Phase Auth promotion (promoted connections are attributed to their promoted identity) - Global Exception Handling: RFC 7807 compliant Problem Details with environment-aware responses
- User-State Assembly: per-invocation
IUserStatebuilt from the snapshotted principal — subject kind resolved from the effective scheme's declaration (ISchemeClaimAuthorityMap, optional), application-user and boundary resolution dispatched on the effective scheme, and a fill-only app-name fallback for machine callers - Health Checks: Application readiness probes and startup health monitoring
- File System Services: Resilient local file operations with CSV processing capabilities
- DateTime Services: Timezone-aware clock services with TimeProvider integration
- Dependency Injection: Clean service registration patterns following .NET conventions
Quick Start
Install the package:
dotnet add package Cirreum.Services.Server
Register services in your application:
using Microsoft.Extensions.DependencyInjection;
// Add core infrastructure services
builder.Services.AddCoreServices();
// Add global exception handling
builder.Services.AddGlobalExceptionHandling();
// Add health checks with startup probe
builder.Services.AddDefaultHealthChecks();
Wire the invocation-context bridge into your HTTP pipeline. Placement matters — register after authentication and authorization so the snapshotted IInvocationContext.User reflects the fully-resolved authenticated principal:
using Microsoft.AspNetCore.Builder;
app.UseExceptionHandler();
app.UseRouting();
app.UseConnectionCredential(); // ← routing resolved, before any scheme reads the header
app.UseAuthentication();
app.UseAuthorization();
app.UseInvocationContext(); // ← here: AuthN/AuthZ resolved, ready for endpoint
app.MapApiEndpoints();
Apps using
Cirreum.Runtime.Server'sBuild()composition pick up bothUseConnectionCredential()andUseInvocationContext()automatically — no manual wiring required.
Service Registration
The library provides extension methods for clean service registration:
AddCoreServices()- RegistersIInvocationContextAccessor(singleton, AsyncLocal-backed), user-state assembly (with the Kernel default authentication-boundary resolver), file system, and datetime servicesAddGlobalExceptionHandling()- Configures RFC 7807 exception handling pipelineAddDefaultHealthChecks()- Sets up health check infrastructure with startup monitoring
Pipeline Extensions
UseConnectionCredential()- Promotes a query-carried bearer credential (?access_token=…) into theAuthorizationheader on SignalR hubs and other connection endpoints, so every authentication scheme reads it where it always has. A browser cannot set headers on a WebSocket upgrade, so this is the only credential such a client can present; without it SignalR silently falls back to Server-Sent Events or long polling. Scoped to connection endpoints, and never overrides anAuthorizationheader that is already present. Register betweenUseRouting()andUseAuthentication().UseInvocationContext()- Publishes anIInvocationContextfor every HTTP request throughIInvocationContextAccessor. SnapshotsUser(immutable for the invocation), aliasesHttpContext.Items(same dictionary reference — existingAuthenticationContextKeysslots flow through transparently), and exposesRequestServices/RequestAbortedthrough the unified seam. Register late — afterUseAuthentication()/UseAuthorization(), before endpoint execution.
Architecture
Built on the IServerDomainApplicationBuilder pattern extending IDomainApplicationBuilder, providing:
- Configuration management through
IConfigurationManager - Host environment information via
IHostEnvironment - Deferred logging capabilities for startup diagnostics
Contribution Guidelines
Be conservative with new abstractions
The API surface must remain stable and meaningful.Limit dependency expansion
Only add foundational, version-stable dependencies.Favor additive, non-breaking changes
Breaking changes ripple through the entire ecosystem.Include thorough unit tests
All primitives and patterns should be independently testable.Document architectural decisions
Context and reasoning should be clear for future maintainers.Follow .NET conventions
Use established patterns from Microsoft.Extensions.* libraries.
Versioning
Cirreum.Services.Server follows Semantic Versioning:
- Major - Breaking API changes
- Minor - New features, backward compatible
- Patch - Bug fixes, backward compatible
License
This project is licensed under the MIT License - see the LICENSE file for details.
Cirreum Foundation Framework
Layered simplicity for modern .NET
| 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
- Cirreum.Contracts (>= 6.0.0)
- Cirreum.Domain (>= 5.0.1)
- FluentValidation (>= 12.1.1)
- Polly (>= 8.7.0)
- Polly.Contrib.WaitAndRetry (>= 1.1.1)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on Cirreum.Services.Server:
| Package | Downloads |
|---|---|
|
Cirreum.Runtime.Server
The Cirreum Runtime for Servers. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.6.3 | 37 | 8/30/2026 |
| 1.6.2 | 84 | 8/25/2026 |
| 1.6.1 | 112 | 8/24/2026 |
| 1.6.0 | 84 | 8/24/2026 |
| 1.5.1 | 104 | 8/20/2026 |
| 1.5.0 | 90 | 8/19/2026 |
| 1.4.8 | 95 | 8/17/2026 |
| 1.4.7 | 118 | 8/4/2026 |
| 1.4.6 | 127 | 7/31/2026 |
| 1.4.5 | 121 | 7/31/2026 |
| 1.4.4 | 117 | 7/27/2026 |
| 1.4.3 | 129 | 7/25/2026 |
| 1.4.2 | 102 | 7/24/2026 |
| 1.4.1 | 118 | 7/20/2026 |
| 1.4.0 | 113 | 7/20/2026 |
| 1.3.4 | 115 | 7/19/2026 |
| 1.3.3 | 140 | 7/7/2026 |
| 1.3.2 | 123 | 7/7/2026 |
| 1.3.1 | 109 | 7/6/2026 |
| 1.3.0 | 108 | 7/5/2026 |