This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""Classes and functions to customize logs.""" | |
import logging | |
import sys | |
from loguru import logger | |
from app.config import AppSettings # originaly this is BaseSettings from Pydantic | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import argparse | |
import platform | |
import random | |
import subprocess | |
import sys | |
from string import ascii_letters, digits, punctuation | |
def parse_args() -> argparse.Namespace: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# taken from https://stackoverflow.com/questions/9594125/salt-and-hash-a-password-in-python/56915300#56915300 | |
import hashlib | |
import hmac | |
import os | |
def hash_new_password(password: str) -> tuple[bytes, bytes]: | |
""" | |
Hash the provided password with a randomly-generated salt and return the | |
salt and hash to store in the database. |