feat(admin): add api client management UI and backend CRUD/rotate endpoints
This commit is contained in:
@@ -13,6 +13,10 @@ from app.models.api_client import ApiClient
|
||||
pwd_context = CryptContext(schemes=["argon2", "bcrypt"], deprecated="auto")
|
||||
|
||||
|
||||
def hash_api_key(plain_key: str) -> str:
|
||||
return pwd_context.hash(plain_key)
|
||||
|
||||
|
||||
def _verify_api_key(plain_key: str, stored_hash: str) -> bool:
|
||||
# Support sha256:<hex> for bootstrap, and bcrypt/argon2 for production.
|
||||
if stored_hash.startswith("sha256:"):
|
||||
|
||||
Reference in New Issue
Block a user