DVMiddlewareSettings class

Configuration the built middleware need, with defaults that are safe when an application sets nothing.

Deliberately static and small. A middleware key names a behaviour, not a configuration, so the alternative was inventing a per-route argument syntax for an annotation that has never had one.

Constructors

DVMiddlewareSettings()

Properties

hashCode → int
The hash code for this object.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

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 Properties

authUserId ↔ Future<String?> Function(Object? request)?
Who this request is, for DVMiddlewares.auth.
getter/setter pair
contentSecurityPolicy ↔ String?
The Content-Security-Policy a route declaring csp sends.
getter/setter pair
featureFlags ↔ Map<String, FutureOr<bool> Function(Object? request)>
Flags resolved per request for DVMiddlewares.featureFlags.
getter/setter pair
locales ↔ List<String>
Locales DVMiddlewares.locale negotiates against.
getter/setter pair
maintenanceAllows ↔ List<String>
Paths that stay reachable while it is down.
getter/setter pair
maintenanceBypassSecret ↔ String?
The header value that lets an operator through a maintenance window.
getter/setter pair
maintenanceIsDown ↔ FutureOr<bool> Function()
Whether the application is down. Default: it is not.
getter/setter pair
rateLimitMaxRequests ↔ int
Requests allowed per rateLimitWindow per caller.
getter/setter pair
rateLimitStore ↔ DVCacheAdapter?
Where the limit counts, when one process is not the whole deployment.
getter/setter pair
rateLimitWindow ↔ Duration
The window the limit counts over.
getter/setter pair
requireIdempotencyKey ↔ bool
Whether a state-changing request must carry an Idempotency-Key.
getter/setter pair
requireTenant ↔ bool
Whether a request that names no tenant is refused rather than served the default tenant's data.
getter/setter pair