primo commit
This commit is contained in:
+36
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Webauthn\MetadataService\Exception;
|
||||
|
||||
use Throwable;
|
||||
|
||||
class CertificateChainException extends MetadataServiceException
|
||||
{
|
||||
/**
|
||||
* @param array<string> $untrustedCertificates
|
||||
* @param array<string> $trustedCertificates
|
||||
*/
|
||||
public function __construct(
|
||||
public readonly array $untrustedCertificates,
|
||||
public readonly array $trustedCertificates,
|
||||
string $message,
|
||||
?Throwable $previous = null
|
||||
) {
|
||||
parent::__construct($message, $previous);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array<string> $untrustedCertificates
|
||||
* @param array<string> $trustedCertificates
|
||||
*/
|
||||
public static function create(
|
||||
array $untrustedCertificates,
|
||||
array $trustedCertificates,
|
||||
string $message = 'Unable to validate the certificate chain.',
|
||||
?Throwable $previous = null
|
||||
): self {
|
||||
return new self($untrustedCertificates, $trustedCertificates, $message, $previous);
|
||||
}
|
||||
}
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Webauthn\MetadataService\Exception;
|
||||
|
||||
use Throwable;
|
||||
|
||||
class CertificateException extends MetadataServiceException
|
||||
{
|
||||
public function __construct(
|
||||
public readonly string $certificate,
|
||||
string $message,
|
||||
?Throwable $previous = null
|
||||
) {
|
||||
parent::__construct($message, $previous);
|
||||
}
|
||||
}
|
||||
Vendored
+23
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Webauthn\MetadataService\Exception;
|
||||
|
||||
use Throwable;
|
||||
|
||||
final class CertificateRevocationListException extends MetadataServiceException
|
||||
{
|
||||
public function __construct(
|
||||
public readonly string $url,
|
||||
string $message,
|
||||
?Throwable $previous = null
|
||||
) {
|
||||
parent::__construct($message, $previous);
|
||||
}
|
||||
|
||||
public static function create(string $url, string $message, ?Throwable $previous = null): self
|
||||
{
|
||||
return new self($url, $message, $previous);
|
||||
}
|
||||
}
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Webauthn\MetadataService\Exception;
|
||||
|
||||
use Throwable;
|
||||
|
||||
final class ExpiredCertificateException extends CertificateException
|
||||
{
|
||||
public static function create(
|
||||
string $certificate,
|
||||
string $message = 'Expired certificate',
|
||||
?Throwable $previous = null
|
||||
): self {
|
||||
return new self($certificate, $message, $previous);
|
||||
}
|
||||
}
|
||||
+23
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Webauthn\MetadataService\Exception;
|
||||
|
||||
use Throwable;
|
||||
|
||||
final class InvalidCertificateException extends MetadataServiceException
|
||||
{
|
||||
public function __construct(
|
||||
public readonly string $certificate,
|
||||
string $message,
|
||||
?Throwable $previous = null
|
||||
) {
|
||||
parent::__construct($message, $previous);
|
||||
}
|
||||
|
||||
public static function create(string $certificate, string $message, ?Throwable $previous = null): self
|
||||
{
|
||||
return new self($certificate, $message, $previous);
|
||||
}
|
||||
}
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Webauthn\MetadataService\Exception;
|
||||
|
||||
use Exception;
|
||||
use Throwable;
|
||||
|
||||
class MetadataServiceException extends Exception
|
||||
{
|
||||
public function __construct(string $message, ?Throwable $previous = null)
|
||||
{
|
||||
parent::__construct($message, 0, $previous);
|
||||
}
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Webauthn\MetadataService\Exception;
|
||||
|
||||
class MetadataStatementException extends MetadataServiceException
|
||||
{
|
||||
}
|
||||
Vendored
+15
@@ -0,0 +1,15 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Webauthn\MetadataService\Exception;
|
||||
|
||||
use Throwable;
|
||||
|
||||
final class MetadataStatementLoadingException extends MetadataStatementException
|
||||
{
|
||||
public static function create(string $message, ?Throwable $previous = null): self
|
||||
{
|
||||
return new self($message, $previous);
|
||||
}
|
||||
}
|
||||
Vendored
+26
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Webauthn\MetadataService\Exception;
|
||||
|
||||
use Throwable;
|
||||
|
||||
final class MissingMetadataStatementException extends MetadataStatementException
|
||||
{
|
||||
public function __construct(
|
||||
public readonly string $aaguid,
|
||||
string $message,
|
||||
?Throwable $previous = null
|
||||
) {
|
||||
parent::__construct($message, $previous);
|
||||
}
|
||||
|
||||
public static function create(
|
||||
string $aaguid,
|
||||
string $message = 'The Metadata Statement is missing',
|
||||
?Throwable $previous = null
|
||||
): self {
|
||||
return new self($aaguid, $message, $previous);
|
||||
}
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Webauthn\MetadataService\Exception;
|
||||
|
||||
final class RevokedCertificateException extends CertificateException
|
||||
{
|
||||
}
|
||||
Reference in New Issue
Block a user