File tree Expand file tree Collapse file tree 6 files changed +26
-9
lines changed Expand file tree Collapse file tree 6 files changed +26
-9
lines changed Original file line number Diff line number Diff line change @@ -13,7 +13,9 @@ namespace DevProxy.ApiControllers;
13
13
14
14
[ ApiController ]
15
15
[ Route ( "[controller]" ) ]
16
- sealed class ProxyController ( IProxyStateController proxyStateController , IProxyConfiguration proxyConfiguration ) : ControllerBase
16
+ #pragma warning disable CA1515 // required for the API controller
17
+ public sealed class ProxyController ( IProxyStateController proxyStateController , IProxyConfiguration proxyConfiguration ) : ControllerBase
18
+ #pragma warning restore CA1515
17
19
{
18
20
private readonly IProxyStateController _proxyStateController = proxyStateController ;
19
21
private readonly IProxyConfiguration _proxyConfiguration = proxyConfiguration ;
@@ -52,7 +54,9 @@ public async Task<IActionResult> SetAsync([FromBody] ProxyInfo proxyInfo)
52
54
}
53
55
54
56
[ HttpPost ( "mockRequest" ) ]
57
+ #pragma warning disable CA1030
55
58
public async Task RaiseMockRequestAsync ( )
59
+ #pragma warning restore CA1030
56
60
{
57
61
await _proxyStateController . MockRequestAsync ( ) ;
58
62
Response . StatusCode = 202 ;
Original file line number Diff line number Diff line change 7
7
8
8
namespace DevProxy . ApiControllers ;
9
9
10
- sealed class ProxyInfo
10
+ #pragma warning disable CA1515 // required for the API controller
11
+ public sealed class ProxyInfo
12
+ #pragma warning restore CA1515
11
13
{
12
14
public bool ? Recording { get ; set ; }
13
15
public string ? ConfigFile { get ; init ; }
14
16
15
17
public static ProxyInfo From ( IProxyState proxyState , IProxyConfiguration proxyConfiguration )
16
18
{
19
+ ArgumentNullException . ThrowIfNull ( proxyState ) ;
20
+ ArgumentNullException . ThrowIfNull ( proxyConfiguration ) ;
21
+
17
22
return new ProxyInfo
18
23
{
19
24
ConfigFile = proxyConfiguration . ConfigFile ,
Original file line number Diff line number Diff line change 4
4
5
5
namespace DevProxy . Jwt ;
6
6
7
- sealed class JwtOptions
7
+ #pragma warning disable CA1515 // required for the API controller
8
+ public sealed class JwtOptions
9
+ #pragma warning restore CA1515
8
10
{
9
11
public IEnumerable < string > ? Audiences { get ; set ; }
10
- public Dictionary < string , string > ? Claims { get ; set ; }
12
+ public Dictionary < string , string > ? Claims { get ; init ; }
11
13
public string ? Issuer { get ; set ; }
12
14
public string ? Name { get ; set ; }
13
15
public IEnumerable < string > ? Roles { get ; set ; }
Original file line number Diff line number Diff line change 3
3
// See the LICENSE file in the project root for more information.
4
4
5
5
using DevProxy . Abstractions . Proxy ;
6
+ using System . Collections . ObjectModel ;
6
7
7
8
namespace DevProxy . Proxy ;
8
9
9
- interface IProxyState
10
+ #pragma warning disable CA1515 // required for the API controller
11
+ public interface IProxyState
12
+ #pragma warning restore CA1515
10
13
{
11
- Dictionary < string , object > GlobalData { get ; set ; }
14
+ Dictionary < string , object > GlobalData { get ; }
12
15
bool IsRecording { get ; set ; }
13
- List < RequestLog > RequestLogs { get ; set ; }
16
+ Collection < RequestLog > RequestLogs { get ; }
14
17
}
Original file line number Diff line number Diff line change 4
4
5
5
namespace DevProxy . Proxy ;
6
6
7
- interface IProxyStateController
7
+ #pragma warning disable CA1515 // required for the API controller
8
+ public interface IProxyStateController
9
+ #pragma warning restore CA1515
8
10
{
9
11
IProxyState ProxyState { get ; }
10
12
void StartRecording ( ) ;
Original file line number Diff line number Diff line change 4
4
5
5
using DevProxy . Abstractions . Proxy ;
6
6
using DevProxy . Abstractions . Utils ;
7
+ using System . Collections . ObjectModel ;
7
8
8
9
namespace DevProxy . Proxy ;
9
10
10
11
sealed class ProxyState : IProxyState
11
12
{
12
13
public bool IsRecording { get ; set ; }
13
- public List < RequestLog > RequestLogs { get ; set ; } = [ ] ;
14
+ public Collection < RequestLog > RequestLogs { get ; set ; } = [ ] ;
14
15
public Dictionary < string , object > GlobalData { get ; set ; } = new ( ) {
15
16
{ ProxyUtils . ReportsKey , new Dictionary < string , object > ( ) }
16
17
} ;
You can’t perform that action at this time.
0 commit comments