Skip to content
This repository was archived by the owner on Jan 29, 2020. It is now read-only.

Commit 48c1086

Browse files
committed
Fixed authentication config
1 parent e6410f4 commit 48c1086

File tree

5 files changed

+8
-8
lines changed

5 files changed

+8
-8
lines changed

src/ConfigProvider.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ public function getDependencies() : array
2929
'aliases' => [
3030
// Change the alias value for Authentication adapter and
3131
// UserRepository adapter
32-
//AuthenticationInterface::class => Adapter\BasicAccess::class,
33-
//UserRepositoryInterface::class => UserRepository\Htpasswd::class
32+
AuthenticationInterface::class => Adapter\BasicAccess::class,
33+
UserRepositoryInterface::class => UserRepository\Htpasswd::class
3434
],
3535
'factories' => [
3636
AuthenticationMiddleware::class => AuthenticationMiddlewareFactory::class,

src/UserRepository/HtpasswdFactory.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ class HtpasswdFactory
1414
{
1515
public function __invoke(ContainerInterface $container) : Htpasswd
1616
{
17-
$htpasswd = $container->get('config')['user_repository']['htpasswd'] ?? null;
17+
$htpasswd = $container->get('config')['authentication']['htpasswd'] ?? null;
1818
if (null === $htpasswd) {
1919
throw new Exception\InvalidConfigException(
2020
'Htpasswd file name is not present in user_register config'

src/UserRepository/PdoDatabaseFactory.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ class PdoDatabaseFactory
1515
{
1616
public function __invoke(ContainerInterface $container) : PdoDatabase
1717
{
18-
$pdo = $container->get('config')['user_repository']['pdo'] ?? null;
18+
$pdo = $container->get('config')['authentication']['pdo'] ?? null;
1919
if (null === $pdo) {
2020
throw new Exception\InvalidConfigException(
2121
'PDO values are missing in user_register config'

test/UserRepository/HtpasswdFactoryTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public function testInvokeWithEmptyConfig()
3535
public function testInvokeWithInvalidConfig()
3636
{
3737
$this->container->get('config')->willReturn([
38-
'user_repository' => [
38+
'authentication' => [
3939
'htpasswd' => 'foo'
4040
]
4141
]);
@@ -45,7 +45,7 @@ public function testInvokeWithInvalidConfig()
4545
public function testInvokeWithValidConfig()
4646
{
4747
$this->container->get('config')->willReturn([
48-
'user_repository' => [
48+
'authentication' => [
4949
'htpasswd' => __DIR__ . '/../TestAssets/htpasswd'
5050
]
5151
]);

test/UserRepository/PdoDatabaseFactoryTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,15 +62,15 @@ public function getPdoConfig()
6262
public function testInvokeWithInvalidConfig($pdoConfig)
6363
{
6464
$this->container->get('config')->willReturn([
65-
'user_repository' => [ 'pdo' => $pdoConfig ]
65+
'authentication' => [ 'pdo' => $pdoConfig ]
6666
]);
6767
$pdoDatabase = ($this->factory)($this->container->reveal());
6868
}
6969

7070
public function testInvokeWithValidConfig()
7171
{
7272
$this->container->get('config')->willReturn([
73-
'user_repository' => [
73+
'authentication' => [
7474
'pdo' => [
7575
'dsn' => 'sqlite:'. __DIR__ . '/../TestAssets/pdo.sqlite',
7676
'table' => 'user',

0 commit comments

Comments
 (0)