mirror of
https://github.com/volodymyrsmirnov/MalwareMultiScan.git
synced 2025-08-25 22:01:16 +00:00
change the communication protocol to RMQ
This commit is contained in:
@@ -17,6 +17,8 @@ namespace MalwareMultiScan.Backends.Backends.Implementations
|
||||
protected override Regex MatchRegex { get; } =
|
||||
new Regex(@"(\S+): (?<threat>[\S]+) FOUND", RegexOptions.Compiled | RegexOptions.Multiline);
|
||||
|
||||
protected override bool ThrowOnNonZeroExitCode { get; } = false;
|
||||
|
||||
protected override string GetBackendArguments(string path)
|
||||
{
|
||||
return $"--no-summary {path}";
|
||||
|
@@ -0,0 +1,39 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using MalwareMultiScan.Shared.Interfaces;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
|
||||
namespace MalwareMultiScan.Backends.Backends.Implementations
|
||||
{
|
||||
public class DummyScanBackend : IScanBackend
|
||||
{
|
||||
public string Id { get; } = "dummy";
|
||||
|
||||
public Task<string[]> ScanAsync(string path, CancellationToken cancellationToken)
|
||||
{
|
||||
return Scan();
|
||||
}
|
||||
|
||||
public Task<string[]> ScanAsync(Uri uri, CancellationToken cancellationToken)
|
||||
{
|
||||
return Scan();
|
||||
}
|
||||
|
||||
public Task<string[]> ScanAsync(IFormFile file, CancellationToken cancellationToken)
|
||||
{
|
||||
return Scan();
|
||||
}
|
||||
|
||||
public Task<string[]> ScanAsync(Stream stream, CancellationToken cancellationToken)
|
||||
{
|
||||
return Scan();
|
||||
}
|
||||
|
||||
private static Task<string[]> Scan()
|
||||
{
|
||||
return Task.FromResult(new[] {"Malware.Dummy.Result"});
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user