feat(auth): Add OAuth2 authentication

This commit is contained in:
Björn Benouarets
2026-01-27 16:35:46 +01:00
commit 50c85e9b7f
36 changed files with 1599 additions and 0 deletions

10
secnex/utils/secret.py Normal file
View File

@@ -0,0 +1,10 @@
import secrets
from argon2 import PasswordHasher
def generate_secret(length: int = 32) -> str:
return secrets.token_hex(length)
def hash_secret(secret: str) -> str:
ph = PasswordHasher()
return ph.hash(secret)