Deployment configuration

This commit is contained in:
florian authored and Florian committed 2025-10-06 16:17:13 +02:00
1 parent f67fd99333
commit aab311dc86
13 files changed
+206 -91

No files matched your search

+20
View File
@@ -0,0 +1,20 @@
from argon2 import PasswordHasher
ph = PasswordHasher()
def hash_api_key(api_key: str) -> str:
return ph.hash(api_key)
def verify_api_key(api_key: str, hashed: str) -> bool:
try:
return ph.verify(hashed, api_key)
except Exception:
return False
if __name__=="__main__":
plain_key = "super-secret-api-key"
#hashed_key = hash_api_key(plain_key)
hashed_key = '$argon2id$v=19$m=65536,t=3,p=4$vqU+MRafVW1b8AtF+zHb0w$p1J4Gyb0jhlVtKgYyjTITxfU97YaayeS3s3qFFP5sVM'
print("Hashed API Key:", hashed_key)
print("Verification:", verify_api_key(plain_key, hashed_key))