PowerCSharp.Feature.Sanitization.Abstractions
1.0.1
dotnet add package PowerCSharp.Feature.Sanitization.Abstractions --version 1.0.1
NuGet\Install-Package PowerCSharp.Feature.Sanitization.Abstractions -Version 1.0.1
<PackageReference Include="PowerCSharp.Feature.Sanitization.Abstractions" Version="1.0.1" />
<PackageVersion Include="PowerCSharp.Feature.Sanitization.Abstractions" Version="1.0.1" />
<PackageReference Include="PowerCSharp.Feature.Sanitization.Abstractions" />
paket add PowerCSharp.Feature.Sanitization.Abstractions --version 1.0.1
#r "nuget: PowerCSharp.Feature.Sanitization.Abstractions, 1.0.1"
#:package PowerCSharp.Feature.Sanitization.Abstractions@1.0.1
#addin nuget:?package=PowerCSharp.Feature.Sanitization.Abstractions&version=1.0.1
#tool nuget:?package=PowerCSharp.Feature.Sanitization.Abstractions&version=1.0.1
PowerCSharp.Feature.Sanitization.Abstractions

Framework-agnostic sanitization engine, contracts, and safe-off NoOp implementation for the PowerCSharp Sanitization feature. Covers log injection (CWE-117), file-path traversal (CWE-22), sensitive-data exposure (CWE-200), and regex-injection/ReDoS (CWE-400/CWE-730).
- Targets
netstandard2.0andnet8.0, so the engine can run on .NET Framework and .NET Core — including hot-path logging call sites that reference nothing else. - No ASP.NET Core dependency.
- Only dependencies are
Microsoft.Extensions.Logging.Abstractions(theILoggerparameter on the NoOp service) andSystem.Text.Json(used internally by the log-injection JSON-encoding strategy). - The engine is fail-safe: sanitization methods never throw. Only
SanitizeForFilePathandSanitizeForRegexInjectioncan reject an input (viaIsRejectedon the result), and only under strict validation.
Contents
SanitizationEngine— static, partial engine class. Callable directly with no DI/configuration required; optionally wired to host configuration viaSetConfigurationProvider.SanitizationExtensions— string extension methods (SanitizeForLog,SanitizeForFilePath,SanitizeForSensitiveData,SanitizeForRegexInjection, and*WithDetailsvariants, plusMask). The primary call-site API — no DI required.ISanitizationService— DI-facing contract wrapping the engine, sourced from host configuration.ISanitizationSettingsProvider— bridges a host's configuration/options system into the engine.SanitizationSettings— the full configurable surface for every sanitization concern.SanitizationResult/SensitiveDataResult— operation result models (Unchanged/Modified/Rejectedfactories).SanitizationType,SanitizationStrategy,SensitiveDataDetectionStrictness— enums.NoOpSanitizationService— safe-off floor so dependents always resolve when the feature is disabled.
Namespaces
using PowerCSharp.Feature.Sanitization.Abstractions; // SanitizationEngine, SanitizationExtensions, SanitizationSettings, results
using PowerCSharp.Feature.Sanitization.Abstractions.Enums; // SanitizationType, SanitizationStrategy, SensitiveDataDetectionStrictness
using PowerCSharp.Feature.Sanitization.Abstractions.NoOp; // NoOpSanitizationService
Usage without DI
using PowerCSharp.Feature.Sanitization.Abstractions;
string safeForLog = untrustedInput.SanitizeForLog(); // CWE-117
string safeForPath = untrustedSegment.SanitizeForFilePath(); // CWE-22 (throws if rejected under strict validation)
string masked = payload.SanitizeForSensitiveData(); // CWE-200
string safePattern = untrustedPattern.SanitizeForRegexInjection(); // CWE-400/CWE-730
Every method accepts an optional SanitizationSettings argument; when omitted, it uses whatever was wired via SanitizationEngine.SetConfigurationProvider (see PowerCSharp.Feature.Sanitization), or built-in defaults otherwise.
Feature module
The Features-Framework module (options, DI wiring, ASP.NET Core integration) lives in PowerCSharp.Feature.Sanitization. This package has no dependency on it and works standalone.
Details
- Package ID:
PowerCSharp.Feature.Sanitization.Abstractions - Depends on:
Microsoft.Extensions.Logging.Abstractions,System.Text.Json - Target frameworks:
netstandard2.0andnet8.0
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. 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. |
| .NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
| .NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen40 was computed. tizen60 was computed. |
| Xamarin.iOS | xamarinios was computed. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.0
- Microsoft.Extensions.Logging.Abstractions (>= 8.0.0)
- System.Text.Json (>= 10.0.8)
-
net8.0
- Microsoft.Extensions.Logging.Abstractions (>= 8.0.0)
- System.Text.Json (>= 10.0.8)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on PowerCSharp.Feature.Sanitization.Abstractions:
| Package | Downloads |
|---|---|
|
PowerCSharp.Feature.Sanitization
Sanitization feature module, options, and DI/Features-Framework wiring for log-injection, file-path traversal, sensitive-data, and regex-injection sanitization. Pair with PowerCSharp.Feature.Sanitization.Abstractions. |
GitHub repositories
This package is not used by any popular GitHub repositories.