Add Symfony 6.4 compatibility (dual 5.4 + 6.4)#3
Open
AymericPlanche wants to merge 1 commit intomasterfrom
Open
Add Symfony 6.4 compatibility (dual 5.4 + 6.4)#3AymericPlanche wants to merge 1 commit intomasterfrom
AymericPlanche wants to merge 1 commit intomasterfrom
Conversation
- Bump symfony/* constraints to ^5.4 || ^6.4, php to ^8.1 - Add symfony/password-hasher to require - Add polyfills for SecurityFactoryInterface and PassportInterface removed in Symfony 6.0 (Compat/ directory, loaded via composer files) - Split security.xml: legacy provider+listener moved to security_legacy.xml, loaded only on Symfony 5.x (where SecurityFactoryInterface exists) - FOSOAuthServerBundle: conditionally call addAuthenticatorFactory() (6.x) or addSecurityListenerFactory() (5.x) - Add PasswordHasherCompilerPass: rewires OAuthStorage to use security.user_password_hasher on Symfony 6.x - OAuthStorage: accept both EncoderFactory (5.x) and UserPasswordHasher (6.x), support both loadUserByIdentifier (6.x) and loadUserByUsername (5.x) - OAuthFactory: add getPriority() required by AuthenticatorFactoryInterface in 6.x
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
symfony/*constraints from^4.4 || ^5.1to^5.4 || ^6.4symfony/password-hasherdependency (replaces removed encoder on 6.x)SecurityFactoryInterfaceandPassportInterface(removed in Symfony 6.0)security.xml: legacy provider+listener insecurity_legacy.xml, loaded only on 5.xPasswordHasherCompilerPassto rewire encoder → hasher on 6.xOAuthStorage: dual encoder/hasher support,loadUserByIdentifier/loadUserByUsernamefallbackOAuthFactory: addgetPriority()for 6.x authenticator factoryFOSOAuthServerBundle: conditionaladdAuthenticatorFactory()/addSecurityListenerFactory()Why
Akeneo PIM is upgrading from Symfony 5.4 to 6.4. This bundle's constraints (
^4.4 || ^5.1) are a hard blocker. The dual-compat approach allows merging now while still running on 5.4, then switching to 6.4 once all dependencies are ready.The runtime shim pattern (
interface_exists,method_exists) is standard practice — used byfriendsofsymfony/rest-bundle,doctrine/doctrine-bundle, and others for multi-Symfony support.Testing
Tested on Akeneo PIM (Symfony 5.4):
cache:clearon dev + test)GetAccessTokenIntegration— 13 tests, 54 assertionsRefreshTokenIntegration— 4 tests, 28 assertionsCheckAuthenticationSecurityEndToEnd— 6 tests, 27 assertionsRequestAccessTokenActionEndToEnd— 3 tests, 22 assertions