mirror of
https://github.com/nsnail/Ocelot.git
synced 2025-08-05 00:12:27 +08:00
add a security module (#628) (#629)
* Add security mechanisms, IP whitelists, blacklists, and extended security interfaces. * Optimized configuration name * Fix IP Security Bug * Repair Security Protection Module Bug * Add security module unit test * Optimize log prompts
This commit is contained in:
@ -30,7 +30,8 @@
|
||||
private Mock<IDownstreamAddressesCreator> _daCreator;
|
||||
private Mock<ILoadBalancerOptionsCreator> _lboCreator;
|
||||
private Mock<IReRouteKeyCreator> _rrkCreator;
|
||||
private FileConfiguration _fileConfig;
|
||||
private Mock<ISecurityOptionsCreator> _soCreator;
|
||||
private FileConfiguration _fileConfig;
|
||||
private ReRouteOptions _rro;
|
||||
private string _requestId;
|
||||
private string _rrk;
|
||||
@ -45,6 +46,7 @@
|
||||
private List<DownstreamHostAndPort> _dhp;
|
||||
private LoadBalancerOptions _lbo;
|
||||
private List<ReRoute> _result;
|
||||
private SecurityOptions _securityOptions;
|
||||
|
||||
public ReRoutesCreatorTests()
|
||||
{
|
||||
@ -61,6 +63,7 @@
|
||||
_daCreator = new Mock<IDownstreamAddressesCreator>();
|
||||
_lboCreator = new Mock<ILoadBalancerOptionsCreator>();
|
||||
_rrkCreator = new Mock<IReRouteKeyCreator>();
|
||||
_soCreator = new Mock<ISecurityOptionsCreator>();
|
||||
|
||||
_creator = new ReRoutesCreator(
|
||||
_cthCreator.Object,
|
||||
@ -75,7 +78,8 @@
|
||||
_hfarCreator.Object,
|
||||
_daCreator.Object,
|
||||
_lboCreator.Object,
|
||||
_rrkCreator.Object
|
||||
_rrkCreator.Object,
|
||||
_soCreator.Object
|
||||
);
|
||||
}
|
||||
|
||||
@ -266,6 +270,7 @@
|
||||
_hfarCreator.Verify(x => x.Create(fileReRoute), Times.Once);
|
||||
_daCreator.Verify(x => x.Create(fileReRoute), Times.Once);
|
||||
_lboCreator.Verify(x => x.Create(fileReRoute.LoadBalancerOptions), Times.Once);
|
||||
_soCreator.Verify(x => x.Create(fileReRoute.SecurityOptions), Times.Once);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user