feat(sandbox): add Python 3 code execution sandbox support

This commit is contained in:
Eternity
2026-01-26 11:54:38 +08:00
parent 6920deef63
commit e3b6ede992
35 changed files with 1613 additions and 0 deletions

View File

@@ -0,0 +1,15 @@
"""Authentication middleware"""
from fastapi import Header, HTTPException, status
from app.config import get_config
async def verify_api_key(x_api_key: str = Header(..., alias="X-Api-Key")):
"""Verify API key from request header"""
config = get_config()
if x_api_key != config.app.key:
raise HTTPException(
status_code=status.HTTP_401_UNAUTHORIZED,
detail="Invalid API key"
)
return x_api_key