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:
authorDaniel Girtler <blackrabbit256@gmail.com>2023-03-29 21:48:11 +1100
committerGitHub <noreply@github.com>2023-03-29 12:48:11 +0200
commit83f4b4178fae83f9fae3dd0a7ac333957acd0c3f (patch)
tree913f6abea842bfb350d6fbc02f8bbceb38bdb375 /archinstall/lib/hsm/fido.py
parentb2fc71c9e5b3df3658ff12ed9a8f0d3c09a21136 (diff)
Save encryption configuration (#1672)
* Save encryption configuration * Fix deserialization problem * Added .part_uuid to MapperDev --------- Co-authored-by: Daniel Girtler <girtler.daniel@gmail.com> Co-authored-by: Anton Hvornum <anton@hvornum.se> Co-authored-by: Anton Hvornum <anton.feeds+github@gmail.com>
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