migration command added, OTP creds can be read from environment variables, json output is now formated nicely
This commit is contained in:
parent
56f3647ec3
commit
61d1633599
5 changed files with 59 additions and 33 deletions
|
|
@ -1,4 +1,5 @@
|
|||
import click
|
||||
import json
|
||||
|
||||
from dataclasses import dataclass
|
||||
from pyotp import TOTP
|
||||
|
|
@ -11,6 +12,10 @@ class OTPCredentials:
|
|||
seed: str
|
||||
|
||||
def get_json(self):
|
||||
print(self.name, self.realm, self.seed)
|
||||
r = {"name": self.name, "realm": self.realm, "token": TOTP(self.seed).now()}
|
||||
return r
|
||||
|
||||
|
||||
def load_dump_pretty(content):
|
||||
parsed = json.loads(content)
|
||||
return json.dumps(parsed, indent=4, sort_keys=True)
|
||||
Loading…
Add table
Add a link
Reference in a new issue