IPageRequest Interface
Interface IPageRequest contains the meta data in as the firewall managed this page and it's access to it, a custom implementation of this Interface will be rejected by the firewall
Namespace:
Walter.Web.FireWallAssembly: Walter.Web.FireWall (in Walter.Web.FireWall.dll)
Remarks
Examples
C#
namespace MyWeb.Controllers { using Walter.Web.FireWall; using Walter.Web.FireWall.Annotations; using Walter.Web.FireWall.Filters; using Walter.Web.FireWall.Geo; using Walter.Web.FireWall.RuleEngine.Rules; [BlockDuration(seconds: 60, sliding: true, doubleDurationPerIncident: true)] public class HomeController : Controller { private readonly IPageRequest _page; private ILatLongRepository _latLongRepository; public HomeController(IPageRequest page, ILatLongRepository latLongRepository) { _page = page; _latLongRepository = latLongRepository; } [GeoIgnore(maxRequest: 5)] [Ignore(skip: FireWallGuardActions.RejectPenetrationAttempts | FireWallGuardActions.RejectRepeatViolations | FireWallGuardActions.RejectWrongUserType , skipCount: 5)] public IActionResult Blocked(BlockingReason id) { if (_page.User.AsFirewallUser().UserType.HasFlag(UserTypes.IsMalicious)) { return View("_Malicious", id); } return View(id); } [Minify] [HttpGet] [Users(blocked: UserTypes.IsMalicious , allow: UserTypes.IsHuman | UserTypes.IsSearchEngine | UserTypes.NotDiscovered , redirectToController: "home", redirectAction: "blocked", id: (int)BlockingReason.WrongConsumerType)] public async Task<IActionResult> Index() { if (!_page.User.TryReadCookie("Telephone", out var phone)) { phone = "001.123.567.89 ext 123"; } await _page.User.WriteCookieAsync("Telephone", phone, TimeSpan.FromSeconds(60)).ConfigureAwait(false); //_fireWall.SendEmail(EMailRoles.ProductUpdates, "test mail", "this is a test email", false);var model = new IndexModel(); model.UserQuery = new Query() { IPAddress = _page.IPAddress.ToString() }; model.UserResult = await _page.FireWall.WhoisAsync(_page).ConfigureAwait(false); model.Geography = _latLongRepository.QueryMapLocation(_page.IPAddress); return View(model); } } }