Обновление клиента (apps, 3rdparty, install)
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Webauthn\Event;
|
||||
|
||||
use Webauthn\AttestationStatement\AttestationObject;
|
||||
|
||||
class AttestationObjectLoaded implements WebauthnEvent
|
||||
{
|
||||
public function __construct(
|
||||
public readonly AttestationObject $attestationObject
|
||||
) {
|
||||
}
|
||||
|
||||
public static function create(AttestationObject $attestationObject): self
|
||||
{
|
||||
return new self($attestationObject);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Webauthn\Event;
|
||||
|
||||
use Webauthn\AttestationStatement\AttestationStatement;
|
||||
|
||||
class AttestationStatementLoaded implements WebauthnEvent
|
||||
{
|
||||
public function __construct(
|
||||
public readonly AttestationStatement $attestationStatement
|
||||
) {
|
||||
}
|
||||
|
||||
public static function create(AttestationStatement $attestationStatement): self
|
||||
{
|
||||
return new self($attestationStatement);
|
||||
}
|
||||
}
|
||||
Vendored
+94
@@ -0,0 +1,94 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Webauthn\Event;
|
||||
|
||||
use Psr\Http\Message\ServerRequestInterface;
|
||||
use Throwable;
|
||||
use Webauthn\AuthenticatorAssertionResponse;
|
||||
use Webauthn\PublicKeyCredentialRequestOptions;
|
||||
use Webauthn\PublicKeyCredentialSource;
|
||||
|
||||
class AuthenticatorAssertionResponseValidationFailedEvent
|
||||
{
|
||||
public function __construct(
|
||||
public readonly string|PublicKeyCredentialSource $credentialId,
|
||||
public readonly AuthenticatorAssertionResponse $authenticatorAssertionResponse,
|
||||
public readonly PublicKeyCredentialRequestOptions $publicKeyCredentialRequestOptions,
|
||||
public readonly ServerRequestInterface|string $host,
|
||||
public readonly ?string $userHandle,
|
||||
public readonly Throwable $throwable
|
||||
) {
|
||||
if ($host instanceof ServerRequestInterface) {
|
||||
trigger_deprecation(
|
||||
'web-auth/webauthn-lib',
|
||||
'4.5.0',
|
||||
sprintf(
|
||||
'Passing a %s to the class "%s" is deprecated since 4.5.0 and will be removed in 5.0.0. Please inject the host as a string instead.',
|
||||
ServerRequestInterface::class,
|
||||
self::class
|
||||
)
|
||||
);
|
||||
}
|
||||
if (! $this->credentialId instanceof PublicKeyCredentialSource) {
|
||||
trigger_deprecation(
|
||||
'web-auth/webauthn-lib',
|
||||
'4.6.0',
|
||||
'Passing a string for the argument "$credentialId" is deprecated since 4.6.0. Please set the PublicKeyCredentialSource instead.'
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated since 4.7.0 and will be removed in 5.0.0. Please use the `getCredential()` method instead
|
||||
* @infection-ignore-all
|
||||
*/
|
||||
public function getCredentialId(): string
|
||||
{
|
||||
return $this->credentialId instanceof PublicKeyCredentialSource ? $this->credentialId->publicKeyCredentialId : $this->credentialId;
|
||||
}
|
||||
|
||||
public function getCredential(): ?PublicKeyCredentialSource
|
||||
{
|
||||
return $this->credentialId instanceof PublicKeyCredentialSource ? $this->credentialId : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated since 4.8.0. Will be removed in 5.0.0. Please use the property instead.
|
||||
*/
|
||||
public function getAuthenticatorAssertionResponse(): AuthenticatorAssertionResponse
|
||||
{
|
||||
return $this->authenticatorAssertionResponse;
|
||||
}
|
||||
|
||||
public function getPublicKeyCredentialRequestOptions(): PublicKeyCredentialRequestOptions
|
||||
{
|
||||
return $this->publicKeyCredentialRequestOptions;
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated since 4.5.0 and will be removed in 5.0.0. Please use the `host` property instead
|
||||
* @infection-ignore-all
|
||||
*/
|
||||
public function getRequest(): ServerRequestInterface|string
|
||||
{
|
||||
return $this->host;
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated since 4.8.0. Will be removed in 5.0.0. Please use the property instead.
|
||||
*/
|
||||
public function getUserHandle(): ?string
|
||||
{
|
||||
return $this->userHandle;
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated since 4.8.0. Will be removed in 5.0.0. Please use the property instead.
|
||||
*/
|
||||
public function getThrowable(): Throwable
|
||||
{
|
||||
return $this->throwable;
|
||||
}
|
||||
}
|
||||
Vendored
+90
@@ -0,0 +1,90 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Webauthn\Event;
|
||||
|
||||
use Psr\Http\Message\ServerRequestInterface;
|
||||
use Webauthn\AuthenticatorAssertionResponse;
|
||||
use Webauthn\PublicKeyCredentialRequestOptions;
|
||||
use Webauthn\PublicKeyCredentialSource;
|
||||
|
||||
class AuthenticatorAssertionResponseValidationSucceededEvent
|
||||
{
|
||||
public function __construct(
|
||||
public readonly null|string $credentialId,
|
||||
public readonly AuthenticatorAssertionResponse $authenticatorAssertionResponse,
|
||||
public readonly PublicKeyCredentialRequestOptions $publicKeyCredentialRequestOptions,
|
||||
public readonly ServerRequestInterface|string $host,
|
||||
public readonly ?string $userHandle,
|
||||
public readonly PublicKeyCredentialSource $publicKeyCredentialSource
|
||||
) {
|
||||
if ($host instanceof ServerRequestInterface) {
|
||||
trigger_deprecation(
|
||||
'web-auth/webauthn-lib',
|
||||
'4.5.0',
|
||||
sprintf(
|
||||
'Passing a %s to the class "%s" is deprecated since 4.5.0 and will be removed in 5.0.0. Please inject the host as a string instead.',
|
||||
ServerRequestInterface::class,
|
||||
self::class
|
||||
)
|
||||
);
|
||||
}
|
||||
if ($this->credentialId !== null) {
|
||||
trigger_deprecation(
|
||||
'web-auth/webauthn-lib',
|
||||
'4.6.0',
|
||||
'The argument "$credentialId" is deprecated since 4.6.0 and will be removed in 5.0.0. Please set null instead.'
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated since 4.8.0. Will be removed in 5.0.0. Please use the property instead.
|
||||
*/
|
||||
public function getCredentialId(): string
|
||||
{
|
||||
return $this->publicKeyCredentialSource->publicKeyCredentialId;
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated since 4.8.0. Will be removed in 5.0.0. Please use the property instead.
|
||||
*/
|
||||
public function getAuthenticatorAssertionResponse(): AuthenticatorAssertionResponse
|
||||
{
|
||||
return $this->authenticatorAssertionResponse;
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated since 4.8.0. Will be removed in 5.0.0. Please use the property instead.
|
||||
*/
|
||||
public function getPublicKeyCredentialRequestOptions(): PublicKeyCredentialRequestOptions
|
||||
{
|
||||
return $this->publicKeyCredentialRequestOptions;
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated since 4.5.0 and will be removed in 5.0.0. Please use the `host` property instead
|
||||
* @infection-ignore-all
|
||||
*/
|
||||
public function getRequest(): ServerRequestInterface|string
|
||||
{
|
||||
return $this->host;
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated since 4.8.0. Will be removed in 5.0.0. Please use the property instead.
|
||||
*/
|
||||
public function getUserHandle(): ?string
|
||||
{
|
||||
return $this->userHandle;
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated since 4.8.0. Will be removed in 5.0.0. Please use the property instead.
|
||||
*/
|
||||
public function getPublicKeyCredentialSource(): PublicKeyCredentialSource
|
||||
{
|
||||
return $this->publicKeyCredentialSource;
|
||||
}
|
||||
}
|
||||
Vendored
+65
@@ -0,0 +1,65 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Webauthn\Event;
|
||||
|
||||
use Psr\Http\Message\ServerRequestInterface;
|
||||
use Throwable;
|
||||
use Webauthn\AuthenticatorAttestationResponse;
|
||||
use Webauthn\PublicKeyCredentialCreationOptions;
|
||||
|
||||
class AuthenticatorAttestationResponseValidationFailedEvent
|
||||
{
|
||||
public function __construct(
|
||||
public readonly AuthenticatorAttestationResponse $authenticatorAttestationResponse,
|
||||
public readonly PublicKeyCredentialCreationOptions $publicKeyCredentialCreationOptions,
|
||||
public readonly ServerRequestInterface|string $host,
|
||||
public readonly Throwable $throwable
|
||||
) {
|
||||
if ($host instanceof ServerRequestInterface) {
|
||||
trigger_deprecation(
|
||||
'web-auth/webauthn-lib',
|
||||
'4.5.0',
|
||||
sprintf(
|
||||
'Passing a %s to the class "%s" is deprecated since 4.5.0 and will be removed in 5.0.0. Please inject the host as a string instead.',
|
||||
ServerRequestInterface::class,
|
||||
self::class
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated since 4.8.0. Will be removed in 5.0.0. Please use the property instead.
|
||||
*/
|
||||
public function getAuthenticatorAttestationResponse(): AuthenticatorAttestationResponse
|
||||
{
|
||||
return $this->authenticatorAttestationResponse;
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated since 4.8.0. Will be removed in 5.0.0. Please use the property instead.
|
||||
*/
|
||||
public function getPublicKeyCredentialCreationOptions(): PublicKeyCredentialCreationOptions
|
||||
{
|
||||
return $this->publicKeyCredentialCreationOptions;
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated since 4.5.0 and will be removed in 5.0.0. Please use the `host` property instead
|
||||
* @infection-ignore-all
|
||||
*/
|
||||
public function getRequest(): ServerRequestInterface|string
|
||||
{
|
||||
return $this->host;
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated since 4.8.0. Will be removed in 5.0.0. Please use the property instead.
|
||||
*/
|
||||
public function getThrowable(): Throwable
|
||||
{
|
||||
return $this->throwable;
|
||||
}
|
||||
}
|
||||
+65
@@ -0,0 +1,65 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Webauthn\Event;
|
||||
|
||||
use Psr\Http\Message\ServerRequestInterface;
|
||||
use Webauthn\AuthenticatorAttestationResponse;
|
||||
use Webauthn\PublicKeyCredentialCreationOptions;
|
||||
use Webauthn\PublicKeyCredentialSource;
|
||||
|
||||
class AuthenticatorAttestationResponseValidationSucceededEvent
|
||||
{
|
||||
public function __construct(
|
||||
public readonly AuthenticatorAttestationResponse $authenticatorAttestationResponse,
|
||||
public readonly PublicKeyCredentialCreationOptions $publicKeyCredentialCreationOptions,
|
||||
public readonly ServerRequestInterface|string $host,
|
||||
public readonly PublicKeyCredentialSource $publicKeyCredentialSource
|
||||
) {
|
||||
if ($host instanceof ServerRequestInterface) {
|
||||
trigger_deprecation(
|
||||
'web-auth/webauthn-lib',
|
||||
'4.5.0',
|
||||
sprintf(
|
||||
'Passing a %s to the class "%s" is deprecated since 4.5.0 and will be removed in 5.0.0. Please inject the host as a string instead.',
|
||||
ServerRequestInterface::class,
|
||||
self::class
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated since 4.8.0. Will be removed in 5.0.0. Please use the property instead.
|
||||
*/
|
||||
public function getAuthenticatorAttestationResponse(): AuthenticatorAttestationResponse
|
||||
{
|
||||
return $this->authenticatorAttestationResponse;
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated since 4.8.0. Will be removed in 5.0.0. Please use the property instead.
|
||||
*/
|
||||
public function getPublicKeyCredentialCreationOptions(): PublicKeyCredentialCreationOptions
|
||||
{
|
||||
return $this->publicKeyCredentialCreationOptions;
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated since 4.5.0 and will be removed in 5.0.0. Please use the `host` property instead
|
||||
* @infection-ignore-all
|
||||
*/
|
||||
public function getRequest(): ServerRequestInterface|string
|
||||
{
|
||||
return $this->host;
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated since 4.8.0. Will be removed in 5.0.0. Please use the property instead.
|
||||
*/
|
||||
public function getPublicKeyCredentialSource(): PublicKeyCredentialSource
|
||||
{
|
||||
return $this->publicKeyCredentialSource;
|
||||
}
|
||||
}
|
||||
+28
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Webauthn\Event;
|
||||
|
||||
/**
|
||||
* @final
|
||||
*/
|
||||
class BeforeCertificateChainValidation implements WebauthnEvent
|
||||
{
|
||||
/**
|
||||
* @param string[] $untrustedCertificates
|
||||
*/
|
||||
public function __construct(
|
||||
public readonly array $untrustedCertificates,
|
||||
public readonly string $trustedCertificate
|
||||
) {
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string[] $untrustedCertificates
|
||||
*/
|
||||
public static function create(array $untrustedCertificates, string $trustedCertificate): self
|
||||
{
|
||||
return new self($untrustedCertificates, $trustedCertificate);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Webauthn\Event;
|
||||
|
||||
use Psr\EventDispatcher\EventDispatcherInterface;
|
||||
|
||||
interface CanDispatchEvents
|
||||
{
|
||||
public function setEventDispatcher(EventDispatcherInterface $eventDispatcher): void;
|
||||
}
|
||||
+28
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Webauthn\Event;
|
||||
|
||||
/**
|
||||
* @final
|
||||
*/
|
||||
class CertificateChainValidationFailed implements WebauthnEvent
|
||||
{
|
||||
/**
|
||||
* @param string[] $untrustedCertificates
|
||||
*/
|
||||
public function __construct(
|
||||
public readonly array $untrustedCertificates,
|
||||
public readonly string $trustedCertificate
|
||||
) {
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string[] $untrustedCertificates
|
||||
*/
|
||||
public static function create(array $untrustedCertificates, string $trustedCertificate): self
|
||||
{
|
||||
return new self($untrustedCertificates, $trustedCertificate);
|
||||
}
|
||||
}
|
||||
+28
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Webauthn\Event;
|
||||
|
||||
/**
|
||||
* @final
|
||||
*/
|
||||
class CertificateChainValidationSucceeded implements WebauthnEvent
|
||||
{
|
||||
/**
|
||||
* @param string[] $untrustedCertificates
|
||||
*/
|
||||
public function __construct(
|
||||
public readonly array $untrustedCertificates,
|
||||
public readonly string $trustedCertificate
|
||||
) {
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string[] $untrustedCertificates
|
||||
*/
|
||||
public static function create(array $untrustedCertificates, string $trustedCertificate): self
|
||||
{
|
||||
return new self($untrustedCertificates, $trustedCertificate);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Webauthn\Event;
|
||||
|
||||
use Webauthn\MetadataService\Statement\MetadataStatement;
|
||||
|
||||
/**
|
||||
* @final
|
||||
*/
|
||||
class MetadataStatementFound implements WebauthnEvent
|
||||
{
|
||||
public function __construct(
|
||||
public readonly MetadataStatement $metadataStatement
|
||||
) {
|
||||
}
|
||||
|
||||
public static function create(MetadataStatement $metadataStatement): self
|
||||
{
|
||||
return new self($metadataStatement);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Webauthn\Event;
|
||||
|
||||
use Psr\EventDispatcher\EventDispatcherInterface;
|
||||
|
||||
/**
|
||||
* @final
|
||||
*/
|
||||
class NullEventDispatcher implements EventDispatcherInterface
|
||||
{
|
||||
public function dispatch(object $event): object
|
||||
{
|
||||
return $event;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Webauthn\Event;
|
||||
|
||||
interface WebauthnEvent
|
||||
{
|
||||
}
|
||||
Reference in New Issue
Block a user