From f6f01ebee5cc1061c2323fa75335a86329770e05 Mon Sep 17 00:00:00 2001 From: Jakob Ketterl Date: Sat, 6 Feb 2021 18:22:13 +0100 Subject: [PATCH] default password implementation --- owrx/users.py | 3 +++ owrxadmin/commands.py | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/owrx/users.py b/owrx/users.py index 86173e1..03a5372 100644 --- a/owrx/users.py +++ b/owrx/users.py @@ -48,6 +48,9 @@ class CleartextPassword(Password): } +DefaultPasswordClass = CleartextPassword + + class User(object): def __init__(self, name: str, enabled: bool, password: Password): self.name = name diff --git a/owrxadmin/commands.py b/owrxadmin/commands.py index bf2f1b8..8be9d5a 100644 --- a/owrxadmin/commands.py +++ b/owrxadmin/commands.py @@ -1,6 +1,6 @@ from abc import ABC, ABCMeta, abstractmethod from getpass import getpass -from owrx.users import UserList, User, CleartextPassword +from owrx.users import UserList, User, DefaultPasswordClass import sys import random import string @@ -44,7 +44,7 @@ class NewUser(UserCommand): print("Creating user {username}...".format(username=username)) userList = UserList() - user = User(name=username, enabled=True, password=CleartextPassword(password)) + user = User(name=username, enabled=True, password=DefaultPasswordClass(password)) userList.addUser(user) def getRandomPassword(self, length=10):