Debian Codegraph @

lib/3rdParty/composer/web-auth/webauthn-lib/src/Event/AuthenticatorAssertionResponseValidationFailedEvent.php

raw symbols SCIP
1 <?php
2
3 declare(strict_types=1);
4
5 namespace Webauthn\Event;
6
7 use LogicException;
8 use function sprintf;
9 use Throwable;
10 use Webauthn\AuthenticatorAssertionResponse;
11 use Webauthn\CredentialRecord;
12 use Webauthn\PublicKeyCredentialRequestOptions;
13 use Webauthn\PublicKeyCredentialSource;
14
15 class AuthenticatorAssertionResponseValidationFailedEvent
16 {
17 public function __construct(
18 public readonly CredentialRecord $credentialRecord,
19 public readonly AuthenticatorAssertionResponse $authenticatorAssertionResponse,
20 public readonly PublicKeyCredentialRequestOptions $publicKeyCredentialRequestOptions,
21 public readonly string $host,
22 public readonly ?string $userHandle,
23 public readonly Throwable $throwable
24 ) {
25 }
26
27 /**
28 * @deprecated since 5.3, use credentialRecord instead. Will be removed in 6.0.
29 */
30 public function __get(string $name): mixed
31 {
32 if ($name === 'credentialSource') {
33 return $this->getPublicKeyCredentialSource();
34 }
35
36 throw new LogicException(sprintf('Undefined property: %s::$%s', self::class, $name));
37 }
38
39 /**
40 * @deprecated since 5.3, use credentialRecord instead. Will be removed in 6.0.
41 */
42 public function getPublicKeyCredentialSource(): PublicKeyCredentialSource
43 {
44 if ($this->credentialRecord instanceof PublicKeyCredentialSource) {
45 return $this->credentialRecord;
46 }
47
48 return new PublicKeyCredentialSource(
49 $this->credentialRecord->publicKeyCredentialId,
50 $this->credentialRecord->type,
51 $this->credentialRecord->transports,
52 $this->credentialRecord->attestationType,
53 $this->credentialRecord->trustPath,
54 $this->credentialRecord->aaguid,
55 $this->credentialRecord->credentialPublicKey,
56 $this->credentialRecord->userHandle,
57 $this->credentialRecord->counter,
58 $this->credentialRecord->otherUI,
59 $this->credentialRecord->backupEligible,
60 $this->credentialRecord->backupStatus,
61 $this->credentialRecord->uvInitialized,
62 );
63 }
64 }