Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Miscallenous updates #78

Merged
merged 6 commits into from
Aug 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
6 changes: 3 additions & 3 deletions src/ConfigProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,6 @@

namespace Lmc\Rbac;

use Lmc\Rbac\Assertion\AssertionPluginManager;
use Lmc\Rbac\Identity\AuthenticationIdentityProvider;

/**
* The configuration provider for the LmcRbac module
*
Expand All @@ -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,
Expand Down
26 changes: 0 additions & 26 deletions src/Options/ModuleOptions.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)
*
Expand Down Expand Up @@ -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
*
Expand Down
3 changes: 3 additions & 0 deletions test/ConfigProviderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 0 additions & 2 deletions test/Options/ModuleOptionsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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());
}
}