Skip to content

Commit

Permalink
added generate password util
Browse files Browse the repository at this point in the history
  • Loading branch information
ychebyshev committed Jan 9, 2024
1 parent c8161a1 commit 1bf4423
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions shvatka/api/password_hash.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import logging
import sys

from shvatka.api.config.parser.main import load_config
from shvatka.api.dependencies import AuthProvider
from shvatka.api.main_factory import (
get_paths,
)
from shvatka.common.config.parser.logging_config import setup_logging

logger = logging.getLogger(__name__)


def generate():
paths = get_paths()

setup_logging(paths)
config = load_config(paths)
auth = AuthProvider(config.auth)
return auth.get_password_hash(sys.argv[1])


if __name__ == "__main__":
print(generate()) # noqa: T201

0 comments on commit 1bf4423

Please sign in to comment.