Fix key dump in clan secrets key show
``` In [4]: str(Type.AGE) Out[4]: Type.AGE In [5]: Type.AGE.name.lower() Out[5]: age ```
This commit is contained in:
@@ -60,9 +60,7 @@ def show_command(args: argparse.Namespace) -> None:
|
||||
if not key:
|
||||
msg = "No public key found"
|
||||
raise ClanError(msg)
|
||||
json.dump(
|
||||
{"key": key.pubkey, "type": str(key.key_type)}, sys.stdout, indent=2, sort_keys=True
|
||||
)
|
||||
json.dump(key.as_dict(), sys.stdout, indent=2, sort_keys=True)
|
||||
|
||||
|
||||
def update_command(args: argparse.Namespace) -> None:
|
||||
|
||||
@@ -37,6 +37,13 @@ class SopsKey:
|
||||
username: str
|
||||
key_type: KeyType
|
||||
|
||||
def as_dict(self) -> dict[str, str]:
|
||||
return {
|
||||
"publickey": self.pubkey,
|
||||
"username": self.username,
|
||||
"type": self.key_type.name.lower(),
|
||||
}
|
||||
|
||||
|
||||
def get_public_age_key(privkey: str) -> str:
|
||||
cmd = nix_shell(["nixpkgs#age"], ["age-keygen", "-y"])
|
||||
|
||||
Reference in New Issue
Block a user