Security hardening - Rate limiter

This commit is contained in:
Jérémy Derussé 2021-03-22 20:26:15 +01:00
parent 7611d24e06
commit e61553af4b
No known key found for this signature in database
GPG Key ID: 2083FA5758C473D2
2 changed files with 2 additions and 2 deletions

View File

@ -46,7 +46,7 @@ final class RateLimiterFactory
public function create(?string $key = null): LimiterInterface
{
$id = $this->config['id'].$key;
$id = $this->config['id'].'-'.$key;
$lock = $this->lockFactory ? $this->lockFactory->createLock($id) : new NoLock();
switch ($this->config['policy']) {

View File

@ -41,7 +41,7 @@ final class DefaultLoginRateLimiter extends AbstractRequestRateLimiter
{
return [
$this->globalFactory->create($request->getClientIp()),
$this->localFactory->create($request->attributes->get(Security::LAST_USERNAME).$request->getClientIp()),
$this->localFactory->create($request->attributes->get(Security::LAST_USERNAME).'-'.$request->getClientIp()),
];
}
}