NetworkAllowlist class final
The network safety gate consulted before any media fetch.
A MediaRepository calls check on every network URL before handing it to
the HTTP client. Only allowlisted hosts over allowlisted schemes pass;
everything else is a typed FluvieRenderException that names the offending
host or scheme. This keeps a render from reaching an arbitrary endpoint and
keeps the determinism story honest: the set of reachable origins is
declared up front, never discovered at fetch time.
- Annotations
Constructors
-
NetworkAllowlist({required Set<
String> hosts, Set<String> schemes = const {'https'}}) -
Creates an allowlist permitting exactly
hostsoverschemes.const -
NetworkAllowlist.allowAny({Set<
String> schemes = const {'https'}}) -
An allowlist that permits any host over
schemes(defaults to https).factory
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
-
hosts
→ Set<
String> -
The hosts permitted to be fetched (exact match, case-sensitive).
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
schemes
→ Set<
String> -
The URL schemes permitted (lower-case, for example
https).final
Methods
-
check(
Uri url) → void -
Throws a FluvieRenderException when
urlis not permitted; returns normally otherwise. -
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