Docstring missing for
create_user
28
29
30@router.post("/user", response_model=UserSimple)
31def create_user(new_user: UserCreate): 32 result = None
33 """Creates a new user.
34
Docstring missing for
login
75
76
77@router.post("/auth/login", response_model=AuthLoginResponse)
78def login(auth: AuthAuthentication): 79 # Check if user exists
80 with Session(engine) as session:
81 user = session.exec(
Docstring missing for
password_reset
24
25
26@router.patch("/auth/password", response_model=AuthPasswordSetMessage)
27def password_reset(auth: AuthPasswordReset): 28 user_auth = None
29 with Session(engine) as session:
30 try:
Docstring missing for
email_validator
45
46 @field_validator("email")
47 @classmethod
48 def email_validator(cls, email: str) -> bool: 49 return validate_email(email)
50
51
Docstring missing for
password_check
27
28 @field_validator("password")
29 @classmethod
30 def password_check(cls, password: str):31 # Check if password is strong
32 if len(password) <= 8:
33 raise ValueError("Password should be more than 8 characters")
Docstring missing for
validate_email
15 return username
16
17
18def validate_email(email: str) -> str:19 try:
20 return ev_validate_email(
21 email,
Docstring missing for
validate_user
2import re
3
4
5def validate_user(username: str) -> str: 6 # TODO: https://github.com/shouldbee/reserved-usernames/blob/master/reserved-usernames.txt
7 if len(username) <= 2:
8 raise ValueError("Username should be more than 2 characters")
Docstring missing for
decode_jwt_token
6 return jwt.encode(data, config.JWT_SECRET, algorithm=config.JWT_ALGORITHM)
7
8
9def decode_jwt_token(token: str):10 return jwt.decode(token, config.JWT_SECRET, algorithms=[config.JWT_ALGORITHM])
Docstring missing for
encode_jwt_token
2import jwt
3
4
5def encode_jwt_token(data: dict): 6 return jwt.encode(data, config.JWT_SECRET, algorithm=config.JWT_ALGORITHM)
7
8
Docstring missing for
password_generator
22 return str(b64encode(hasher.digest())[:43])
23
24
25def password_generator(length=44) -> str:26 chars = string.ascii_letters + string.digits + "@$!%*?&"
27 return "".join(secrets.choice(chars) for _ in range(length))
Docstring missing for
get_password_token
13 return str(b64encode(hasher.digest())[:43])
14
15
16def get_password_token(length=44) -> str:17 chars = string.ascii_letters + string.digits + string.punctuation
18 password = "".join(secrets.choice(chars) for _ in range(length))
19 hasher = blake3()
Docstring missing for
get_password_hash
6from base64 import b64encode
7
8
9def get_password_hash(passwd: str) -> str:10 hasher = blake3()
11 hasher.update(bytearray(passwd.encode("utf-8")))
12 hasher.update(bytearray(config.PASSWORD_SALT.encode("utf-8")))
Description
The module/function docstring is missing.
If you want to ignore this, you can configure this in the .deepsource.toml
file. Please refer to docs for available options.