Skip to content
This repository has been archived by the owner on Mar 25, 2024. It is now read-only.

Finish deprecation of all U2F-specific classes #36

Open
wants to merge 21 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Changed
- Server's constructor now can take `string $appId` as a parameter
- WebAuthn\AuthenticatorData marked as internal
- All traits marked as internal

### Deprecated
- ChallengeProvider
Expand All @@ -24,6 +26,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Server::setRegisterRequest(RegisterRequest)
- Server::setRegistrations(RegistrationInterface[])
- Server::setSignRequests(SignRequest[])
- Server::generateRegisterRequest()
- Server::generateSignRequest(RegistrationInterface)
- Server::generateSignRequests(RegistrationInterface[])
- RegisterRequest
- RegisterResponse (Replaced by WebAuthn/RegistrationResponse)
- SignRequest
- SignResponse (Replaced by WebAuthn/LoginResponse)
- ClientData (internal)
- ResponseTrait (internal)


## [1.2.0] - 2021-10-26
Expand Down
2 changes: 1 addition & 1 deletion phpstan-baseline.neon
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ parameters:
path: tests/ResponseTraitTest.php

-
message: "#^Method class@anonymous/tests/ResponseTraitTest\\.php\\:16\\:\\:parseResponse\\(\\) has parameter \\$response with no value type specified in iterable type array\\.$#"
message: "#^Method class@anonymous/tests/ResponseTraitTest\\.php\\:17\\:\\:parseResponse\\(\\) has parameter \\$response with no value type specified in iterable type array\\.$#"
count: 1
path: tests/ResponseTraitTest.php

Expand Down
3 changes: 3 additions & 0 deletions src/AppIdTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@

namespace Firehed\U2F;

/**
* @internal
*/
trait AppIdTrait
{
/** @var string */
Expand Down
3 changes: 3 additions & 0 deletions src/ChallengeTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

namespace Firehed\U2F;

/**
* @internal
*/
trait ChallengeTrait
{
/** @var string */
Expand Down
4 changes: 4 additions & 0 deletions src/ClientData.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@

use Firehed\U2F\InvalidDataException as IDE;

/**
* @deprecated
* @internal
*/
class ClientData
{
use ChallengeTrait;
Expand Down
3 changes: 3 additions & 0 deletions src/KeyHandleTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

namespace Firehed\U2F;

/**
* @internal
*/
trait KeyHandleTrait
{
/** @var string (binary) */
Expand Down
3 changes: 3 additions & 0 deletions src/RegisterRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@

use JsonSerializable;

/**
* @deprecated
*/
class RegisterRequest implements JsonSerializable, ChallengeProvider
{
use AppIdTrait;
Expand Down
3 changes: 3 additions & 0 deletions src/RegisterResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@

use Firehed\U2F\InvalidDataException as IDE;

/**
* @deprecated U2F support is being removed. Migrate to WebAuthn flows.
*/
class RegisterResponse implements RegistrationResponseInterface
{
use ResponseTrait;
Expand Down
4 changes: 4 additions & 0 deletions src/ResponseTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@

use Firehed\U2F\InvalidDataException as IDE;

/**
* @deprecated
* @internal
*/
trait ResponseTrait
{
use KeyHandleTrait;
Expand Down
6 changes: 6 additions & 0 deletions src/Server.php
Original file line number Diff line number Diff line change
Expand Up @@ -368,6 +368,8 @@ public function setSignRequests(array $signRequests): self
* Creates a new RegisterRequest to be sent to the authenticated user to be
* used by the `u2f.register` API.
*
* @deprecated
*
* @return RegisterRequest
*/
public function generateRegisterRequest(): RegisterRequest
Expand All @@ -381,6 +383,8 @@ public function generateRegisterRequest(): RegisterRequest
* Creates a new SignRequest for an existing registration for an
* authenticating user, used by the `u2f.sign` API.
*
* @deprecated
*
* @param RegistrationInterface $reg one of the user's existing Registrations
* @return SignRequest
*/
Expand All @@ -397,6 +401,8 @@ public function generateSignRequest(RegistrationInterface $reg): SignRequest
* ensures that all sign requests share a single challenge, which greatly
* simplifies compatibility with WebAuthn
*
* @deprecated
*
* @param RegistrationInterface[] $registrations
* @return SignRequest[]
*/
Expand Down
3 changes: 3 additions & 0 deletions src/SignRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@

use JsonSerializable;

/**
* @deprecated
*/
class SignRequest implements JsonSerializable, ChallengeProvider, KeyHandleInterface
{
use AppIdTrait;
Expand Down
3 changes: 3 additions & 0 deletions src/SignResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@

use Firehed\U2F\InvalidDataException as IDE;

/**
* @deprecated U2F support is being removed. Migrate to WebAuthn flows.
*/
class SignResponse implements LoginResponseInterface
{
use ResponseTrait;
Expand Down
3 changes: 3 additions & 0 deletions src/VersionTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@

namespace Firehed\U2F;

/**
* @internal
*/
trait VersionTrait
{
/** @var 'U2F_V2' */
Expand Down
2 changes: 2 additions & 0 deletions src/WebAuthn/AuthenticatorData.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
use Firehed\CBOR\Decoder;

/**
* @internal
*
* @phpstan-type AttestedCredentialData array{
* aaguid: string,
* credentialId: string,
Expand Down
1 change: 1 addition & 0 deletions tests/ClientDataTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

/**
* @covers Firehed\U2F\ClientData
* @deprecated
*/
class ClientDataTest extends \PHPUnit\Framework\TestCase
{
Expand Down
1 change: 1 addition & 0 deletions tests/RegisterRequestTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

/**
* @covers Firehed\U2F\RegisterRequest
* @deprecated
*/
class RegisterRequestTest extends \PHPUnit\Framework\TestCase
{
Expand Down
1 change: 1 addition & 0 deletions tests/RegisterResponseTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

/**
* @covers Firehed\U2F\RegisterResponse
* @deprecated
*/
class RegisterResponseTest extends \PHPUnit\Framework\TestCase
{
Expand Down
1 change: 1 addition & 0 deletions tests/ResponseTraitTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

/**
* @covers Firehed\U2F\ResponseTrait
* @deprecated
*/
class ResponseTraitTest extends \PHPUnit\Framework\TestCase
{
Expand Down