Skip to content

Commit 47af09b

Browse files
committed
bug #106 Fix symfony 5.3 security incompatiblity (acrobat)
This PR was merged into the 3.x-dev branch. Discussion ---------- Fix symfony 5.3 security incompatiblity Follow up of #100 The `AuthenticationTrustResolverInterface::isAuthenticated` method was only added in symfony 5.4 but the `AuthenticatedVoter::PUBLIC_ACCESS` constant was already available in symfony 5.3, this causes an error when using security-acl 3.3.0 with symfony 5.3.x https://github.com/symfony/security-acl/blob/04d6fadd671d72ff322e20840e510030753e008a/Domain/SecurityIdentityRetrievalStrategy.php#L81-L83 The first commit actually refactors the test case because even when executing the tests on symfony 5.3 they still pass as we mocked that class/method. I've also changed some things in the github ci workflow because I wasn't able to get symfony 5.3 dependencies with the` ramsey/composer-install` packages (lowest = install, highest = update but this would cause dev packages in this setup), so I'm not sure if this is the desired setup. Let me know if I need the change anything. The second commit actually fixes the problem (the first commit shows a failing test on symfony 5.3 first) Commits ------- 94c127b Fix symfony 5.3 incompatibility
2 parents 04d6fad + 94c127b commit 47af09b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Domain/SecurityIdentityRetrievalStrategy.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ public function getSecurityIdentities(TokenInterface $token)
7878

7979
private function isNotAuthenticated(TokenInterface $token): bool
8080
{
81-
if (\defined('\Symfony\Component\Security\Core\Authorization\Voter\AuthenticatedVoter::PUBLIC_ACCESS')) {
81+
if (method_exists($this->authenticationTrustResolver, 'isAuthenticated')) {
8282
return !$this->authenticationTrustResolver->isAuthenticated($token);
8383
}
8484

0 commit comments

Comments
 (0)