Skip to content

Commit

Permalink
Merge pull request #532 from web-auth/temp-fezrhrtj
Browse files Browse the repository at this point in the history
Merge up 4.8.x to 5.0.0
  • Loading branch information
Spomky authored Nov 19, 2023
2 parents da6369d + 450d964 commit aefb01b
Show file tree
Hide file tree
Showing 44 changed files with 391 additions and 219 deletions.
1 change: 0 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@
"psr/http-client": "^1.0",
"psr/http-factory": "^1.0",
"psr/log": "^1.0|^2.0|^3.0",
"spomky-labs/cbor-bundle": "^3.0",
"spomky-labs/cbor-php": "^3.0",
"spomky-labs/pki-framework": "^1.0",
"symfony/config": "^6.1",
Expand Down
70 changes: 68 additions & 2 deletions phpstan-baseline.neon
Original file line number Diff line number Diff line change
Expand Up @@ -794,6 +794,54 @@ parameters:
count: 1
path: src/symfony/src/CredentialOptionsBuilder/ProfileBasedRequestOptionsBuilder.php

-
message: """
#^Fetching class constant class of deprecated class Webauthn\\\\Bundle\\\\Event\\\\AuthenticatorAssertionResponseValidationFailedEvent\\:
since 4\\.3\\.0, use \\{@link \\\\Webauthn\\\\Event\\\\AuthenticatorAssertionResponseValidationFailedEvent\\} instead\\.$#
"""
count: 1
path: src/symfony/src/DataCollector/WebauthnCollector.php

-
message: """
#^Fetching class constant class of deprecated class Webauthn\\\\Bundle\\\\Event\\\\AuthenticatorAssertionResponseValidationSucceededEvent\\:
since 4\\.3\\.0, use \\{@link \\\\Webauthn\\\\Event\\\\AuthenticatorAssertionResponseValidationSucceededEvent\\} instead\\.$#
"""
count: 1
path: src/symfony/src/DataCollector/WebauthnCollector.php

-
message: """
#^Fetching class constant class of deprecated class Webauthn\\\\Bundle\\\\Event\\\\AuthenticatorAttestationResponseValidationSucceededEvent\\:
since 4\\.3\\.0, use \\{@link \\\\Webauthn\\\\Event\\\\AuthenticatorAttestationResponseValidationSucceededEvent\\} instead\\.$#
"""
count: 1
path: src/symfony/src/DataCollector/WebauthnCollector.php

-
message: """
#^Parameter \\$event of method Webauthn\\\\Bundle\\\\DataCollector\\\\WebauthnCollector\\:\\:addAuthenticatorAssertionResponseValidationFailed\\(\\) has typehint with deprecated class Webauthn\\\\Bundle\\\\Event\\\\AuthenticatorAssertionResponseValidationFailedEvent\\:
since 4\\.3\\.0, use \\{@link \\\\Webauthn\\\\Event\\\\AuthenticatorAssertionResponseValidationFailedEvent\\} instead\\.$#
"""
count: 1
path: src/symfony/src/DataCollector/WebauthnCollector.php

-
message: """
#^Parameter \\$event of method Webauthn\\\\Bundle\\\\DataCollector\\\\WebauthnCollector\\:\\:addAuthenticatorAssertionResponseValidationSucceeded\\(\\) has typehint with deprecated class Webauthn\\\\Bundle\\\\Event\\\\AuthenticatorAssertionResponseValidationSucceededEvent\\:
since 4\\.3\\.0, use \\{@link \\\\Webauthn\\\\Event\\\\AuthenticatorAssertionResponseValidationSucceededEvent\\} instead\\.$#
"""
count: 1
path: src/symfony/src/DataCollector/WebauthnCollector.php

-
message: """
#^Parameter \\$event of method Webauthn\\\\Bundle\\\\DataCollector\\\\WebauthnCollector\\:\\:addAuthenticatorAttestationResponseValidationSucceeded\\(\\) has typehint with deprecated class Webauthn\\\\Bundle\\\\Event\\\\AuthenticatorAttestationResponseValidationSucceededEvent\\:
since 4\\.3\\.0, use \\{@link \\\\Webauthn\\\\Event\\\\AuthenticatorAttestationResponseValidationSucceededEvent\\} instead\\.$#
"""
count: 1
path: src/symfony/src/DataCollector/WebauthnCollector.php

