Class BannedIPAddressService
- Namespace
- Dynamicweb.SystemTools.Security
- Assembly
- Dynamicweb.dll
public abstract class BannedIPAddressService : ICacheStorage<string, BannedIPAddress>, ICacheStorage<string>, ICacheStorage
- Inheritance
-
BannedIPAddressService
- Implements
- Inherited Members
Properties
Info
Represents the Cache information
public abstract CacheInformation Info { get; }
Property Value
Methods
BanIP(string, DateTime)
Bans the specified IP for till the specified expiration time.
public abstract void BanIP(string ipAddress, DateTime banExpiration)
Parameters
ipAddressstringThe IP address to ban. Use Context.Current.Request.GetClientIPAddress() to get IP address of current user
banExpirationDateTimeThe ban expiration datetime.
BanIP(string, DateTime, string)
Bans the specified IP for till the specified expiration time.
public abstract void BanIP(string ipAddress, DateTime banExpiration, string cause)
Parameters
ipAddressstringThe IP address to ban. Use Context.Current.Request.GetClientIPAddress() to get IP address of current user
banExpirationDateTimeThe ban expiration datetime.
causestringReason why the IP address was banned
BanIP(string, string)
Bans the specified IP.
public abstract void BanIP(string ipAddress, string cause)
Parameters
ipAddressstringThe IP address to ban. Use Context.Current.Request.GetClientIPAddress() to get IP address of current user
causestringReason why the IP address was banned
ClearCache()
Clears Cache
public abstract void ClearCache()
ClearCache(IEnumerable<string>)
Clears Cache by IP addresses collection
public abstract void ClearCache(IEnumerable<string> keys)
Parameters
keysIEnumerable<string>The collection of IP addresses
ClearCache(string)
Clears Cache by IP address
public abstract void ClearCache(string key)
Parameters
keystringThe IP address
GetBannedIPAddressData(string)
Gets the banned IP address information
public abstract BannedIPAddress? GetBannedIPAddressData(string ipAddress)
Parameters
ipAddressstringThe IP address.
Returns
IsIPBanned(string)
Determines whether the specified IP is banned.
public abstract bool IsIPBanned(string ipAddress)
Parameters
ipAddressstringThe IP address.
Returns
IsPrivateIPAddress(string)
Shows whether the specified IP address is private IP address.
public abstract bool IsPrivateIPAddress(string ipAddress)
Parameters
ipAddressstringThe IP address
Returns
IsWhitelistIPAddress(string)
Shows whether the specified IP address is on the whitelist.
public abstract bool IsWhitelistIPAddress(string ipAddress)
Parameters
ipAddressstringThe IP address
Returns
SetCacheType<TObjectCache>()
Sets the Cache type
public abstract void SetCacheType<TObjectCache>() where TObjectCache : ServiceCache<string, BannedIPAddress>
Type Parameters
TObjectCache