ucloud-cli/commands/helper.py

16 lines
276 B
Python
Raw Normal View History

2019-07-17 14:58:39 +00:00
import click
from dataclasses import dataclass
from pyotp import TOTP
@dataclass
class OTPCredentials:
name: str
realm: str
seed: str
def get_json(self):
r = {"name": self.name, "realm": self.realm, "token": TOTP(self.seed).now()}
return r