Vibecoded fixes & readme
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import os
|
||||
import logging
|
||||
from fastapi import Depends, HTTPException, Security
|
||||
from fastapi.security import APIKeyHeader
|
||||
from starlette.status import HTTP_403_FORBIDDEN
|
||||
@@ -6,7 +7,12 @@ from dotenv import load_dotenv
|
||||
|
||||
load_dotenv()
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
API_KEY = os.getenv("IGNIS_API_KEY")
|
||||
if not API_KEY:
|
||||
logger.warning("IGNIS_API_KEY не задан -- авторизация отключена!")
|
||||
|
||||
API_KEY_NAME = "X-API-Key"
|
||||
api_key_header = APIKeyHeader(name=API_KEY_NAME, auto_error=False)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user