DVWaf class

A rule set, the middleware that enforces it, and the adapter that pushes it to a platform firewall.

The middleware runs whether or not an adapter installed the rules: one that failed to push, or a request that reached the origin directly, is still refused.

Constructors

DVWaf(List<DVWafRule> rules, {DVWafCountryResolver? countryOf, DVWafAdapter? adapter, DateTime clock()?})

Properties

adapter → DVWafAdapter?
final
hashCode → int
The hash code for this object.
no setterinherited
lastMatched → Map<String, DateTime>
When each rule last matched a request in this process.
no setter
rules → List<DVWafRule>
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

decide({required String method, required String path, String? country}) → DVWafDecision
The first rule that matches, which decides.
deploy() → Future<void>
Pushes the rules to adapter. A failure is thrown, not swallowed; the middleware keeps enforcing either way.
lint() → List<DVWafFinding>
Rules that match every request, and rules that have matched nothing for staleAfter: a rule nobody can explain is a rule nobody dares delete.
middleware() → Middleware
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited

Static Methods

countryHeader(String header) → DVWafCountryResolver
Reads the country from a header a CDN sets, such as cf-ipcountry, when the request came straight from a trusted proxy.

Constants

staleAfter → const Duration
How long a rule may match nothing before it is reported.