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

Skip to content

Update security.rst #19261

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 12, 2023
Merged

Update security.rst #19261

merged 1 commit into from
Dec 12, 2023

Conversation

fabgg
Copy link
Contributor

@fabgg fabgg commented Dec 10, 2023

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

/**
 * @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 !

@carsonbot carsonbot added this to the 6.4 milestone Dec 10, 2023
@OskarStark OskarStark requested a review from wouterj December 11, 2023 09:40
Copy link
Member

@wouterj wouterj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're correct, thanks for providing this fix!

Can you maybe also fix the PHP example (line 1698) by adding `'%kernel.secret%' to the list?

Copy link
Contributor Author

@fabgg fabgg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated Rate limiter php config example

Copy link
Contributor Author

@fabgg fabgg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not confortable with github web pull request interface. Update php config example rate limiter

@OskarStark
Copy link
Contributor

Thank you Fabrice.

@OskarStark OskarStark merged commit ee88c48 into symfony:6.4 Dec 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants