Debian Codegraph @

lib/3rdParty/composer/web-auth/webauthn-lib/src/Event/AuthenticatorAssertionResponseValidationSucceededEvent.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 Webauthn\AuthenticatorAssertionResponse;
10 use Webauthn\CredentialRecord;
11 use Webauthn\PublicKeyCredentialRequestOptions;
12 use Webauthn\PublicKeyCredentialSource;
13
14 class AuthenticatorAssertionResponseValidationSucceededEvent
15 {
16 public function __construct(
17 public readonly AuthenticatorAssertionResponse $authenticatorAssertionResponse,
18 public readonly PublicKeyCredentialRequestOptions $publicKeyCredentialRequestOptions,
19 public readonly string $host,
20 public readonly ?string $userHandle,
21 public readonly CredentialRecord $credentialRecord
22 ) {
23 }
24
25 /**
26 * @deprecated since 5.3, use credentialRecord instead. Will be removed in 6.0.
27 */
28 public function __get(string $name): mixed
29 {
30 if ($name === 'publicKeyCredentialSource') {
31 return $this->getPublicKeyCredentialSource();
32 }
33
34 throw new LogicException(sprintf('Undefined property: %s::$%s', self::class, $name));
35 }
36
37 /**
38 * @deprecated since 5.3, use credentialRecord instead. Will be removed in 6.0.
39 */
40 public function getPublicKeyCredentialSource(): PublicKeyCredentialSource
41 {
42 if ($this->credentialRecord instanceof PublicKeyCredentialSource) {
43 return $this->credentialRecord;
44 }
45
46 return new PublicKeyCredentialSource(
47 $this->credentialRecord->publicKeyCredentialId,
48 $this->credentialRecord->type,
49 $this->credentialRecord->transports,
50 $this->credentialRecord->attestationType,
51 $this->credentialRecord->trustPath,
52 $this->credentialRecord->aaguid,
53 $this->credentialRecord->credentialPublicKey,
54 $this->credentialRecord->userHandle,
55 $this->credentialRecord->counter,
56 $this->credentialRecord->otherUI,
57 $this->credentialRecord->backupEligible,
58 $this->credentialRecord->backupStatus,
59 $this->credentialRecord->uvInitialized,
60 );
61 }
62 }