Abblix.Utils 3.0.0

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

Abblix.Utils

The foundation layer of the Abblix packages: the small, dependency-light pieces that security-focused code keeps needing - careful URI construction, log sanitization, cryptographic encodings, JSON converters for wire formats, and a Result type for expected failures. The JWT, OIDC Server, Security Events and Shared Signals packages all build on it; it is equally usable on its own.

Install

dotnet add package Abblix.Utils

What is inside

URIs and parameters

UriBuilder, UriExtensions and ParametersBuilder construct and take apart URIs with explicit control over query and fragment parts - the difference that matters when a redirect URI must carry a response exactly where the protocol says, and nowhere else.

Result: expected failures as values

Result<TSuccess, TFailure> models an operation whose failure is an expected outcome rather than an exception - validation, protocol errors, lookups that legitimately find nothing. Both outcomes are values, Match and the MapSuccess/MapFailure combinators compose them railway-style, and TryGetSuccess/TryGetFailure unwrap at the edges:

Result<AuthorizedGrant, AuthError> result = await AuthorizeAsync(request);
return result.Match(RenderTokens, RenderError);

Log sanitization

Sanitized wraps a value for logging so an ASCII control character cannot forge a log line: at formatting time it escapes line breaks, tabs, quotes and separators, and strips the C0 range and DEL. Wrap anything a caller sent - identifiers, URIs, header values - before it reaches a log template:

logger.LogWarning("Unknown client {ClientId}", Sanitized.Value(clientId));

The stripping runs in ToString(), so it protects the formatted message; a sink that serializes the wrapper's Source property instead reads the raw value by design.

Cryptographic encodings and randomness

CryptoRandom produces cryptographically strong random material for tokens and identifiers. Base32 and HexConverter cover the encodings certificates and secrets travel in.

JSON converters for wire formats

Custom System.Text.Json converters for the shapes protocol messages actually use: unix-seconds timestamps (DateTimeOffsetUnixTimeSecondsConverter), durations as integer seconds (TimeSpanSecondsConverter), space-separated lists such as OAuth scopes (SpaceSeparatedValuesConverter), values that arrive as either a single item or an array (SingleOrArrayConverter), and base64url binary (Base64UrlTextEncoderConverter).

Distributed cache helpers

DistributedCacheExtensions adds the operation IDistributedCache lacks for security bookkeeping: TryAddAsync, an add-if-absent that expresses first-sighting checks - replay caches and similar - over any cache backend. It is Get-then-Set, because the interface exposes no compare-and-set, so the guarantee is probabilistic under concurrency; a domain needing strict exactly-once takes a backend-native atomic (SET NX EX, INSERT ... ON CONFLICT DO NOTHING) instead.

Outbound addresses a caller did not choose

PrivateNetworks states which addresses are internal - loopback, the private and link-local ranges, and the rest a server must not be talked into reaching on somebody else's behalf. AddressValidatingHttpMessageHandler is the message-handler half: it follows no redirect, carries no ambient credentials, decompresses nothing, and judges the address on the send itself rather than when the request was scheduled, leaving only the policy to the handler derived from it. ResolveHostDelegate names the answer a derived handler needs about a hostname, so one function serves every guard built on this base.

One load for many callers

CoalescingLoader<TKey, TValue> is for documents read from someone else's server when the requests reaching your server decide how often they are read, such as a key set fetched for a token that names an unfamiliar key. Callers that ask while a load runs wait for that load, and the finished load, whether it succeeded or failed, is served for a hold you choose, so a server that is down is asked once per hold rather than once per request. The load runs under no caller's cancellation. The limit holds within one process: each instance of your service loads on its own.

The loads live in an ExpiringDictionary<TKey, TValue>, which is usable on its own: a thread-safe dictionary whose entries expire a given time after they were added or renewed, counted on the monotonic clock. An expired entry is invisible at once and gives way to the next addition, and expired entries are swept as new ones arrive, at a constant cost per addition on average, so keys nobody uses again do not pile up.

Collections and enums

ArrayExtensions, EnumerableExtensions, EnumFlagExtensions and ObjectExtensions carry the small operations that otherwise get re-implemented per project.

Part of the Abblix product family

Abblix.Utils sits under Abblix.JWT, Abblix.OIDC.Server, Abblix.SecurityEvents and the rest of the family; the full set lives in the repository.

License

Abblix.Utils is licensed under the Apache License 2.0.

Contacts

Product Compatible and additional computed target framework versions.
.NET net11.0 is compatible. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net11.0

    • No dependencies.

NuGet packages (6)

Showing the top 5 NuGet packages that depend on Abblix.Utils:

Package Downloads
Abblix.JWT

JWT, JWS, JWE and JWK library for .NET built on the platform's own cryptography, with no dependency on Microsoft.IdentityModel. Sign, encrypt and validate tokens, manage JSON Web Keys, and keep signing keys in HashiCorp Vault, OpenBao or Azure Key Vault.

Abblix.SecurityEvents

Security Event Tokens (RFC 8417) for .NET with Subject Identifiers (RFC 9493), push (RFC 8935) and poll (RFC 8936) delivery, and OpenID Back-Channel Logout. Build, sign, deliver and validate security events between identity providers and relying parties.

Abblix.SharedSignals

OpenID Shared Signals Framework (SSF) 1.0 for .NET: transmitter and receiver in one package. Discover a transmitter, manage event streams and subjects, verify delivery, and send or receive CAEP and RISC events by push or poll.

Abblix.SecurityEvents.CAEP

OpenID CAEP 1.0 (Continuous Access Evaluation Profile) event dictionary for .NET: typed models for session revoked, token claims change, credential change, assurance level change, device compliance change, session established, session presented and risk level change, over Abblix Security Events.

Abblix.SecurityEvents.RISC

OpenID RISC 1.0 (Risk Incident Sharing and Coordination) event dictionary for .NET: typed models for credential compromise, account disabled, enabled and purged, identifier changed and recycled, opt-out and recovery events, over Abblix Security Events.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
3.0.0 275 11/18/2026
2.4.0 431 9/5/2026
2.3.0 315 6/9/2026
2.2.0 445 2/18/2026
2.1.0 634 12/8/2025
2.0.1 726 12/1/2025
2.0.0 320 11/26/2025
1.6.0 403 8/14/2025
1.5.0 358 6/25/2025
1.4.0 409 4/9/2025
1.3.1 370 12/3/2024
1.3.0.1 297 11/28/2024
1.3.0 309 11/13/2024
1.2.0.1 316 10/16/2024
1.2.0 315 10/11/2024
1.1.0 423 7/9/2024
1.0.100 361 5/3/2024
Loading failed

Small types that keep protocol code readable. A result carries either a value or a typed error through a chain of checks, so a validator returns one thing and never throws for a bad input. An absolute address builder composes query strings safely; address and string extensions cover the cases that come up on the wire. Validation attributes check absolute addresses, allowed values and required elements at binding time. A challenge builder writes RFC 6750 authentication responses correctly escaped, and a sanitizer strips control characters before a value reaches a log. Secure random generation, Base32 and Base64URL encoding and custom JSON converters round it out. Full details: https://github.com/Abblix/Oidc.Server/releases/tag/v3.0