[Security] Decouple CSRF component from security-core #42148
Comments
See #36423 The conclusion was: "Ok, let's close this PR then and revisit the issue when we will work on 5.4." So you've timed it perfectly! There are 2 things to discuss here:
|
As discussed privately, we cannot deprecate the security-csrf component now because supporting IE11 still matters and SameSite cookies aren't supported there. But the long-term goal is to remove the component. About the original issue, considering the goal mentioned above, I don't think it's worth breaking BC personally. |
symfony/security-csrf
is installable as a stand-alone package. However, it requiressecurity-core
:symfony/src/Symfony/Component/Security/Csrf/composer.json
Lines 18 to 21 in 27aceb6
I use CSRF in some forms not related to Security, so I want CSRF but I don't want the entire Security package. Why is this important to me?
Because
symfony/security-csrf
is a tiny 18-file and 0.06 MB on disk package, whereassymfony/security-core
is a big 258-file and 1.1 MB on disk package.Moreover, although CSRF requires the entire Security package, it only uses two tiny exception classes from it:
Here:
symfony/src/Symfony/Component/Security/Csrf/CsrfTokenManager.php
Line 15 in 27aceb6
And here:
symfony/src/Symfony/Component/Security/Csrf/Exception/TokenNotFoundException.php
Line 14 in 27aceb6
So maybe we can decouple these packages? Thanks!
The text was updated successfully, but these errors were encountered: