SecurityConfig.fromJson constructor
Creates a SecurityConfig from a JSON map.
Implementation
factory SecurityConfig.fromJson(Map<String, dynamic> json) {
return SecurityConfig(
enableTLS: json['enableTLS'] as bool? ?? false,
tlsCertificatePath: json['tlsCertificatePath'] as String?,
tlsPrivateKeyPath: json['tlsPrivateKeyPath'] as String?,
enableKeyRotation: json['enableKeyRotation'] as bool? ?? true,
keyRotationInterval: Duration(
days: json['keyRotationDays'] as int? ?? 30,
),
maxAuthAttempts: json['maxAuthAttempts'] as int? ?? 3,
enableRateLimiting: json['enableRateLimiting'] as bool? ?? true,
maxRequestsPerMinute: json['maxRequestsPerMinute'] as int? ?? 100,
dhtDifficulty: json['dhtDifficulty'] as int? ?? 0,
);
}