NetworkIsolationGuard class final

Installs/restores the outbound-socket interception. Idempotent and re-installable; uninstall restores the overrides that were active before install.

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

approvedAttempts List<({String host, String operation, int port})>
The approved connections recorded since install (unmodifiable).
no setter
isActive bool
Whether the guard currently intercepts outbound sockets.
no setter

Static Methods

install({List<SocketLane> whitelist = const []}) → void
Begin failing every non-whitelisted outbound socket attempt with NetworkIsolationViolation. whitelist lanes (FR-006) are permitted and logged as approved exceptions; the empty whitelist — the default — blocks every socket (safest default, unchanged #832 behavior). Calling install while already active is a no-op, so test setUpAll hooks can call it unconditionally.
uninstall() → void
Restore the pre-install overrides. Safe to call when the guard is not active (and when it was never installed).