-
message: "#^Cannot call method integerNode\\(\\) on Symfony\\\\Component\\\\Config\\\\Definition\\\\Builder\\\\NodeParentInterface\\|null\\.$#"
count: 2
Expand Down Expand Up @@ -2169,7 +2217,7 @@ parameters:
#^Access to deprecated property \\$requireResidentKey of class Webauthn\\\\AuthenticatorSelectionCriteria\\:
Will be removed in 5\\.0\\. Please use residentKey instead\\*$#
"""
count: 2
count: 3
path: src/webauthn/src/AuthenticatorSelectionCriteria.php

-
Expand Down Expand Up @@ -2887,6 +2935,19 @@ parameters:
count: 1
path: src/webauthn/src/Denormalizer/PublicKeyCredentialUserEntityDenormalizer.php

-
message: "#^Cannot access offset 'type' on mixed\\.$#"
count: 1
path: src/webauthn/src/Denormalizer/TrustPathDenormalizer.php

-
message: """
#^Instantiation of deprecated class Webauthn\\\\TrustPath\\\\EcdaaKeyIdTrustPath\\:
since 4\\.2\\.0 and will be removed in 5\\.0\\.0\\. The ECDAA Trust Anchor does no longer exist in Webauthn specification\\.$#
"""
count: 1
path: src/webauthn/src/Denormalizer/TrustPathDenormalizer.php

-
message: "#^Method Webauthn\\\\Denormalizer\\\\TrustPathDenormalizer\\:\\:denormalize\\(\\) has parameter \\$context with no value type specified in iterable type array\\.$#"
count: 1
Expand All @@ -2898,10 +2959,15 @@ parameters:
path: src/webauthn/src/Denormalizer/TrustPathDenormalizer.php

-
message: "#^Parameter \\#2 \\$array of function array_key_exists expects array, mixed given\\.$#"
message: "#^Parameter \\#1 \\$ecdaaKeyId of class Webauthn\\\\TrustPath\\\\EcdaaKeyIdTrustPath constructor expects string, array given\\.$#"
count: 1
path: src/webauthn/src/Denormalizer/TrustPathDenormalizer.php

-
message: "#^Parameter \\#2 \\$array of function array_key_exists expects array, mixed given\\.$#"
count: 2
path: src/webauthn/src/Denormalizer/TrustPathDenormalizer.php

-
message: "#^Parameter \\#1 \\$json of static method Webauthn\\\\PublicKeyCredentialCreationOptions\\:\\:createFromArray\\(\\) expects array, mixed given\\.$#"
count: 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ public function __construct(
'Invalid attestation certificate identifier. Shall be a list of strings'
);
}
$this->attestationCertificateKeyIdentifiers = $attestationCertificateKeyIdentifiers;
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@
*/
class WebauthnStimulusExtension extends Extension implements PrependExtensionInterface
{
public function load(array $configs, ContainerBuilder $container)
public function load(array $configs, ContainerBuilder $container): void
{
// Nothing to do here. The bundle is only used to provide assets.
}

public function prepend(ContainerBuilder $container)
public function prepend(ContainerBuilder $container): void
{
if (! $this->isAssetMapperAvailable($container)) {
return;
Expand Down
1 change: 0 additions & 1 deletion src/symfony/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
"php": ">=8.1",
"nyholm/psr7": "^1.5",
"psr/event-dispatcher": "^1.0",
"spomky-labs/cbor-bundle": "^3.0",
"symfony/config": "^6.1",
"symfony/dependency-injection": "^6.1",
"symfony/framework-bundle": "^6.1",
Expand Down
46 changes: 23 additions & 23 deletions src/symfony/src/DataCollector/WebauthnCollector.php
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,9 @@ public function addPublicKeyCredentialCreationOptions(PublicKeyCredentialCreatio
{
$cloner = new VarCloner();
$this->publicKeyCredentialCreationOptions[] = [
'options' => $cloner->cloneVar($event->getPublicKeyCredentialCreationOptions()),
'options' => $cloner->cloneVar($event->publicKeyCredentialCreationOptions),
'json' => json_encode(
$event->getPublicKeyCredentialCreationOptions(),
$event->publicKeyCredentialCreationOptions,
JSON_THROW_ON_ERROR | JSON_PRETTY_PRINT
),
];
Expand All @@ -122,13 +122,13 @@ public function addAuthenticatorAttestationResponseValidationSucceeded(
): void {
$cloner = new VarCloner();
$this->authenticatorAttestationResponseValidationSucceeded[] = [
'attestation_response' => $cloner->cloneVar($event->getAuthenticatorAttestationResponse()),
'options' => $cloner->cloneVar($event->getPublicKeyCredentialCreationOptions()),
'attestation_response' => $cloner->cloneVar($event->authenticatorAttestationResponse),
'options' => $cloner->cloneVar($event->publicKeyCredentialCreationOptions),
'options_json' => json_encode(
$event->getPublicKeyCredentialCreationOptions(),
$event->publicKeyCredentialCreationOptions,
JSON_THROW_ON_ERROR | JSON_PRETTY_PRINT
),
'credential_source' => $cloner->cloneVar($event->getPublicKeyCredentialSource()),
'credential_source' => $cloner->cloneVar($event->publicKeyCredentialSource),
];
}

Expand All @@ -137,23 +137,23 @@ public function addAuthenticatorAttestationResponseValidationFailed(
): void {
$cloner = new VarCloner();
$this->authenticatorAttestationResponseValidationFailed[] = [
'attestation_response' => $cloner->cloneVar($event->getAuthenticatorAttestationResponse()),
'options' => $cloner->cloneVar($event->getPublicKeyCredentialCreationOptions()),
'attestation_response' => $cloner->cloneVar($event->authenticatorAttestationResponse),
'options' => $cloner->cloneVar($event->publicKeyCredentialCreationOptions),
'options_json' => json_encode(
$event->getPublicKeyCredentialCreationOptions(),
$event->publicKeyCredentialCreationOptions,
JSON_THROW_ON_ERROR | JSON_PRETTY_PRINT
),
'exception' => $cloner->cloneVar($event->getThrowable()),
'exception' => $cloner->cloneVar($event->throwable),
];
}

public function addPublicKeyCredentialRequestOptions(PublicKeyCredentialRequestOptionsCreatedEvent $event): void
{
$cloner = new VarCloner();
$this->publicKeyCredentialRequestOptions[] = [
'options' => $cloner->cloneVar($event->getPublicKeyCredentialRequestOptions()),
'options' => $cloner->cloneVar($event->publicKeyCredentialRequestOptions),
'json' => json_encode(
$event->getPublicKeyCredentialRequestOptions(),
$event->publicKeyCredentialRequestOptions,
JSON_THROW_ON_ERROR | JSON_PRETTY_PRINT
),
];
Expand All @@ -164,15 +164,15 @@ public function addAuthenticatorAssertionResponseValidationSucceeded(
): void {
$cloner = new VarCloner();
$this->authenticatorAssertionResponseValidationSucceeded[] = [
'user_handle' => $cloner->cloneVar($event->getUserHandle()),
'credential_id' => $cloner->cloneVar($event->getCredentialId()),
'assertion_response' => $cloner->cloneVar($event->getAuthenticatorAssertionResponse()),
'options' => $cloner->cloneVar($event->getPublicKeyCredentialRequestOptions()),
'user_handle' => $cloner->cloneVar($event->userHandle),
'credential_id' => $cloner->cloneVar($event->credentialId),
'assertion_response' => $cloner->cloneVar($event->authenticatorAssertionResponse),
'options' => $cloner->cloneVar($event->publicKeyCredentialRequestOptions),
'options_json' => json_encode(
$event->getPublicKeyCredentialRequestOptions(),
$event->publicKeyCredentialRequestOptions,
JSON_THROW_ON_ERROR | JSON_PRETTY_PRINT
),
'credential_source' => $cloner->cloneVar($event->getPublicKeyCredentialSource()),
'credential_source' => $cloner->cloneVar($event->publicKeyCredentialSource),
];
}

Expand All @@ -181,15 +181,15 @@ public function addAuthenticatorAssertionResponseValidationFailed(
): void {
$cloner = new VarCloner();
$this->authenticatorAssertionResponseValidationFailed[] = [
'user_handle' => $cloner->cloneVar($event->getUserHandle()),
'user_handle' => $cloner->cloneVar($event->userHandle),
'credential_id' => $cloner->cloneVar($event->getCredential()?->publicKeyCredentialId),
'assertion_response' => $cloner->cloneVar($event->getAuthenticatorAssertionResponse()),
'options' => $cloner->cloneVar($event->getPublicKeyCredentialRequestOptions()),
'assertion_response' => $cloner->cloneVar($event->authenticatorAssertionResponse),
'options' => $cloner->cloneVar($event->publicKeyCredentialRequestOptions),
'options_json' => json_encode(
$event->getPublicKeyCredentialRequestOptions(),
$event->publicKeyCredentialRequestOptions,
JSON_THROW_ON_ERROR | JSON_PRETTY_PRINT
),
'exception' => $cloner->cloneVar($event->getThrowable()),
'exception' => $cloner->cloneVar($event->throwable),
];
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@
use Webauthn\PublicKeyCredentialRequestOptions;
use Webauthn\PublicKeyCredentialSource;

/**
* @deprecated since 4.3.0, use {@link \Webauthn\Event\AuthenticatorAssertionResponseValidationFailedEvent} instead.
*/
class AuthenticatorAssertionResponseValidationFailedEvent extends BaseAuthenticatorAssertionResponseValidationFailedEvent
{
public function __construct(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@
use Webauthn\PublicKeyCredentialRequestOptions;
use Webauthn\PublicKeyCredentialSource;

/**
* @deprecated since 4.3.0, use {@link \Webauthn\Event\AuthenticatorAssertionResponseValidationSucceededEvent} instead.
*/
class AuthenticatorAssertionResponseValidationSucceededEvent extends BaseAuthenticatorAssertionResponseValidationSucceededEvent
{
public function __construct(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@
use Webauthn\Event\AuthenticatorAttestationResponseValidationFailedEvent as BaseAuthenticatorAttestationResponseValidationFailedEvent;
use Webauthn\PublicKeyCredentialCreationOptions;

/**
* @deprecated since 4.3.0, use {@link \Webauthn\Event\AuthenticatorAttestationResponseValidationFailedEvent} instead.
*/
class AuthenticatorAttestationResponseValidationFailedEvent extends BaseAuthenticatorAttestationResponseValidationFailedEvent
{
public function __construct(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@
use Webauthn\PublicKeyCredentialCreationOptions;
use Webauthn\PublicKeyCredentialSource;

/**
* @deprecated since 4.3.0, use {@link \Webauthn\Event\AuthenticatorAttestationResponseValidationSucceededEvent} instead.
*/
class AuthenticatorAttestationResponseValidationSucceededEvent extends BaseAuthenticatorAttestationResponseValidationSucceededEvent
{
public function __construct(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
class PublicKeyCredentialCreationOptionsCreatedEvent extends Event
{
public function __construct(
private readonly PublicKeyCredentialCreationOptions $publicKeyCredentialCreationOptions
public readonly PublicKeyCredentialCreationOptions $publicKeyCredentialCreationOptions
) {
}

Expand All @@ -19,6 +19,9 @@ public static function create(PublicKeyCredentialCreationOptions $publicKeyCrede
return new self($publicKeyCredentialCreationOptions);
}

/**
* @deprecated since 4.8.0. Will be removed in 5.0.0. Please use the property instead.
*/
public function getPublicKeyCredentialCreationOptions(): PublicKeyCredentialCreationOptions
{
return $this->publicKeyCredentialCreationOptions;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
class PublicKeyCredentialRequestOptionsCreatedEvent extends Event
{
public function __construct(
private readonly PublicKeyCredentialRequestOptions $publicKeyCredentialRequestOptions
public readonly PublicKeyCredentialRequestOptions $publicKeyCredentialRequestOptions
) {
}

Expand All @@ -19,6 +19,9 @@ public static function create(PublicKeyCredentialRequestOptions $publicKeyCreden
return new self($publicKeyCredentialRequestOptions);
}

/**
* @deprecated since 4.8.0. Will be removed in 5.0.0. Please use the property instead.
*/
public function getPublicKeyCredentialRequestOptions(): PublicKeyCredentialRequestOptions
{
return $this->publicKeyCredentialRequestOptions;
Expand Down
Loading

0 comments on commit aefb01b

Please sign in to comment.