Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
IsBlocked.cs
1using System;
2using System.Threading.Tasks;
3using System.Xml;
5
7{
11 public class IsBlocked : WafComparison
12 {
16 public IsBlocked()
17 : base()
18 {
19 }
20
27 public IsBlocked(XmlElement Xml, WafAction Parent, WebApplicationFirewall Document)
28 : base(Xml, Parent, Document)
29 {
30 }
31
35 public override string LocalName => nameof(IsBlocked);
36
44 public override WafAction Create(XmlElement Xml, WafAction Parent, WebApplicationFirewall Document) => new IsBlocked(Xml, Parent, Document);
45
51 public override async Task<WafResult?> Review(ProcessingState State)
52 {
53 DateTime? TP = await State.Firewall.LoginAuditor.GetEarliestLoginOpportunity(State.Request.RemoteEndPoint, "HTTP");
54
55 if (TP.HasValue)
56 return await this.ReviewChildren(State);
57 else
58 return null;
59 }
60 }
61}
Checks if the remote endpoint of the request is blocked.
Definition: IsBlocked.cs:12
override async Task< WafResult?> Review(ProcessingState State)
Reviews the processing state, and returns a WAF result, if any.
Definition: IsBlocked.cs:51
override string LocalName
XML Local Name for the XML element defining the action.
Definition: IsBlocked.cs:35
IsBlocked()
Checks if the remote endpoint of the request is blocked.
Definition: IsBlocked.cs:16
override WafAction Create(XmlElement Xml, WafAction Parent, WebApplicationFirewall Document)
Creates a WAF action from its XML definition.
IsBlocked(XmlElement Xml, WafAction Parent, WebApplicationFirewall Document)
Checks if the remote endpoint of the request is blocked.
Definition: IsBlocked.cs:27
Abstract base class for Web Application Firewall comparisons.
Definition: WafComparison.cs:9
Contains the current state of a review process.
WebApplicationFirewall Firewall
Reference to the current Web Application Firewall object.
HttpRequest Request
Current HTTP Request
Abstract base class for Web Application Firewall actions.
Definition: WafAction.cs:17
WebApplicationFirewall Document
Web Application Firewall document.
Definition: WafAction.cs:60
async Task< WafResult?> ReviewChildren(ProcessingState State)
Reviews the processing state, and returns a WAF result, if any.
Definition: WafActions.cs:72
Web Application Firewall for HttpServer.
ILoginAuditor LoginAuditor
Login Auditor used by the Firewall.
Task< DateTime?> GetEarliestLoginOpportunity(string RemoteEndPoint, string Protocol)
Checks when a remote endpoint can login.