Refactor authentication system (#2602)
Make auth configuration available via UI, remove FOSUserBundle and SAML-Bundle dependency
This commit is contained in:
@@ -9,14 +9,17 @@
|
||||
|
||||
namespace App\Tests\Mocks\Saml;
|
||||
|
||||
use App\Saml\SamlAuth;
|
||||
use App\Configuration\SamlConfiguration;
|
||||
use App\Configuration\SystemConfiguration;
|
||||
use App\Saml\SamlAuthFactory;
|
||||
use App\Tests\Configuration\TestConfigLoader;
|
||||
use App\Tests\Mocks\AbstractMockFactory;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\HttpFoundation\RequestStack;
|
||||
|
||||
class SamlAuthFactory extends AbstractMockFactory
|
||||
class SamlAuthFactoryFactory extends AbstractMockFactory
|
||||
{
|
||||
public function create(?array $connection = null, bool $fromTrustedProxy = false): SamlAuth
|
||||
public function create(?array $connection = null, bool $fromTrustedProxy = false): SamlAuthFactory
|
||||
{
|
||||
if (null === $connection) {
|
||||
$connection = [
|
||||
@@ -84,6 +87,10 @@ class SamlAuthFactory extends AbstractMockFactory
|
||||
$requestStack = new RequestStack();
|
||||
$requestStack->push($request);
|
||||
|
||||
return new SamlAuth($requestStack, $connection);
|
||||
$configuration = new SystemConfiguration(new TestConfigLoader([]), [
|
||||
'saml' => ['connection' => $connection]
|
||||
]);
|
||||
|
||||
return new SamlAuthFactory($requestStack, new SamlConfiguration($configuration));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user