GeoBlockAttribute Class
This annotation allows for the granular control GEO blocking in the firewall if GEO blocking modules are registered in service configuration
Namespace:
Walter.Web.FireWall.AnnotationsAssembly: Walter.Web.FireWall (in Walter.Web.FireWall.dll)
Remarks
Download any of the GEO blocking NuGet packages provided for the Firewall or write and register your own. Following NuGet packages are available but do require you to have your own data subscription:
Package Name | API | Database | File |
Walter.Web.FireWall.Geo.MaxMind | X | - | X |
Walter.Web.FireWall.Geo.IP2Location | X | X | - |
Walter.Web.FireWall.Geo.Google | X | - | - |
To create your own GEO provider implement one of these interfaces 1. ILatLongRepository (city and map coordinates), 2. IGeoAPIFactory (country code via API) 3. IGeoFactory (country code via database or file)
Examples
Register your own GEO blocking middleware
public static IServiceCollection AddGeoBlocking(this IServiceCollection serviceCollection, GeoMethod useMethod) { //update configuration and set the type of call it makes. serviceCollection.Configure<IFireWallConfig>(opt => opt.Geography.UseMethod = useMethod); serviceCollection.AddSingleton(typeof(IGeoFactory), typeof(MyGeoRepository)); return serviceCollection; }
Inheritance Hierarchy
Walter.Web.FireWall.Annotations..::..GeoBlockAttribute