Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit ee88c48

Browse files
committed
bug #19261 Update security.rst (fabgg)
This PR was squashed before being merged into the 6.4 branch. Discussion ---------- Update security.rst Add third argument on example of config of DefaultLoginRateLimiter. After migrate 6.2 to 6.4.1 i got an error : Too few arguments to function Symfony\Component\Security\Http\RateLimiter\DefaultLoginRateLimiter::__construct(), 2 passed in /var/www/html/var/cache/dev/ContainerJcwPZ89/getSecurity_Listener_LoginThrottling_MainService.php on line 41 and exactly 3 expected in the class ```php /** * `@param` non-empty-string $secret A secret to use for hashing the IP address and username */ public function __construct(RateLimiterFactory $globalFactory, RateLimiterFactory $localFactory, #[\SensitiveParameter] string $secret) { if (!$secret) { throw new InvalidArgumentException('A non-empty secret is required.'); } $this->globalFactory = $globalFactory; $this->localFactory = $localFactory; $this->secret = $secret; } ``` So, it will be nice to update these config example section ! Commits ------- a2e1f55 Update security.rst
2 parents 8d104ef + a2e1f55 commit ee88c48

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

security.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1601,6 +1601,7 @@ and set the ``limiter`` option to its service ID:
16011601
$globalFactory: '@limiter.ip_login'
16021602
# localFactory is the limiter for username+IP
16031603
$localFactory: '@limiter.username_ip_login'
1604+
$secret: '%kernel.secret%'
16041605
16051606
security:
16061607
firewalls:
@@ -1651,6 +1652,8 @@ and set the ``limiter`` option to its service ID:
16511652
<srv:argument type="service" id="limiter.ip_login"/>
16521653
<!-- 2nd argument is the limiter for username+IP -->
16531654
<srv:argument type="service" id="limiter.username_ip_login"/>
1655+
<!-- 3rd argument is the app secret -->
1656+
<srv:argument type="service" id="%kernel.secret%"/>
16541657
</srv:service>
16551658
</srv:services>
16561659
@@ -1693,6 +1696,8 @@ and set the ``limiter`` option to its service ID:
16931696
new Reference('limiter.ip_login'),
16941697
// 2nd argument is the limiter for username+IP
16951698
new Reference('limiter.username_ip_login'),
1699+
// 3rd argument is the app secret
1700+
new Reference('kernel.secret'),
16961701
]);
16971702
16981703
$security->firewall('main')

0 commit comments

Comments
 (0)