Gate embedding routes behind admin auth
This commit is contained in:
parent
7e1a9ccc88
commit
bf325f6b21
1 changed files with 3 additions and 2 deletions
|
|
@ -6,8 +6,9 @@ import shutil
|
||||||
import logging
|
import logging
|
||||||
import asyncio
|
import asyncio
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from fastapi import APIRouter, HTTPException, Form
|
from fastapi import APIRouter, HTTPException, Form, Depends
|
||||||
from core.constants import BASE_DIR
|
from core.constants import BASE_DIR
|
||||||
|
from core.middleware import require_admin
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
@ -97,7 +98,7 @@ def _save_custom_endpoint(data: dict):
|
||||||
|
|
||||||
|
|
||||||
def setup_embedding_routes():
|
def setup_embedding_routes():
|
||||||
router = APIRouter(prefix="/api/embeddings")
|
router = APIRouter(prefix="/api/embeddings", dependencies=[Depends(require_admin)])
|
||||||
|
|
||||||
@router.get("/models")
|
@router.get("/models")
|
||||||
def list_models():
|
def list_models():
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue