SecurityConfig constructor

const SecurityConfig({
  1. int maxPayloadSize = 1024 * 1024,
  2. double blockThreshold = 0.8,
  3. double flagThreshold = 0.5,
})

Creates a configuration. Defaults to a 1 MB payload limit and block/flag thresholds of 0.8/0.5.

Implementation

const SecurityConfig({
  this.maxPayloadSize = 1024 * 1024, // 1 MB
  this.blockThreshold = 0.8,
  this.flagThreshold = 0.5,
})  : assert(maxPayloadSize > 0, 'maxPayloadSize must be positive'),
      assert(
        flagThreshold <= blockThreshold,
        'flagThreshold must be <= blockThreshold',
      );