diff --git a/tikka/libs/secret.py b/tikka/libs/secret.py index fdd7e20bcdaffd0ba684013ebe54fd9e29b7f72b..57330f4970de83f8157948feb64bc83bf1a7f537 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))