Skip to content

Commit 2bff6fc

Browse files
chore: fix static code analyzers findings (#1582)
Signed-off-by: Barabanov, Alexander <[email protected]>
1 parent 6bf70a1 commit 2bff6fc

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

platform/services/installer/app/cli_utils/credentials.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@ def generate_password() -> str:
2222
Generate password. Security guide: 10 characters minimum, at least one capital letter,
2323
at least one numeral, and at least one special character
2424
"""
25-
lower = random.sample(string.ascii_lowercase, 4)
26-
upper = random.sample(string.ascii_uppercase, 4)
27-
numeral = random.sample(string.digits, 4)
28-
symbols = random.sample(ALLOWED_SPECIAL_CHARACTERS, 4)
25+
lower = "".join(secrets.choice(string.ascii_lowercase) for _ in range(4))
26+
upper = "".join(secrets.choice(string.ascii_uppercase) for _ in range(4))
27+
numeral = "".join(secrets.choice(string.digits) for _ in range(4))
28+
symbols = "".join(secrets.choice(ALLOWED_SPECIAL_CHARACTERS) for _ in range(4))
2929
password = [*lower, *upper, *numeral, *symbols]
3030
random.shuffle(password)
3131
return "".join(password)

0 commit comments

Comments
 (0)