Skip to content

Conversation

@dereuromark
Copy link
Member

Summary

Adds rector rules to automate the Authentication plugin 3.x to 4.x migration:

  • Class renames:

    • Authentication\UrlChecker\CakeRouterUrlCheckerAuthentication\UrlChecker\DefaultUrlChecker
    • Authentication\UrlChecker\DefaultUrlChecker (framework-agnostic) → Authentication\UrlChecker\GenericUrlChecker
    • Authentication\PluginAuthentication\AuthenticationPlugin
  • Method removal:

    • AuthenticationService::loadIdentifier() - removed in 4.x

Usage

bin/cake upgrade rector --rules authentication40

Or in custom rector config:

use Cake\Upgrade\Rector\Set\CakePHPSetList;

return static function (RectorConfig $rectorConfig): void {
    $rectorConfig->sets([CakePHPSetList::AUTHENTICATION_40]);
};

Not automated

Some changes require manual intervention and are documented in the upgrade guide:

  1. Constant relocations - CREDENTIAL_USERNAME/CREDENTIAL_PASSWORD moved from AbstractIdentifier to PasswordIdentifier/LdapIdentifier
  2. IdentifierCollection removal - Identifiers are now configured per-authenticator
  3. MultiUrlChecker - Auto-detection removed, requires explicit configuration

Related

Adds rules to automate the 3.x to 4.x migration for the authentication plugin:

- Rename CakeRouterUrlChecker to DefaultUrlChecker
- Rename DefaultUrlChecker (framework-agnostic) to GenericUrlChecker
- Rename Plugin to AuthenticationPlugin
- Remove loadIdentifier() method calls

See: cakephp/authentication#748
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants