MERSEL.Services.XsltService.Client
1.3.1
dotnet add package MERSEL.Services.XsltService.Client --version 1.3.1
NuGet\Install-Package MERSEL.Services.XsltService.Client -Version 1.3.1
<PackageReference Include="MERSEL.Services.XsltService.Client" Version="1.3.1" />
<PackageVersion Include="MERSEL.Services.XsltService.Client" Version="1.3.1" />
<PackageReference Include="MERSEL.Services.XsltService.Client" />
paket add MERSEL.Services.XsltService.Client --version 1.3.1
#r "nuget: MERSEL.Services.XsltService.Client, 1.3.1"
#:package MERSEL.Services.XsltService.Client@1.3.1
#addin nuget:?package=MERSEL.Services.XsltService.Client&version=1.3.1
#tool nuget:?package=MERSEL.Services.XsltService.Client&version=1.3.1
MERSEL.Services.XsltService.Client
MERSEL.Services.XsltService mikroservisinin validate ve transform endpointlerini HTTP ile çağıran .NET istemci paketidir.
Install
dotnet add package MERSEL.Services.XsltService.Client
DI Registration
// appsettings.json -> Services:XsltService:BaseUrl
builder.Services.AddXsltServiceClient(builder.Configuration);
// or direct URL
builder.Services.AddXsltServiceClient("http://localhost:8080");
appsettings.json
{
"Services": {
"XsltService": {
"BaseUrl": "http://localhost:8080"
}
}
}
Usage
using MERSEL.Services.XsltService.Client.Interfaces;
using MERSEL.Services.XsltService.Client.Models;
public sealed class InvoiceService(IXsltServiceClient xsltClient)
{
public async Task<ValidationResponse?> ValidateAsync(byte[] xml, CancellationToken ct)
{
var response = await xsltClient.ValidateAsync(new ValidationRequest
{
Source = xml,
Profile = "unsigned",
Suppressions = new[] { "InvoiceIDCheck" },
Parameters = new[] { new SchematronParameter("type", "TEMELFATURA") }
}, ct);
return response.Result;
}
public async Task<string> TransformAsync(byte[] xml, CancellationToken ct)
{
var transformed = await xsltClient.TransformAsync(new TransformRequest
{
Document = xml,
TransformType = TransformType.INVOICE,
UseEmbeddedXslt = true
}, ct);
return transformed.HtmlContent;
}
}
Security Violation Detection
Transform yanıtlarında sunucu tarafında otomatik HTML sanitization uygulanır. Exfiltration riski taşıyan scriptler kaldırılır ve detayları response header'larından okunur.
var result = await xsltClient.TransformAsync(new TransformRequest
{
Document = xml,
TransformType = TransformType.INVOICE
}, ct);
// Güvenlik ihlali var mı?
if (result.HasSecurityViolations)
{
logger.LogWarning(
"{Count} script kaldırıldı. İhlaller: {Violations}",
result.ScriptsRemoved,
string.Join("; ", result.SecurityViolations));
}
| Property | Tip | Açıklama |
|---|---|---|
ScriptsRemoved |
int |
Kaldırılan script sayısı |
SecurityViolations |
IReadOnlyList<string> |
İhlal detay listesi |
HasSecurityViolations |
bool |
SecurityViolations.Count > 0 |
Olası violation mesajları: cookie access, domain manipulation, localStorage access, sessionStorage access, redirect/exfiltration via location, window.open exfiltration, XHR network call, fetch API network call, sendBeacon exfiltration, WebSocket connection, cross-origin messaging, dynamic code execution (eval), dynamic code execution (Function constructor), dynamic module import, UI blocking dialog (alert), UI blocking dialog (confirm), UI blocking dialog (prompt).
Targets
net6.0net7.0net8.0net9.0
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net6.0 is compatible. 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 is compatible. 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 is compatible. 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. |
-
net6.0
- Microsoft.Extensions.Configuration.Abstractions (>= 8.0.0)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 8.0.0)
- Microsoft.Extensions.Http (>= 8.0.0)
-
net7.0
- Microsoft.Extensions.Configuration.Abstractions (>= 8.0.0)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 8.0.0)
- Microsoft.Extensions.Http (>= 8.0.0)
-
net8.0
- Microsoft.Extensions.Configuration.Abstractions (>= 8.0.0)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 8.0.0)
- Microsoft.Extensions.Http (>= 8.0.0)
-
net9.0
- Microsoft.Extensions.Configuration.Abstractions (>= 8.0.0)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 8.0.0)
- Microsoft.Extensions.Http (>= 8.0.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.