From a6b52cfe15c5ee8a764e87d11826045a54206a7a Mon Sep 17 00:00:00 2001 From: "Eric Richer eric.richer@vistoconsulting.com" Date: Thu, 8 Aug 2024 10:38:29 -0400 Subject: [PATCH 1/4] Fixed component installer config Signed-off-by: Eric Richer eric.richer@vistoconsulting.com --- composer.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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": { From 63e604eb8669b9d9984041495b9c098e017493c6 Mon Sep 17 00:00:00 2001 From: "Eric Richer eric.richer@vistoconsulting.com" Date: Thu, 8 Aug 2024 11:11:59 -0400 Subject: [PATCH 2/4] Removed IdentityProvider from option Signed-off-by: Eric Richer eric.richer@vistoconsulting.com --- src/Options/ModuleOptions.php | 26 -------------------------- test/Options/ModuleOptionsTest.php | 2 -- 2 files changed, 28 deletions(-) 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/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()); } } From 287571fcaae9a421fd1a87cd7c283357746049a1 Mon Sep 17 00:00:00 2001 From: "Eric Richer eric.richer@vistoconsulting.com" Date: Thu, 8 Aug 2024 11:25:30 -0400 Subject: [PATCH 3/4] Fix ConfigProvider.php Signed-off-by: Eric Richer eric.richer@vistoconsulting.com --- src/ConfigProvider.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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, From 342de4c40a5ad1a754798ab8bccf432c3bc56379 Mon Sep 17 00:00:00 2001 From: "Eric Richer eric.richer@vistoconsulting.com" Date: Thu, 8 Aug 2024 11:25:30 -0400 Subject: [PATCH 4/4] Fix ConfigProvider.php Signed-off-by: Eric Richer eric.richer@vistoconsulting.com --- src/ConfigProvider.php | 6 +++--- test/ConfigProviderTest.php | 3 +++ 2 files changed, 6 insertions(+), 3 deletions(-) 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/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,