Unosquare
    Show / Hide Table of Contents

    Class IPBanningModuleExtensions

    Provides extension methods for IPBanningModule and derived classes.

    Inheritance
    Object
    IPBanningModuleExtensions
    Inherited Members
    Object.ToString()
    Object.Equals(Object)
    Object.Equals(Object, Object)
    Object.ReferenceEquals(Object, Object)
    Object.GetHashCode()
    Object.GetType()
    Object.MemberwiseClone()
    Namespace: EmbedIO.Security
    Syntax
    public static class IPBanningModuleExtensions

    Methods

    WithMaxRequestsPerSecond<TModule>(TModule, Int32)

    Sets a maximum amount of requests per second as a criterion for banning IP addresses.

    Declaration
    public static TModule WithMaxRequestsPerSecond<TModule>(this TModule this, int maxRequests = 50)
        where TModule : IPBanningModule
    Parameters
    Type Name Description
    TModule this

    The module on which this method is called.

    Int32 maxRequests

    The maximum requests per second.

    Returns
    Type Description
    TModule

    this with a maximum requests per second configured.

    Type Parameters
    Name Description
    TModule

    The type of the module.

    WithRegexRules<TModule>(TModule, Int32, Int32, String[])

    Add a collection of Regex to match the log messages against as a criterion for banning IP addresses.

    Declaration
    public static TModule WithRegexRules<TModule>(this TModule this, int maxMatchCount, int secondsMatchingPeriod, params string[] value)
        where TModule : IPBanningModule
    Parameters
    Type Name Description
    TModule this

    The module on which this method is called.

    Int32 maxMatchCount

    The maximum match count.

    Int32 secondsMatchingPeriod

    The seconds matching period.

    String[] value

    A collection of regex to match log messages against.

    Returns
    Type Description
    TModule

    this with a fail regex criterion configured.

    Type Parameters
    Name Description
    TModule

    The type of the module.

    WithRegexRules<TModule>(TModule, String[])

    Add a collection of Regex to match the log messages against as a criterion for banning IP addresses.

    Declaration
    public static TModule WithRegexRules<TModule>(this TModule this, params string[] value)
        where TModule : IPBanningModule
    Parameters
    Type Name Description
    TModule this

    The module on which this method is called.

    String[] value

    A collection of regex to match log messages against.

    Returns
    Type Description
    TModule

    this with a fail regex criterion configured.

    Type Parameters
    Name Description
    TModule

    The type of the module.

    WithWhitelist<TModule>(TModule, String[])

    Adds a collection of valid IPs that never will be banned.

    Declaration
    public static TModule WithWhitelist<TModule>(this TModule this, params string[] value)
        where TModule : IPBanningModule
    Parameters
    Type Name Description
    TModule this

    The module on which this method is called.

    String[] value

    A collection of valid IPs that never will be banned.

    Returns
    Type Description
    TModule

    this with its whitelist configured.

    Type Parameters
    Name Description
    TModule

    The type of the module.

    Comments

    Back to top Copyright © 2017-2019 Unosquare