Franz.Common.Http.Headers
3.0.0
dotnet add package Franz.Common.Http.Headers --version 3.0.0
NuGet\Install-Package Franz.Common.Http.Headers -Version 3.0.0
<PackageReference Include="Franz.Common.Http.Headers" Version="3.0.0" />
<PackageVersion Include="Franz.Common.Http.Headers" Version="3.0.0" />
<PackageReference Include="Franz.Common.Http.Headers" />
paket add Franz.Common.Http.Headers --version 3.0.0
#r "nuget: Franz.Common.Http.Headers, 3.0.0"
#:package Franz.Common.Http.Headers@3.0.0
#addin nuget:?package=Franz.Common.Http.Headers&version=3.0.0
#tool nuget:?package=Franz.Common.Http.Headers&version=3.0.0
Franz.Common.Http.Headers
ASP.NET Core adapters for the transport-agnostic header context contract and required-header action constraints.
Overview
ASP.NET Core adapters for the transport-agnostic header context contract and required-header action constraints.
Installation
dotnet add package Franz.Common.Http.Headers
Register HTTP header context access
using Franz.Common.Http.Headers.Extensions;
builder.Services.AddHttpHeaderContext();
This registers ASP.NET Core's IHttpContextAccessor and a scoped IHeaderContextAccessor implementation (HeaderContextAccessor) using the no-duplicate registration strategy.
The accessor adapts the current request's headers to the IDictionary<string, string[]> contract defined by Franz.Common.Headers. ListAll() returns an empty case-insensitive dictionary when there is no current HTTP context. It filters blank values when building the full dictionary. The raw TryGetValue overload returns the values for the requested key. The generic overload returns the first value as-is for string; for other types it delegates deserialization to IJsonSerializer.
Require a header for an action
HeaderRequiredAttribute can be applied to a controller or action, allows multiple declarations, and takes a CLR type and header name.
using Franz.Common.Http.Headers;
[HeaderRequired(typeof(Guid), "X-Tenant-Id")]
[HttpGet]
public IActionResult GetTenantData() => Ok();
Register the action-constraint capability:
builder.Services.AddHeaderRequiredCapability();
The attribute is an IActionConstraintFactory; it resolves HeaderRequiredActionConstraint from DI. The package's constraint determines whether the route/action is eligible based on the declared header metadata. It is an MVC action-selection mechanism, not an authentication or authorization policy.
Security boundary
A present header is not proof that its value is trustworthy. Validate tenant, identity, and authorization metadata against an authenticated and trusted source. Do not let clients self-assert privileged identity or tenant values simply because the action requires a header.
Package relationship
The transport-neutral contracts and propagation configuration are in Franz.Common.Headers. This package supplies the ASP.NET Core implementation and MVC integration. Serialization is used to convert non-string header values through the configured IJsonSerializer.
License
MIT. See LICENSE.
| 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
- Franz.Common.Headers (>= 3.0.0)
- Franz.Common.Serialization (>= 3.0.0)
- Newtonsoft.Json (>= 13.0.4)
NuGet packages (2)
Showing the top 2 NuGet packages that depend on Franz.Common.Http.Headers:
| Package | Downloads |
|---|---|
|
Franz.Common.Http.MultiTenancy
Shared utility library for the Franz Framework. |
|
|
Franz.Common.Http.Bootstrap
Shared utility library for the Franz Framework. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 3.0.0 | 68 | 11/10/2026 |
| 2.3.4 | 384 | 11/1/2026 |
| 2.3.3 | 354 | 10/28/2026 |
| 2.3.2 | 162 | 10/27/2026 |
| 2.3.1 | 200 | 10/26/2026 |
| 2.3.0 | 269 | 7/21/2026 |
| 2.2.19 | 194 | 7/19/2026 |
| 2.2.18 | 171 | 7/19/2026 |
| 2.2.17 | 306 | 7/12/2026 |
| 2.2.16 | 189 | 7/2/2026 |
| 2.2.15 | 193 | 6/29/2026 |
| 2.2.14 | 183 | 6/29/2026 |
| 2.2.13 | 194 | 6/29/2026 |
| 2.2.12 | 181 | 6/28/2026 |
| 2.2.11 | 178 | 6/28/2026 |
| 2.2.10 | 185 | 6/28/2026 |
| 2.2.9 | 190 | 6/28/2026 |
| 2.2.8 | 181 | 6/28/2026 |
| 2.2.7 | 182 | 6/7/2026 |
| 2.2.6 | 193 | 6/6/2026 |