Refactor authentication system (#2602)

Make auth configuration available via UI, remove FOSUserBundle and SAML-Bundle dependency
This commit is contained in:
Kevin Papst
2021-06-10 15:34:13 +02:00
committed by GitHub
parent 286b63e2c8
commit 7f20cb045c
155 changed files with 5590 additions and 1802 deletions

View File

@@ -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));
}
}