WebAuthn初步接好

This commit is contained in:
2022-08-08 02:07:27 +08:00
parent 50934228ef
commit 30b38e3f4b
16 changed files with 1329 additions and 5 deletions

View File

@ -0,0 +1,21 @@
<?php
namespace App\Models\Casts;
use Illuminate\Contracts\Database\Eloquent\CastsAttributes;
use Webauthn\TrustPath\TrustPathLoader;
class TrustPath implements CastsAttributes
{
public function get($model, string $key, $value, array $attributes): ?\Webauthn\TrustPath\TrustPath
{
return $value !== null
? TrustPathLoader::loadTrustPath(json_decode($value, true))
: null;
}
public function set($model, string $key, $value, array $attributes)
{
return json_encode($value);
}
}