C# Class Bit.Api.Middleware.CustomIpRateLimitMiddleware

Inheritance: IpRateLimitMiddleware
Show file Open project: bitwarden/core

Public Methods

Method Description
CustomIpRateLimitMiddleware ( IMemoryCache memoryCache, IBlockIpService blockIpService, RequestDelegate next, IOptions options, IRateLimitCounterStore counterStore, IIpPolicyStore policyStore, ILogger logger, IIpAddressParser ipParser = null ) : System.Threading.Tasks
LogBlockedRequest ( HttpContext httpContext, ClientRequestIdentity identity, RateLimitCounter counter, RateLimitRule rule ) : void
ReturnQuotaExceededResponse ( HttpContext httpContext, RateLimitRule rule, string retryAfter ) : System.Threading.Tasks.Task

Method Details

CustomIpRateLimitMiddleware() public method

public CustomIpRateLimitMiddleware ( IMemoryCache memoryCache, IBlockIpService blockIpService, RequestDelegate next, IOptions options, IRateLimitCounterStore counterStore, IIpPolicyStore policyStore, ILogger logger, IIpAddressParser ipParser = null ) : System.Threading.Tasks
memoryCache IMemoryCache
blockIpService IBlockIpService
next RequestDelegate
options IOptions
counterStore IRateLimitCounterStore
policyStore IIpPolicyStore
logger ILogger
ipParser IIpAddressParser
return System.Threading.Tasks

LogBlockedRequest() public method

public LogBlockedRequest ( HttpContext httpContext, ClientRequestIdentity identity, RateLimitCounter counter, RateLimitRule rule ) : void
httpContext HttpContext
identity ClientRequestIdentity
counter RateLimitCounter
rule RateLimitRule
return void

ReturnQuotaExceededResponse() public method

public ReturnQuotaExceededResponse ( HttpContext httpContext, RateLimitRule rule, string retryAfter ) : System.Threading.Tasks.Task
httpContext HttpContext
rule RateLimitRule
retryAfter string
return System.Threading.Tasks.Task