Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat!: permit use of the lib under Symfony 5
BREAKING CHANGE: the User class no longer implements Symfony's AdvancedUserInterface which was removed in Symfony 5. Instead of using the methods of the removed interface, integrators should implement User and Account checks in UserCheckers. The LegacyAdvancedUserInterface is available as a last resort.
- Loading branch information
Showing
5 changed files
with
90 additions
and
14 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
UPGRADE FROM 1.9 to 2.0 | ||
======================= | ||
|
||
- The User class no longer implements Symfony's `AdvancedUserInterface` which | ||
it has been removed from Symfony 5. Use of the methods of this interface | ||
should be replaced by performing User and Account checks in UserCheckers. | ||
|
||
A temporary replacement for the removed interface is | ||
`UserBase\Client\Model\LegacyAdvancedUserInterface`, but use this only as a | ||
last resort and as a temporary fix. |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
<?php | ||
|
||
namespace UserBase\Client\Model; | ||
|
||
/** | ||
* For backwards compatability only - use UserCheckers instead. | ||
* | ||
* This iface replaces Symfony\Component\Security\Core\User\AdvancedUserInterface | ||
* which was removed from Symfony 5 because the User class is not the right place | ||
* to implement account/user checks that influence whether or not a user is | ||
* allowed to authenticate. For more info about why it was removed see: | ||
* https://github.com/symfony/symfony/issues/23292 | ||
* | ||
* For info about UserCheckers see: | ||
* https://symfony.com/doc/current/security/user_checkers.html | ||
*/ | ||
interface LegacyAdvancedUserInterface extends UserInterface | ||
{ | ||
/** | ||
* Check whether the user's account has expired. | ||
* | ||
* @return bool true if the user's account is non expired, false otherwise | ||
*/ | ||
public function isAccountNonExpired(); | ||
|
||
/** | ||
* Check whether the user is locked. | ||
* | ||
* @return bool true if the user is not locked, false otherwise | ||
*/ | ||
public function isAccountNonLocked(); | ||
|
||
/** | ||
* Check whether the user's credentials have expired. | ||
* | ||
* @return bool true if the user's credentials are non expired, false otherwise | ||
*/ | ||
public function isCredentialsNonExpired(); | ||
|
||
/** | ||
* Check whether the user is enabled. | ||
* | ||
* @return bool true if the user is enabled, false otherwise | ||
*/ | ||
public function isEnabled(); | ||
} |
This file contains 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
This file contains 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