|
|
|
@ -56,8 +56,7 @@ class LimitWraperFactory(object):
|
|
|
|
|
limiter = self.get_limiter(app.config['AUTH_RATELIMIT_IP'], 'auth-ip')
|
|
|
|
|
client_network = utils.extract_network_from_ip(ip)
|
|
|
|
|
if self.is_subject_to_rate_limits(ip):
|
|
|
|
|
if username and (self.storage.get(f'dedup-{client_network}-{username}') > 0):
|
|
|
|
|
return
|
|
|
|
|
if username and (self.storage.get(f'dedup-{client_network}-{username}') < 1):
|
|
|
|
|
self.storage.incr(f'dedup-{client_network}-{username}', limits.parse(app.config['AUTH_RATELIMIT_IP']).GRANULARITY.seconds ,True)
|
|
|
|
|
limiter.hit(client_network)
|
|
|
|
|
|
|
|
|
|