forked from mtusi2026/mtusi2026lab7
Перевести пароли на Argon2id и читать секреты через AppRole.
Лимит входа общий для реплик, размер тела ограничен, исходящие клиенты проверяют TLS, если задан CA. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Time one Argon2id hash with the stand parameters. Prints milliseconds only."""
|
||||
|
||||
import os
|
||||
import time
|
||||
|
||||
from app.passwords import ITERATIONS, MEMORY_KIB, PARALLELISM, hash_password
|
||||
|
||||
password = os.environ.get("ARGON2_SAMPLE_PASSWORD", "synthetic-measurement-password")
|
||||
started = time.perf_counter()
|
||||
hash_password(password)
|
||||
elapsed_ms = (time.perf_counter() - started) * 1000
|
||||
print(
|
||||
"argon2id memory_kib=%s iterations=%s parallelism=%s elapsed_ms=%.1f"
|
||||
% (MEMORY_KIB, ITERATIONS, PARALLELISM, elapsed_ms)
|
||||
)
|
||||
Reference in New Issue
Block a user