ASP-WAF Web application firewall for .Net 5, .Net Standard 2.1 and .Net Core 3.x

ReportFormat Enumeration

ReportFormat used when generating firewall reports

Namespace:  Walter.Web.FireWall.Reporting
Assembly:  Walter.Web.FireWall (in Walter.Web.FireWall.dll)

Syntax


public enum ReportFormat

Members


Member nameDescription
TextPlain return plain text
Json return json formatted text
Native generate native object is used internally and can't be passed to the report engine, if you do you will get json back

Examples


C#
using Walter.Web.FireWall;
   using Walter.Web.FireWall.Reporting;
   [ApiController]
   [Route("api/[controller]")]
   [Authorize]
   public class HealthController : Controller
   {
       private readonly ILogger<HealthController> _logger;
       private readonly IFireWall _fireWall;

       public HealthController(ILogger<HealthController> logger, IFireWall fireWall)
       {
           _logger = logger;
           _fireWall = fireWall;
       }

       [HttpGet]
       public string Get()
       {
          _logger?.Lazy().LogInformation("Call firewall heath report. Heath status:\n {status}",   _fireWall.Report(ReportTypes.DEFAULT));
          Response.ContentType = "application/json";
          return _fireWall.Report(ReportTypes.DEFAULT, ReportFormat.Json);
        }
   }