Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/archinstall/lib/hsm/fido.py
diff options
context:
space:
mode:
Diffstat (limited to 'archinstall/lib/hsm/fido.py')
-rw-r--r--archinstall/lib/hsm/fido.py19
1 files changed, 18 insertions, 1 deletions
diff --git a/archinstall/lib/hsm/fido.py b/archinstall/lib/hsm/fido.py
index 758a2548..1c226322 100644
--- a/archinstall/lib/hsm/fido.py
+++ b/archinstall/lib/hsm/fido.py
@@ -1,9 +1,11 @@
+from __future__ import annotations
+
import getpass
import logging
from dataclasses import dataclass
from pathlib import Path
-from typing import List
+from typing import List, Dict
from ..general import SysCommand, SysCommandWorker, clear_vt100_escape_codes
from ..disk.partition import Partition
@@ -16,6 +18,21 @@ class Fido2Device:
manufacturer: str
product: str
+ def json(self) -> Dict[str, str]:
+ return {
+ 'path': str(self.path),
+ 'manufacturer': self.manufacturer,
+ 'product': self.product
+ }
+
+ @classmethod
+ def parse_arg(cls, arg: Dict[str, str]) -> 'Fido2Device':
+ return Fido2Device(
+ Path(arg['path']),
+ arg['manufacturer'],
+ arg['product']
+ )
+
class Fido2:
_loaded: bool = False