Skip to content

Commit 594ebb3

Browse files
borisahrensBoris Ahrens
andauthored
Remove mvc (#316)
* Refactoring --------- Co-authored-by: Boris Ahrens <[email protected]>
1 parent 50c7665 commit 594ebb3

21 files changed

+12
-79
lines changed

src/MalwareSampleExchange.Console/Controllers/SampleApiController.cs

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,9 @@
1-
using System;
2-
using System.Collections.Generic;
31
using System.ComponentModel.DataAnnotations;
4-
using System.IO;
5-
using System.Threading;
6-
using System.Threading.Tasks;
72
using JWT.Algorithms;
83
using Microsoft.AspNetCore.Mvc;
94
using JWT.Builder;
105
using JWT.Exceptions;
116
using Microsoft.AspNetCore.Authorization;
12-
using Microsoft.AspNetCore.Http;
13-
using Microsoft.Extensions.Logging;
147
using Microsoft.Extensions.Options;
158
using MalwareSampleExchange.Console.Attributes;
169
using MalwareSampleExchange.Console.Models;
@@ -52,7 +45,7 @@ public SampleApiController(ISampleStorageHandler sampleStorageHandler, ILogger<S
5245
/// <param name="token">download</param>
5346
/// <param name="cancellationToken"></param>
5447
[HttpGet]
55-
[Route("downloads/v1/download")]
48+
[Route("v1/download")]
5649
[AllowAnonymous]
5750
[ValidateModelState]
5851
[SwaggerResponse(StatusCodes.Status400BadRequest, "The token is expired.")]

src/MalwareSampleExchange.Console/Controllers/TokensApiController.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public TokensApiController(ILogger<TokensApiController> logger, IListRequester l
3939
/// <param name="end">(Default: today's date )</param>
4040
/// <param name="token"></param>
4141
[HttpGet]
42-
[Route("lists/v1/list")]
42+
[Route("v1/list")]
4343
[ValidateModelState]
4444
[SwaggerResponse(StatusCodes.Status400BadRequest, "Start Date has to be before end date")]
4545
[SwaggerResponse(StatusCodes.Status401Unauthorized, "Unauthorized!")]

src/MalwareSampleExchange.Console/Controllers/UploadApiController.cs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,7 @@
1-
using System;
21
using System.ComponentModel.DataAnnotations;
32
using System.Security.Claims;
4-
using System.Threading;
5-
using System.Threading.Tasks;
63
using Microsoft.AspNetCore.Authorization;
7-
using Microsoft.AspNetCore.Http;
84
using Microsoft.AspNetCore.Mvc;
9-
using Microsoft.Extensions.Logging;
105
using MalwareSampleExchange.Console.Database;
116
using MalwareSampleExchange.Console.Models;
127
using MalwareSampleExchange.Console.SampleStorage;

src/MalwareSampleExchange.Console/Database/IPartnerProvider.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
using System.Collections.Generic;
2-
using MalwareSampleExchange.Console.Models;
3-
41
namespace MalwareSampleExchange.Console.Database;
52

63
public interface IPartnerProvider

src/MalwareSampleExchange.Console/Database/MongoMetadataOptions.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
using System;
2-
31
namespace MalwareSampleExchange.Console.Database;
42

53
public class MongoMetadataOptions

src/MalwareSampleExchange.Console/ListRequester/Hashing.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
using System;
2-
using System.Collections.Generic;
3-
using System.Linq;
41
using System.Security.Cryptography;
52
using System.Text;
63

src/MalwareSampleExchange.Console/ListRequester/ListRequesterOptions.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
using System;
2-
31
namespace MalwareSampleExchange.Console.ListRequester;
42

53
public class ListRequesterOptions

src/MalwareSampleExchange.Console/LogEvents.cs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,10 @@
1-
using Microsoft.Extensions.Logging;
2-
31
#pragma warning disable 1591
42

53
namespace MalwareSampleExchange.Console;
64

75
public static class LogEvents
86
{
97
private static readonly int Id;
10-
//Trace
11-
public static EventId HashListResponse = new(++Id, nameof(HashListResponse));
128
public static EventId HashListRequest = new(++Id, nameof(HashListRequest));
139
public static EventId UnknownPartner = new(++Id, nameof(UnknownPartner));
1410
public static EventId TokenExpired = new(++Id, nameof(TokenExpired));

src/MalwareSampleExchange.Console/Models/Error.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
using System;
21
using System.ComponentModel.DataAnnotations;
32
using System.Runtime.Serialization;
43
using System.Text;

src/MalwareSampleExchange.Console/Models/ExportSample.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
using System;
21
using MongoDB.Bson.Serialization.Attributes;
32

43
namespace MalwareSampleExchange.Console.Models;

0 commit comments

Comments
 (0)