An API Control Attribute that allows whitelist incoming requests based on IP address.
After cloning this repository and installing Visual Studio enter the project's folder through the command line and type the following code to run the program:
dotnet run
-
inject IpControlAttribute
services.AddScoped<IpControlAttribute>();
{
"WhiteList": {
"0.0.0.1": [ "Home", "Customer" ],
"0.0.0.2": [ "People" ]
},
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft": "Warning",
"Microsoft.Hosting.Lifetime": "Information"
}
},
"AllowedHosts": "*"
}