From 1bb7a8a2d2d1b025027b31016d1158fa1162c2f7 Mon Sep 17 00:00:00 2001 From: Michiel Kodde Date: Wed, 13 Dec 2023 09:34:45 +0100 Subject: [PATCH] Working on configuration --- config/openconext/parameters.yaml.dist | 2 +- config/packages/doctrine_migrations.yaml | 3 ++- config/packages/monolog.yaml | 9 +++++++++ config/packages/webauthn.yaml | 1 + src/Controller/AssertionResponseController.php | 3 ++- src/Entity/User.php | 11 ++++++----- src/Kernel.php | 2 +- templates/base.html.twig | 2 -- 8 files changed, 22 insertions(+), 11 deletions(-) diff --git a/config/openconext/parameters.yaml.dist b/config/openconext/parameters.yaml.dist index 1d0d9f24..bbe5b2a7 100644 --- a/config/openconext/parameters.yaml.dist +++ b/config/openconext/parameters.yaml.dist @@ -7,7 +7,7 @@ parameters: app_secret: SeTW1ThY0uR0WnS3cR37 # The Symfony app secret. For more details see: # https://symfony.com/doc/current/reference/configuration/framework.html#secret - database_url: "mysql://webauthn:webauthn_secret@mariadb:3306/webauthn" + database_url: 'mysql://webauthn_user:webauthn_secret@mariadb:3306/webauthn' support_url: en_GB: "https://support.example.org/faq-strong-authentication" nl_NL: "https://support.example.org/faq-sterke-authenticatie" diff --git a/config/packages/doctrine_migrations.yaml b/config/packages/doctrine_migrations.yaml index 64f21de7..ef51f5df 100644 --- a/config/packages/doctrine_migrations.yaml +++ b/config/packages/doctrine_migrations.yaml @@ -1,2 +1,3 @@ doctrine_migrations: - migrations_paths: ['%kernel.project_dir%/src/Migrations'] + migrations_paths: + DoctrineMigrations: '%kernel.project_dir%/src/Migrations' diff --git a/config/packages/monolog.yaml b/config/packages/monolog.yaml index 5941f1b7..755ba3dc 100644 --- a/config/packages/monolog.yaml +++ b/config/packages/monolog.yaml @@ -13,3 +13,12 @@ monolog: console: type: console process_psr_3_messages: false + +when@dev: + monolog: + handlers: + prod-signaler: + channels: ['!event'] + type: fingers_crossed + action_level: INFO + passthru_level: INFO diff --git a/config/packages/webauthn.yaml b/config/packages/webauthn.yaml index d2294af3..77721d2f 100644 --- a/config/packages/webauthn.yaml +++ b/config/packages/webauthn.yaml @@ -5,6 +5,7 @@ webauthn: default: public_key_credential_parameters: - !php/const Cose\Algorithms::COSE_ALGORITHM_ES256 + - !php/const Cose\Algorithms::COSE_ALGORITHM_RS256 rp: name: '%webauthn_name%' icon: '%webauthn_logo%' diff --git a/src/Controller/AssertionResponseController.php b/src/Controller/AssertionResponseController.php index a28e52ab..b1526944 100644 --- a/src/Controller/AssertionResponseController.php +++ b/src/Controller/AssertionResponseController.php @@ -20,6 +20,7 @@ namespace Surfnet\Webauthn\Controller; +use Psr\Http\Message\RequestInterface; use Surfnet\Webauthn\Exception\NoActiveAuthenrequestException; use Surfnet\Webauthn\PublicKeyCredentialRequestOptionsStore; use Surfnet\Webauthn\ValidationJsonResponse; @@ -54,7 +55,7 @@ public function __construct( * Handles the assertion public key response. */ #[Route(path: '/verify-assertion', name: 'verify-assertion', methods: ['POST'])] - public function action(ServerRequestInterface $psr7Request, Request $request): Response + public function action(RequestInterface $psr7Request, Request $request): Response { $this->logger->info('Verifying if there is a pending authentication from SP'); diff --git a/src/Entity/User.php b/src/Entity/User.php index 1d57bd67..4ab22d67 100644 --- a/src/Entity/User.php +++ b/src/Entity/User.php @@ -20,9 +20,10 @@ namespace Surfnet\Webauthn\Entity; -use Doctrine\Common\Collections\ArrayCollection; +use Doctrine\Common\Collections\ArrayCollection as ArrayCollectionAlias; use Doctrine\ORM\Mapping as ORM; use Doctrine\ORM\Mapping\JoinColumn; +use Surfnet\Webauthn\Entity\PublicKeyCredentialSource as PublicKeyCredentialSourceEntity; use Surfnet\Webauthn\Repository\UserRepository; use Symfony\Component\Security\Core\User\UserInterface; use Symfony\Component\Validator\Constraints as Assert; @@ -44,20 +45,20 @@ class User extends PublicKeyCredentialUserEntity implements UserInterface public readonly string $displayName; /** - * @var ArrayCollection + * @var ArrayCollectionAlias */ - #[ORM\ManyToMany(targetEntity:PublicKeyCredentialSource::class)] + #[ORM\ManyToMany(targetEntity: PublicKeyCredentialSourceEntity::class)] #[ORM\JoinTable( name: "users_user_handles", joinColumns:[new JoinColumn(name: "user_id", referencedColumnName: "id")], inverseJoinColumns:[new JoinColumn(name:"user_handle", referencedColumnName: "id", unique: true)] )] - protected ArrayCollection $publicKeyCredentialSources; + protected ArrayCollectionAlias $publicKeyCredentialSources; public function __construct(string $id, string $name, string $displayName) { parent::__construct($name, $id, $displayName); - $this->publicKeyCredentialSources = new ArrayCollection(); + $this->publicKeyCredentialSources = new ArrayCollectionAlias(); } /** diff --git a/src/Kernel.php b/src/Kernel.php index 3a5a49db..3092cc44 100644 --- a/src/Kernel.php +++ b/src/Kernel.php @@ -51,7 +51,7 @@ public function getProjectDir(): string protected function configureContainer(ContainerBuilder $container, LoaderInterface $loader): void { $container->addResource(new FileResource($this->getProjectDir().'/config/bundles.php')); - $container->setParameter('container.dumper.inline_class_loader', PHP_VERSION_ID < 70400 || $this->debug); + $container->setParameter('.container.dumper.inline_class_loader', PHP_VERSION_ID < 70400 || $this->debug); $container->setParameter('.container.dumper.inline_factories', true); $confDir = $this->getProjectDir().'/config'; diff --git a/templates/base.html.twig b/templates/base.html.twig index 23197654..9c0b516f 100644 --- a/templates/base.html.twig +++ b/templates/base.html.twig @@ -61,7 +61,5 @@ {% endblock %} -{% block javascripts %}{% endblock %} -