using EmbedIO.Security;
using System;
using System.Collections.Generic;
namespace EmbedIO
{
partial class WebModuleContainerExtensions
{
///
/// Creates an instance of and adds it to a module container.
///
/// The type of the module container.
/// The on which this method is called.
/// A collection of valid IPs that never will be banned.
/// Minutes that an IP will remain banned.
///
/// with an added.
///
public static TContainer WithIPBanning(this TContainer @this,
IEnumerable? whiteList = null,
int banMinutes = IPBanningModule.DefaultBanMinutes)
where TContainer : class, IWebModuleContainer =>
WithIPBanning(@this, null, whiteList, banMinutes);
///
/// Creates an instance of and adds it to a module container.
///
/// The type of the module container.
/// The on which this method is called.
/// The configure.
/// A collection of valid IPs that never will be banned.
/// Minutes that an IP will remain banned.
///
/// with an added.
///
public static TContainer WithIPBanning(this TContainer @this,
Action? configure,
IEnumerable? whiteList = null,
int banMinutes = IPBanningModule.DefaultBanMinutes)
where TContainer : class, IWebModuleContainer =>
WithModule(@this, new IPBanningModule("/", whiteList, banMinutes), configure);
}
}