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
                    
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="PowerCSharp.Feature.Sanitization.Abstractions" Version="1.0.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="PowerCSharp.Feature.Sanitization.Abstractions" Version="1.0.1" />
                    
Directory.Packages.props
<PackageReference Include="PowerCSharp.Feature.Sanitization.Abstractions" />
                    
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 PowerCSharp.Feature.Sanitization.Abstractions --version 1.0.1
                    
#r "nuget: PowerCSharp.Feature.Sanitization.Abstractions, 1.0.1"
                    
#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 PowerCSharp.Feature.Sanitization.Abstractions@1.0.1
                    
#: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=PowerCSharp.Feature.Sanitization.Abstractions&version=1.0.1
                    
Install as a Cake Addin
#tool nuget:?package=PowerCSharp.Feature.Sanitization.Abstractions&version=1.0.1
                    
Install as a Cake Tool

PowerCSharp.Feature.Sanitization.Abstractions

PowerCSharp Banner

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.0 and net8.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 (the ILogger parameter on the NoOp service) and System.Text.Json (used internally by the log-injection JSON-encoding strategy).
  • The engine is fail-safe: sanitization methods never throw. Only SanitizeForFilePath and SanitizeForRegexInjection can reject an input (via IsRejected on 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 via SetConfigurationProvider.
  • SanitizationExtensions — string extension methods (SanitizeForLog, SanitizeForFilePath, SanitizeForSensitiveData, SanitizeForRegexInjection, and *WithDetails variants, plus Mask). 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 / Rejected factories).
  • 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.0 and net8.0
Product 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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.

Version Downloads Last Updated
1.0.1 108 7/23/2026
1.0.0 107 7/23/2026