Changed generation and hashing of API keys

Moved from generating API keys using os.urandom to secrets.token_hex. Moved from hashing the keys using stdlib.hash to hashlib.sha256.
This commit is contained in:
CasVT
2025-08-26 00:50:46 +02:00
parent 42891f5f32
commit b68284530b
2 changed files with 11 additions and 7 deletions

View File

@@ -54,6 +54,7 @@ class Constants:
API_PREFIX = "/api"
ADMIN_API_EXTENSION = "/admin"
ADMIN_PREFIX = API_PREFIX + ADMIN_API_EXTENSION
API_KEY_LENGTH = 32 # hexadecimal characters
DB_FOLDER = ("db",)
DB_NAME = "MIND.db"