DVSessionScope class final
Which hosts share one browser session.
Constructors
-
DVSessionScope.host({List<
String> hosts = const <String>[]}) -
Every host keeps a host-only
__Host-cookie.hostsare the application's own serving hosts, when it declares any: a state-changing request from anywhere else is refused.const -
DVSessionScope.site({required String domain, required List<
String> hosts}) -
The session spans every one of
hostsunderdomain.const
Properties
- domain → String?
-
The registrable domain (or a parent of every covered host under it) the
session cookie is set for, or null for host-only cookies.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
-
hosts
→ List<
String> -
The application's own serving hosts: exact names and
*.patterns fromdartvel.hosts, redirecting hosts left out.final - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
allowsOrigin(
String? origin, {String? host, bool secure = true, Iterable< String> alsoAllowed = const <String>[]}) → bool -
Whether a state-changing request carrying
origin, made tohost, is the application's own. -
covers(
String? host) → bool -
Whether a request on
hostgets the domain cookie: the application declares it, and it is domain or below it. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toJson(
) → Map< String, Object?> -
toString(
) → String -
A string representation of this object.
override
-
validate(
) → void - Throws DVSessionConfigError when domain is a public suffix, not a domain at all, or covers none of hosts: the start-time half of what resolve reports at build time.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
requestHost(
Request request) → String? -
The host
requestwas made for:X-Forwarded-Hostfrom a peerdartvel.server.trustedProxiestrusts,Hostotherwise. -
requestSecure(
Request request) → bool -
Whether
requestarrived over https, as the proxy in front says (x-forwarded-proto) or the request's own URL does. -
resolve(
{required DVHosts hosts, Object? auth}) → DVSessionScopeResolution -
The scope
dartvel.hostsanddartvel.authdescribe.