refactor(api): 移除内存可视化路由的 API 密钥依赖
该路由旨在用于本地调试和可视化,不再需要进行 API 密钥认证。 BREAKING CHANGE: 内存可视化路由现在是公开访问的,不再需要 API 密钥。
This commit is contained in:
@@ -10,11 +10,10 @@ from pathlib import Path
|
|||||||
from typing import Any
|
from typing import Any
|
||||||
|
|
||||||
import orjson
|
import orjson
|
||||||
from fastapi import APIRouter, Depends, HTTPException, Query, Request
|
from fastapi import APIRouter, HTTPException, Query, Request
|
||||||
from fastapi.responses import HTMLResponse, JSONResponse
|
from fastapi.responses import HTMLResponse, JSONResponse
|
||||||
from fastapi.templating import Jinja2Templates
|
from fastapi.templating import Jinja2Templates
|
||||||
|
|
||||||
from src.common.security import get_api_key
|
|
||||||
|
|
||||||
# 调整项目根目录的计算方式
|
# 调整项目根目录的计算方式
|
||||||
project_root = Path(__file__).parent.parent.parent
|
project_root = Path(__file__).parent.parent.parent
|
||||||
@@ -25,7 +24,7 @@ graph_data_cache = None
|
|||||||
current_data_file = None
|
current_data_file = None
|
||||||
|
|
||||||
# FastAPI 路由
|
# FastAPI 路由
|
||||||
router = APIRouter(dependencies=[Depends(get_api_key)])
|
router = APIRouter()
|
||||||
|
|
||||||
# Jinja2 模板引擎
|
# Jinja2 模板引擎
|
||||||
templates = Jinja2Templates(directory=str(Path(__file__).parent / "templates"))
|
templates = Jinja2Templates(directory=str(Path(__file__).parent / "templates"))
|
||||||
|
|||||||
Reference in New Issue
Block a user