DenylistService constructor

DenylistService(
  1. SecurityConfig _config,
  2. MetricsCollector _metrics, {
  3. String? storagePath,
  4. Client? httpClient,
})

Creates a denylist service from security configuration and metrics.

storagePath is an optional local file path used to persist a cached copy of the last successfully loaded list. When provided, the service falls back to the cached copy if the configured source is unavailable.

Implementation

DenylistService(
  this._config,
  this._metrics, {
  String? storagePath,
  http.Client? httpClient,
}) : _storagePath = storagePath,
     _httpClient = httpClient ?? http.Client(),
     _internalHttpClient = httpClient == null {
  _logger = Logger('DenylistService');
  _snapshot = _emptySnapshot();
}