Commit 0240732b authored by Bertrand Gauthier's avatar Bertrand Gauthier
Browse files

Migration vers laminas

parent d507f84b
Pipeline #11068 passed with stage
in 25 seconds
...@@ -2,10 +2,10 @@ ...@@ -2,10 +2,10 @@
namespace UnicaenAuth; namespace UnicaenAuth;
use Zend\EventManager\EventInterface; use Laminas\EventManager\EventInterface;
use Zend\ModuleManager\Feature\AutoloaderProviderInterface; use Laminas\ModuleManager\Feature\AutoloaderProviderInterface;
use Zend\ModuleManager\Feature\ConfigProviderInterface; use Laminas\ModuleManager\Feature\ConfigProviderInterface;
use Zend\ModuleManager\Feature\ServiceProviderInterface; use Laminas\ModuleManager\Feature\ServiceProviderInterface;
use ZfcUser\Form\Login; use ZfcUser\Form\Login;
use ZfcUser\Form\LoginFilter; use ZfcUser\Form\LoginFilter;
...@@ -32,7 +32,7 @@ class Module implements AutoloaderProviderInterface, ConfigProviderInterface, Se ...@@ -32,7 +32,7 @@ class Module implements AutoloaderProviderInterface, ConfigProviderInterface, Se
public function getAutoloaderConfig() public function getAutoloaderConfig()
{ {
return [ return [
'Zend\Loader\StandardAutoloader' => [ 'Laminas\Loader\StandardAutoloader' => [
'namespaces' => [ 'namespaces' => [
__NAMESPACE__ => __DIR__ . '/src/' . __NAMESPACE__, __NAMESPACE__ => __DIR__ . '/src/' . __NAMESPACE__,
], ],
......
...@@ -9,9 +9,10 @@ ...@@ -9,9 +9,10 @@
], ],
"require": { "require": {
"unicaen/app": "dev-release_4.0.0", "unicaen/app": "dev-release_4.0.0",
"unicaen/bjy-authorize": "^3.0", "unicaen/bjy-authorize": "dev-release_4.0.0",
"jasig/phpcas": "^1.3", "jasig/phpcas": "^1.3",
"ramsey/uuid": "^3.7" "ramsey/uuid": "^3.7",
"laminas/laminas-dependency-plugin": "^2.1"
}, },
"require-dev": { "require-dev": {
"phpunit/phpunit": "^5.6" "phpunit/phpunit": "^5.6"
......
This diff is collapsed.
...@@ -71,8 +71,8 @@ use UnicaenAuth\View\Helper\UserStatus; ...@@ -71,8 +71,8 @@ use UnicaenAuth\View\Helper\UserStatus;
use UnicaenAuth\View\Helper\UserStatusFactory; use UnicaenAuth\View\Helper\UserStatusFactory;
use UnicaenAuth\View\Helper\UserUsurpationHelper; use UnicaenAuth\View\Helper\UserUsurpationHelper;
use UnicaenAuth\View\Helper\UserUsurpationHelperFactory; use UnicaenAuth\View\Helper\UserUsurpationHelperFactory;
use Zend\Authentication\AuthenticationService; use Laminas\Authentication\AuthenticationService;
use Zend\ServiceManager\Proxy\LazyServiceFactory; use Laminas\ServiceManager\Proxy\LazyServiceFactory;
$settings = [ $settings = [
/** /**
...@@ -322,7 +322,7 @@ return [ ...@@ -322,7 +322,7 @@ return [
/* role providers simply provide a list of roles that should be inserted /* role providers simply provide a list of roles that should be inserted
* into the Zend\Acl instance. the module comes with two providers, one * into the Zend\Acl instance. the module comes with two providers, one
* to specify roles in a config file and one to load roles using a * to specify roles in a config file and one to load roles using a
* Zend\Db adapter. * Laminas\Db adapter.
*/ */
'role_providers' => [ 'role_providers' => [
/** /**
...@@ -645,7 +645,7 @@ return [ ...@@ -645,7 +645,7 @@ return [
'aliases' => [ 'aliases' => [
'unicaen-auth_module_options' => ModuleOptions::class, 'unicaen-auth_module_options' => ModuleOptions::class,
'zfcuser_login_form' => LoginForm::class, 'zfcuser_login_form' => LoginForm::class,
'Zend\Authentication\AuthenticationService' => 'zfcuser_auth_service', 'Laminas\Authentication\AuthenticationService' => 'zfcuser_auth_service',
'UnicaenAuth\Privilege\PrivilegeProvider' => 'UnicaenAuth\Service\Privilege', 'UnicaenAuth\Privilege\PrivilegeProvider' => 'UnicaenAuth\Service\Privilege',
'\UnicaenAuth\Guard\PrivilegeController' => 'UnicaenAuth\Guard\PrivilegeController', '\UnicaenAuth\Guard\PrivilegeController' => 'UnicaenAuth\Guard\PrivilegeController',
......
...@@ -35,7 +35,7 @@ $config = [ ...@@ -35,7 +35,7 @@ $config = [
/* role providers simply provide a list of roles that should be inserted /* role providers simply provide a list of roles that should be inserted
* into the Zend\Acl instance. the module comes with two providers, one * into the Zend\Acl instance. the module comes with two providers, one
* to specify roles in a config file and one to load roles using a * to specify roles in a config file and one to load roles using a
* Zend\Db adapter. * Laminas\Db adapter.
*/ */
'role_providers' => [ 'role_providers' => [
/** /**
......
...@@ -22,7 +22,7 @@ Quatre types d'authentification sont activables dans la configuration du module. ...@@ -22,7 +22,7 @@ Quatre types d'authentification sont activables dans la configuration du module.
- Pour donner accès à l'application à un nouvel utilisateur, 2 solutions : - Pour donner accès à l'application à un nouvel utilisateur, 2 solutions :
- Un informaticien crée à la main l'utilisateur dans la table des utilisateurs ; le mot de passe doit être chiffré - Un informaticien crée à la main l'utilisateur dans la table des utilisateurs ; le mot de passe doit être chiffré
avec “Bcrypt” (exemple en ligne de commande à la racine de votre projet : avec “Bcrypt” (exemple en ligne de commande à la racine de votre projet :
`php --run 'require "vendor/autoload.php"; $bcrypt = new Zend\Crypt\Password\Bcrypt(); var_dump($bcrypt->create("azerty"));'`). `php --run 'require "vendor/autoload.php"; $bcrypt = new Laminas\Crypt\Password\Bcrypt(); var_dump($bcrypt->create("azerty"));'`).
- Si la fonctionnalité est activée (fournie par le module "zf-commons/zfc-user" dont dépend le module unicaen/auth), - Si la fonctionnalité est activée (fournie par le module "zf-commons/zfc-user" dont dépend le module unicaen/auth),
l'utilisateur s'enregistre lui-même dans la table des utilisateurs via un formulaire de l'application (le lien figure l'utilisateur s'enregistre lui-même dans la table des utilisateurs via un formulaire de l'application (le lien figure
sous le formulaire de connexion à l'appli). sous le formulaire de connexion à l'appli).
...@@ -142,7 +142,7 @@ UserAuthenticatedEventListenerFactory.php ...@@ -142,7 +142,7 @@ UserAuthenticatedEventListenerFactory.php
use Application\Entity\Db\Role; use Application\Entity\Db\Role;
use Doctrine\ORM\EntityManager; use Doctrine\ORM\EntityManager;
use UnicaenAuth\Service\UserContext as UserContextService; use UnicaenAuth\Service\UserContext as UserContextService;
use Zend\ServiceManager\ServiceLocatorInterface; use Laminas\ServiceManager\ServiceLocatorInterface;
class UserAuthenticatedEventListenerFactory class UserAuthenticatedEventListenerFactory
{ {
...@@ -170,7 +170,7 @@ Module.php ...@@ -170,7 +170,7 @@ Module.php
namespace Application; namespace Application;
use Application\Auth\UserAuthenticatedEventListener; use Application\Auth\UserAuthenticatedEventListener;
use Zend\Mvc\MvcEvent; use Laminas\Mvc\MvcEvent;
class Module class Module
{ {
......
...@@ -202,7 +202,7 @@ Si vous voulez qu'une entité devienne une ressource, il faut qu'elle implément ...@@ -202,7 +202,7 @@ Si vous voulez qu'une entité devienne une ressource, il faut qu'elle implément
namespace Application\Entity\Db; namespace Application\Entity\Db;
use Zend\Permissions\Acl\Resource\ResourceInterface; use Laminas\Permissions\Acl\Resource\ResourceInterface;
class ElementPedagogique implements ResourceInterface class ElementPedagogique implements ResourceInterface
{ {
...@@ -273,7 +273,7 @@ Son rôle est de répondre true ou false à une demande en fonction d'un certain ...@@ -273,7 +273,7 @@ Son rôle est de répondre true ou false à une demande en fonction d'un certain
AbstractAssertion vous fournit l'accès AbstractAssertion vous fournit l'accès
- au ServiceLocator, - au ServiceLocator,
- au gestionnaire d'événements MVC (Zend\Mvc\MvcEvent) pour éventuellement récupérer des infos sur les paramètres d'URL ou de routeur, etc (utile pour les assertions lancées par les guards), - au gestionnaire d'événements MVC (Laminas\Mvc\MvcEvent) pour éventuellement récupérer des infos sur les paramètres d'URL ou de routeur, etc (utile pour les assertions lancées par les guards),
- à l'ACL courante (getAcl()), - à l'ACL courante (getAcl()),
- au rôle courant (getRole()). - au rôle courant (getRole()).
...@@ -332,7 +332,7 @@ Voici maintenant un exemple concret d'assertion : ...@@ -332,7 +332,7 @@ Voici maintenant un exemple concret d'assertion :
use Application\Entity\Db\Structure; use Application\Entity\Db\Structure;
use UnicaenAuth\Assertion\AbstractAssertion; use UnicaenAuth\Assertion\AbstractAssertion;
use Application\Acl\Role; use Application\Acl\Role;
use Zend\Permissions\Acl\Resource\ResourceInterface; use Laminas\Permissions\Acl\Resource\ResourceInterface;
/** /**
......
<?php <?php
namespace UnicaenAuth\Acl; namespace UnicaenAuth\Acl;
use Zend\Permissions\Acl\Role\RoleInterface; use Laminas\Permissions\Acl\Role\RoleInterface;
/** /**
* Rôle avec nom explicite (humainement intelligible). * Rôle avec nom explicite (humainement intelligible).
......
...@@ -7,11 +7,11 @@ use UnicaenAuth\Service\AuthorizeService; ...@@ -7,11 +7,11 @@ use UnicaenAuth\Service\AuthorizeService;
use UnicaenAuth\Service\Traits\AuthorizeServiceAwareTrait; use UnicaenAuth\Service\Traits\AuthorizeServiceAwareTrait;
use UnicaenAuth\Service\Traits\UserContextServiceAwareTrait; use UnicaenAuth\Service\Traits\UserContextServiceAwareTrait;
use UnicaenAuth\Service\UserContext; use UnicaenAuth\Service\UserContext;
use Zend\Mvc\MvcEvent; use Laminas\Mvc\MvcEvent;
use Zend\Permissions\Acl\Acl; use Laminas\Permissions\Acl\Acl;
use Zend\Permissions\Acl\Assertion\AssertionInterface; use Laminas\Permissions\Acl\Assertion\AssertionInterface;
use Zend\Permissions\Acl\Resource\ResourceInterface; use Laminas\Permissions\Acl\Resource\ResourceInterface;
use Zend\Permissions\Acl\Role\RoleInterface; use Laminas\Permissions\Acl\Role\RoleInterface;
/** /**
* Description of AbstractAssertion * Description of AbstractAssertion
......
...@@ -4,9 +4,9 @@ namespace UnicaenAuth\Assertion; ...@@ -4,9 +4,9 @@ namespace UnicaenAuth\Assertion;
use BjyAuthorize\Service\Authorize; use BjyAuthorize\Service\Authorize;
use Interop\Container\ContainerInterface; use Interop\Container\ContainerInterface;
use Zend\Authentication\AuthenticationService; use Laminas\Authentication\AuthenticationService;
use Zend\Mvc\Application; use Laminas\Mvc\Application;
use Zend\ServiceManager\Factory\FactoryInterface; use Laminas\ServiceManager\Factory\FactoryInterface;
/** /**
* Class AssertionFactory * Class AssertionFactory
......
...@@ -3,11 +3,11 @@ ...@@ -3,11 +3,11 @@
namespace UnicaenAuth\Authentication\Adapter; namespace UnicaenAuth\Authentication\Adapter;
use UnicaenAuth\Authentication\SessionIdentity; use UnicaenAuth\Authentication\SessionIdentity;
use Zend\Authentication\Storage\StorageInterface; use Laminas\Authentication\Storage\StorageInterface;
use Zend\EventManager\EventInterface; use Laminas\EventManager\EventInterface;
use Zend\EventManager\EventManagerInterface; use Laminas\EventManager\EventManagerInterface;
use Zend\EventManager\ListenerAggregateInterface; use Laminas\EventManager\ListenerAggregateInterface;
use Zend\EventManager\ListenerAggregateTrait; use Laminas\EventManager\ListenerAggregateTrait;
use ZfcUser\Authentication\Adapter\ChainableAdapter; use ZfcUser\Authentication\Adapter\ChainableAdapter;
abstract class AbstractAdapter implements ChainableAdapter, ListenerAggregateInterface abstract class AbstractAdapter implements ChainableAdapter, ListenerAggregateInterface
......
...@@ -3,9 +3,9 @@ ...@@ -3,9 +3,9 @@
namespace UnicaenAuth\Authentication\Adapter; namespace UnicaenAuth\Authentication\Adapter;
use UnicaenAuth\Options\Traits\ModuleOptionsAwareTrait; use UnicaenAuth\Options\Traits\ModuleOptionsAwareTrait;
use Zend\Authentication\Result as AuthenticationResult; use Laminas\Authentication\Result as AuthenticationResult;
use Zend\EventManager\EventInterface; use Laminas\EventManager\EventInterface;
use Zend\Session\Container as SessionContainer; use Laminas\Session\Container as SessionContainer;
use ZfcUser\Authentication\Adapter\AdapterChainEvent; use ZfcUser\Authentication\Adapter\AdapterChainEvent;
use ZfcUser\Entity\UserInterface; use ZfcUser\Entity\UserInterface;
use ZfcUser\Mapper\UserInterface as UserMapperInterface; use ZfcUser\Mapper\UserInterface as UserMapperInterface;
......
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
namespace UnicaenAuth\Authentication\Adapter; namespace UnicaenAuth\Authentication\Adapter;
use Zend\Stdlib\RequestInterface as Request; use Laminas\Stdlib\RequestInterface as Request;
use Zend\Stdlib\ResponseInterface as Response; use Laminas\Stdlib\ResponseInterface as Response;
use ZfcUser\Exception; use ZfcUser\Exception;
class AdapterChain extends \ZfcUser\Authentication\Adapter\AdapterChain class AdapterChain extends \ZfcUser\Authentication\Adapter\AdapterChain
......
...@@ -7,10 +7,10 @@ use phpCAS; ...@@ -7,10 +7,10 @@ use phpCAS;
use UnicaenApp\Mapper\Ldap\People as LdapPeopleMapper; use UnicaenApp\Mapper\Ldap\People as LdapPeopleMapper;
use UnicaenAuth\Options\Traits\ModuleOptionsAwareTrait; use UnicaenAuth\Options\Traits\ModuleOptionsAwareTrait;
use UnicaenAuth\Service\User; use UnicaenAuth\Service\User;
use Zend\Authentication\Result as AuthenticationResult; use Laminas\Authentication\Result as AuthenticationResult;
use Zend\EventManager\EventInterface; use Laminas\EventManager\EventInterface;
use Zend\Router\RouteInterface; use Laminas\Router\RouteInterface;
use Zend\Router\RouteStackInterface; use Laminas\Router\RouteStackInterface;
use ZfcUser\Authentication\Adapter\AdapterChainEvent; use ZfcUser\Authentication\Adapter\AdapterChainEvent;
/** /**
......
...@@ -6,7 +6,7 @@ use Interop\Container\ContainerInterface; ...@@ -6,7 +6,7 @@ use Interop\Container\ContainerInterface;
use UnicaenApp\Mapper\Ldap\People as LdapPeopleMapper; use UnicaenApp\Mapper\Ldap\People as LdapPeopleMapper;
use UnicaenAuth\Options\ModuleOptions; use UnicaenAuth\Options\ModuleOptions;
use UnicaenAuth\Service\User; use UnicaenAuth\Service\User;
use Zend\Authentication\Storage\Session; use Laminas\Authentication\Storage\Session;
class CasAdapterFactory class CasAdapterFactory
{ {
......
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
namespace UnicaenAuth\Authentication\Adapter; namespace UnicaenAuth\Authentication\Adapter;
use Zend\Authentication\Result as AuthenticationResult; use Laminas\Authentication\Result as AuthenticationResult;
use Zend\Crypt\Password\Bcrypt; use Laminas\Crypt\Password\Bcrypt;
use ZfcUser\Entity\UserInterface; use ZfcUser\Entity\UserInterface;
/** /**
......
...@@ -4,7 +4,7 @@ namespace UnicaenAuth\Authentication\Adapter; ...@@ -4,7 +4,7 @@ namespace UnicaenAuth\Authentication\Adapter;
use Interop\Container\ContainerInterface; use Interop\Container\ContainerInterface;
use UnicaenAuth\Options\ModuleOptions; use UnicaenAuth\Options\ModuleOptions;
use Zend\Authentication\Storage\Session; use Laminas\Authentication\Storage\Session;
use ZfcUser\Mapper\UserInterface as UserMapperInterface; use ZfcUser\Mapper\UserInterface as UserMapperInterface;
class DbAdapterFactory class DbAdapterFactory
......
...@@ -7,14 +7,14 @@ use UnicaenApp\Mapper\Ldap\People as LdapPeopleMapper; ...@@ -7,14 +7,14 @@ use UnicaenApp\Mapper\Ldap\People as LdapPeopleMapper;
use UnicaenApp\Options\ModuleOptions; use UnicaenApp\Options\ModuleOptions;
use UnicaenAuth\Options\Traits\ModuleOptionsAwareTrait; use UnicaenAuth\Options\Traits\ModuleOptionsAwareTrait;
use UnicaenAuth\Service\User; use UnicaenAuth\Service\User;
use Zend\Authentication\Adapter\Ldap as LdapAuthAdapter; use Laminas\Authentication\Adapter\Ldap as LdapAuthAdapter;
use Zend\Authentication\Exception\ExceptionInterface; use Laminas\Authentication\Exception\ExceptionInterface;
use Zend\Authentication\Result as AuthenticationResult; use Laminas\Authentication\Result as AuthenticationResult;
use Zend\EventManager\Event; use Laminas\EventManager\Event;
use Zend\EventManager\EventInterface; use Laminas\EventManager\EventInterface;
use Zend\EventManager\EventManager; use Laminas\EventManager\EventManager;
use Zend\EventManager\EventManagerAwareInterface; use Laminas\EventManager\EventManagerAwareInterface;
use Zend\EventManager\EventManagerInterface; use Laminas\EventManager\EventManagerInterface;
use ZfcUser\Authentication\Adapter\AdapterChainEvent; use ZfcUser\Authentication\Adapter\AdapterChainEvent;
/** /**
...@@ -187,8 +187,8 @@ class Ldap extends AbstractAdapter implements EventManagerAwareInterface ...@@ -187,8 +187,8 @@ class Ldap extends AbstractAdapter implements EventManagerAwareInterface
* @param string $username Identifiant de connexion * @param string $username Identifiant de connexion
* @param string $credential Mot de passe * @param string $credential Mot de passe
* @return boolean * @return boolean
* @throws \Zend\Authentication\Adapter\Exception\ExceptionInterface * @throws \Laminas\Authentication\Adapter\Exception\ExceptionInterface
* @throws \Zend\Ldap\Exception\LdapException * @throws \Laminas\Ldap\Exception\LdapException
*/ */
public function authenticateUsername(string $username, string $credential): bool public function authenticateUsername(string $username, string $credential): bool
{ {
......
...@@ -6,7 +6,7 @@ use Interop\Container\ContainerInterface; ...@@ -6,7 +6,7 @@ use Interop\Container\ContainerInterface;
use UnicaenApp\Mapper\Ldap\People as LdapPeopleMapper; use UnicaenApp\Mapper\Ldap\People as LdapPeopleMapper;
use UnicaenAuth\Options\ModuleOptions; use UnicaenAuth\Options\ModuleOptions;
use UnicaenAuth\Service\User; use UnicaenAuth\Service\User;
use Zend\Authentication\Storage\Session; use Laminas\Authentication\Storage\Session;
class LdapAdapterFactory class LdapAdapterFactory
{ {
......
...@@ -3,9 +3,9 @@ ...@@ -3,9 +3,9 @@
namespace UnicaenAuth\Authentication\Adapter; namespace UnicaenAuth\Authentication\Adapter;
use UnicaenAuth\Options\Traits\ModuleOptionsAwareTrait; use UnicaenAuth\Options\Traits\ModuleOptionsAwareTrait;
use Zend\EventManager\EventInterface; use Laminas\EventManager\EventInterface;
use Zend\EventManager\EventManagerAwareTrait; use Laminas\EventManager\EventManagerAwareTrait;
use Zend\Stdlib\ResponseInterface as Response; use Laminas\Stdlib\ResponseInterface as Response;
use ZfcUser\Authentication\Adapter\AdapterChainEvent; use ZfcUser\Authentication\Adapter\AdapterChainEvent;
/** /**
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment