-
-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: fix authenticatorData format (#402)
- Loading branch information
Showing
5 changed files
with
50 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<?php | ||
|
||
namespace LaravelWebauthn\Tests\Unit\Models; | ||
|
||
use LaravelWebauthn\Models\Casts\Base64; | ||
use LaravelWebauthn\Models\WebauthnKey; | ||
use LaravelWebauthn\Tests\FeatureTestCase; | ||
|
||
class Base64Test extends FeatureTestCase | ||
{ | ||
/** | ||
* @test | ||
* @dataProvider dataProvider | ||
*/ | ||
public function it_deserialize_credentialId($credentialId, $expected) | ||
{ | ||
$webauthnKey = new WebauthnKey(); | ||
|
||
$bin = (new Base64)->get($webauthnKey, 'credentialId', $credentialId, []); | ||
|
||
$this->assertEquals($expected, (new Base64)->set($webauthnKey, 'credentialId', $bin, [])); | ||
} | ||
|
||
public function dataProvider() | ||
{ | ||
return [ | ||
[ | ||
'xrXvxSyol4aHHmmYLBcJyln6pAHgjc/+6UnE2EX4ZGl5Vw82/AjX/5wryErEUfeIBU4djcj2HMXWv0e+Ck/GbA==', | ||
'xrXvxSyol4aHHmmYLBcJyln6pAHgjc_-6UnE2EX4ZGl5Vw82_AjX_5wryErEUfeIBU4djcj2HMXWv0e-Ck_GbA==', | ||
], | ||
]; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters