feat: strengthen P0 security and operations
This commit is contained in:
30
Tiku.Application/Assets/IAssetSecurityScanner.cs
Normal file
30
Tiku.Application/Assets/IAssetSecurityScanner.cs
Normal file
@@ -0,0 +1,30 @@
|
||||
namespace Tiku.Application.Assets;
|
||||
|
||||
public enum AssetSecurityScanVerdict
|
||||
{
|
||||
Clean,
|
||||
Infected
|
||||
}
|
||||
|
||||
public sealed record AssetSecurityScanResult(
|
||||
AssetSecurityScanVerdict Verdict,
|
||||
string Provider,
|
||||
string? Signature,
|
||||
long BytesScanned,
|
||||
string RawResponse);
|
||||
|
||||
public interface IAssetSecurityScanner
|
||||
{
|
||||
Task<AssetSecurityScanResult> ScanAsync(
|
||||
Stream content,
|
||||
long? declaredLength,
|
||||
CancellationToken cancellationToken = default);
|
||||
|
||||
Task<bool> CheckHealthAsync(CancellationToken cancellationToken = default);
|
||||
}
|
||||
|
||||
public sealed class AssetSecurityScannerException(string code, string message, Exception? innerException = null)
|
||||
: Exception(message, innerException)
|
||||
{
|
||||
public string Code { get; } = code;
|
||||
}
|
||||
Reference in New Issue
Block a user