From fce29b0928ed376d1ee680cdbf5a708bcf9e285d Mon Sep 17 00:00:00 2001 From: Vincent Texier <vit@free.fr> Date: Mon, 16 Jan 2023 15:41:14 +0100 Subject: [PATCH] [enh] wallet password set to AAAAAA if logging level is debug to ease manual tests on development phase --- tikka/libs/secret.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tikka/libs/secret.py b/tikka/libs/secret.py index fdd7e20b..57330f49 100644 --- a/tikka/libs/secret.py +++ b/tikka/libs/secret.py @@ -13,13 +13,14 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see <http://www.gnu.org/licenses/>. import hashlib +import logging import random import re import string from mnemonic import Mnemonic -from tikka.domains.entities.constants import MNEMONIC_LANGUAGES +from tikka.domains.entities.constants import MNEMONIC_LANGUAGES, WALLETS_PASSWORD_LENGTH def generate_alphabetic(size: int = 5) -> str: @@ -29,6 +30,10 @@ def generate_alphabetic(size: int = 5) -> str: :param size: Size of secret (default=5) :return: """ + # fixme: remove this for production release + if logging.getLogger().getEffectiveLevel() == logging.DEBUG: + return "A" * WALLETS_PASSWORD_LENGTH + return "".join(random.choice(string.ascii_letters).upper() for _ in range(size)) -- GitLab