index : archinstall32 | |
Archlinux32 installer | gitolite user |
summaryrefslogtreecommitdiff |
author | Daniel Girtler <blackrabbit256@gmail.com> | 2023-03-29 21:48:11 +1100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-03-29 12:48:11 +0200 |
commit | 83f4b4178fae83f9fae3dd0a7ac333957acd0c3f (patch) | |
tree | 913f6abea842bfb350d6fbc02f8bbceb38bdb375 /archinstall/lib/hsm/fido.py | |
parent | b2fc71c9e5b3df3658ff12ed9a8f0d3c09a21136 (diff) |
-rw-r--r-- | archinstall/lib/hsm/fido.py | 19 |
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 |