Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
MKodde committed Dec 13, 2023
1 parent 6157de9 commit 36867d2
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 11 deletions.
2 changes: 1 addition & 1 deletion config/openconext/parameters.yaml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
3 changes: 2 additions & 1 deletion config/packages/doctrine_migrations.yaml
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
doctrine_migrations:
migrations_paths: ['%kernel.project_dir%/src/Migrations']
migrations_paths:
DoctrineMigrations: '%kernel.project_dir%/src/Migrations'
9 changes: 9 additions & 0 deletions config/packages/monolog.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
1 change: 1 addition & 0 deletions config/packages/webauthn.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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%'
Expand Down
3 changes: 2 additions & 1 deletion src/Controller/AssertionResponseController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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');

Expand Down
11 changes: 6 additions & 5 deletions src/Entity/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -44,20 +45,20 @@ class User extends PublicKeyCredentialUserEntity implements UserInterface
public readonly string $displayName;

/**
* @var ArrayCollection<PublicKeyCredentialSource>
* @var ArrayCollectionAlias<PublicKeyCredentialSourceEntity>
*/
#[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();
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/Kernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down
2 changes: 0 additions & 2 deletions templates/base.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,5 @@
</div>
{% endblock %}

{% block javascripts %}{% endblock %}

</body>
</html>

0 comments on commit 36867d2

Please sign in to comment.