diff --git a/composer.json b/composer.json index f1e7b9b..6547f7d 100644 --- a/composer.json +++ b/composer.json @@ -69,8 +69,8 @@ "dev-master": "1.1-dev" }, "laminas": { - "component": "LmcRbac", - "config-provider": "LmcRbac\\ConfigProvider" + "component": "Lmc\\Rbac", + "config-provider": "Lmc\\Rbac\\ConfigProvider" } }, "scripts": { diff --git a/src/ConfigProvider.php b/src/ConfigProvider.php index 7b0326b..aaa85df 100644 --- a/src/ConfigProvider.php +++ b/src/ConfigProvider.php @@ -21,9 +21,6 @@ namespace Lmc\Rbac; -use Lmc\Rbac\Assertion\AssertionPluginManager; -use Lmc\Rbac\Identity\AuthenticationIdentityProvider; - /** * The configuration provider for the LmcRbac module * @@ -42,6 +39,9 @@ public function __invoke(): array public function getDependencyConfig(): array { return [ + 'aliases' => [ + \Lmc\Rbac\Assertion\AssertionPluginManagerInterface::class => \Lmc\Rbac\Assertion\AssertionPluginManager::class, + ], 'factories' => [ \Lmc\Rbac\Assertion\AssertionPluginManager::class => \Lmc\Rbac\Assertion\AssertionPluginManagerFactory::class, \Lmc\Rbac\Options\ModuleOptions::class => \Lmc\Rbac\Options\ModuleOptionsFactory::class, diff --git a/src/Options/ModuleOptions.php b/src/Options/ModuleOptions.php index 3aa85a4..5144c5f 100644 --- a/src/Options/ModuleOptions.php +++ b/src/Options/ModuleOptions.php @@ -31,11 +31,6 @@ */ class ModuleOptions extends AbstractOptions { - /** - * Key of the identity provider used to retrieve the identity - */ - protected string $identityProvider = 'Lmc\Rbac\Identity\AuthenticationIdentityProvider'; - /** * Guest role (used when no identity is found) * @@ -72,27 +67,6 @@ public function __construct($options = null) parent::__construct($options); } - /** - * Set the key of the identity provider used to retrieve the identity - * - * @param string $identityProvider - * @return void - */ - public function setIdentityProvider(string $identityProvider): void - { - $this->identityProvider = $identityProvider; - } - - /** - * Get the key of the identity provider used to retrieve the identity - * - * @return string - */ - public function getIdentityProvider(): string - { - return $this->identityProvider; - } - /** * Set the assertions options * diff --git a/test/ConfigProviderTest.php b/test/ConfigProviderTest.php index 886ffc9..bc56e82 100644 --- a/test/ConfigProviderTest.php +++ b/test/ConfigProviderTest.php @@ -32,6 +32,9 @@ public function testProvidesExpectedConfiguration() { $provider = new ConfigProvider(); $expected = [ + 'aliases' => [ + \Lmc\Rbac\Assertion\AssertionPluginManagerInterface::class => \Lmc\Rbac\Assertion\AssertionPluginManager::class, + ], 'factories' => [ \Lmc\Rbac\Assertion\AssertionPluginManager::class => \Lmc\Rbac\Assertion\AssertionPluginManagerFactory::class, \Lmc\Rbac\Options\ModuleOptions::class => \Lmc\Rbac\Options\ModuleOptionsFactory::class, diff --git a/test/Options/ModuleOptionsTest.php b/test/Options/ModuleOptionsTest.php index 523499e..bc07fc8 100644 --- a/test/Options/ModuleOptionsTest.php +++ b/test/Options/ModuleOptionsTest.php @@ -36,7 +36,6 @@ public function testAssertModuleDefaultOptions(): void $this->assertIsArray($moduleOptions->getRoleProvider()); $this->assertIsArray($moduleOptions->getAssertionMap()); $this->assertEquals('Lmc\Rbac\Role\InMemoryRoleProvider', key($moduleOptions->getRoleProvider())); - $this->assertEquals('Lmc\Rbac\Identity\AuthenticationIdentityProvider', $moduleOptions->getIdentityProvider()); } public function testSettersAndGetters(): void @@ -53,6 +52,5 @@ public function testSettersAndGetters(): void $this->assertEquals('unknown', $moduleOptions->getGuestRole()); $this->assertEquals([], $moduleOptions->getRoleProvider()); $this->assertEquals(['foo' => 'bar'], $moduleOptions->getAssertionMap()); - $this->assertEquals('foo', $moduleOptions->getIdentityProvider()); } }