cakephp / authentication

Authentication plugin for CakePHP. Can also be used in PSR7 based applications.
MIT License
115 stars 101 forks source link

Remove PersistenceInterface inheritance from ImpersonationInterface #650

Closed segy closed 6 months ago

segy commented 7 months ago

solves https://github.com/cakephp/authentication/issues/648

dereuromark commented 7 months ago

Instead of changing the existing one, which is also somewhat BC breaking Would it work to create your own StatelessImpersationInterface extends ImpersonationInterface instead? And for your case just throw NotImplementedException instead in those methods of the PersistenceInterface?

dereuromark commented 7 months ago

I do agree that

extends AbstractAuthenticator implements PersistenceInterface, ImpersonationInterface

is not clean, though. As it duplicates the interface contract for the persistence part.

As such, maybe the change is fine after all - given that the changelog could outline the behavior change.

It seems to work because

interface AuthenticationServiceInterface extends PersistenceInterface

so the now "removed" part of Persistence on Impersonation

class AuthenticationService implements AuthenticationServiceInterface, ImpersonationInterface

is covered by that interface.