2using System.Reflection;
3using System.Threading.Tasks;
29 Types.OnInvalidated += (sender, e) => InitServices();
32 private static void InitServices()
45 Services.Add(Service);
53 localizationServices = Services.ToArray();
101 string Endpoint = State.
Request.RemoteEndPoint.RemovePortNumber();
102 string Country = await this.country.EvaluateAsync(State.
Variables,
string.Empty);
103 string Region = await this.region.EvaluateAsync(State.
Variables,
string.Empty);
104 string City = await this.city.EvaluateAsync(State.
Variables,
string.Empty);
105 string Key = Endpoint +
"|Loc|" + Country +
"|" + Region +
"|" + City;
107 if (!State.TryGetCachedObject(Key, out
bool IsMatch))
123 CheckMatch(Loc.CountryCode, Country) &&
124 CheckMatch(Loc.Region, Region) &&
125 CheckMatch(Loc.City, City);
134 private static bool CheckMatch(
string Value,
string List)
136 if (
string.IsNullOrEmpty(List))
139 string[] Items = List.Split(
',', StringSplitOptions.RemoveEmptyEntries);
141 foreach (
string Item
in Items)
143 if (
string.Equals(Value, Item.Trim(), StringComparison.OrdinalIgnoreCase))
Static class managing the application event log. Applications and services log events on this static ...
static void Exception(Exception Exception, string Object, string Actor, string EventId, EventLevel Level, string Facility, string Module, params KeyValuePair< string, object >[] Tags)
Logs an exception. Event type will be determined by the severity of the exception.
A chunked list is a linked list of chunks of objects of type T .
Static class that dynamically manages types and interfaces available in the runtime environment.
static Type[] GetTypesImplementingInterface(string InterfaceFullName)
Gets all types implementing a given interface.
static ConstructorInfo GetDefaultConstructor(Type Type)
Gets the default constructor of a type, if one exists.
Checks if the requests come from a specific location, using available locale information derived from...
override WafAction Create(XmlElement Xml, WafAction Parent, WebApplicationFirewall Document)
Creates a WAF action from its XML definition.
FromIpLocation()
Checks if the requests come from a specific location, using available locale information derived from...
FromIpLocation(XmlElement Xml, WafAction Parent, WebApplicationFirewall Document)
Checks if the requests come from a specific location, using available locale information derived from...
override string LocalName
XML Local Name for the XML element defining the action.
override async Task< WafResult?> Review(ProcessingState State)
Reviews the processing state, and returns a WAF result, if any.
Abstract base class for Web Application Firewall comparisons.
Contains the current state of a review process.
Variables Variables
Set of variables.
void AddToCache(string Key, object Value)
Adds a value to the cache.
HttpRequest Request
Current HTTP Request
Abstract base class for Web Application Firewall actions.
WebApplicationFirewall Document
Web Application Firewall document.
static readonly TimeSpan fiveMinutes
Five minutes time span.
async Task< WafResult?> ReviewChildren(ProcessingState State)
Reviews the processing state, and returns a WAF result, if any.
Web Application Firewall for HttpServer.
Interface for Enndpoint localizations.
Interface for Enndpoint localizations.
Task< IEndpointLocalization > TryGetLocation(string Endpoint)
Tries to get localization information about an endpoint.