Add admin panel, WebSocket support, and API versioning
Introduce an admin portal (React + Nginx), WebSocket routing, and API versioning middleware with `/api/v1/` prefix deprecation. Add master API key authentication, new Prometheus metrics for AI token consumption and active WebSockets, and extend S3 config with a public endpoint URL. Update test paths and fixtures to align with the new routing structure.
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import pytest
|
||||
from fastapi import HTTPException
|
||||
from app.services.storage import save_upload, delete_files, get_image_url
|
||||
from app.services.storage import save_upload, delete_files
|
||||
from app.services.storage_backend import LocalStorage, S3Storage
|
||||
from unittest.mock import MagicMock, patch, AsyncMock
|
||||
import io
|
||||
|
||||
@@ -38,9 +39,8 @@ def test_delete_files_exists(tmp_path):
|
||||
assert not f1.exists()
|
||||
assert not f2.exists()
|
||||
|
||||
def test_get_image_url():
|
||||
url = get_image_url("img.jpg", "client1")
|
||||
assert "/static/uploads/client1/img.jpg" in url
|
||||
|
||||
thumb_url = get_image_url("img.jpg", "client1", thumb=True)
|
||||
assert "/static/thumbnails/client1/img.jpg" in thumb_url
|
||||
@pytest.mark.asyncio
|
||||
async def test_get_signed_url():
|
||||
storage = LocalStorage("/", "test_secret")
|
||||
url = await storage.get_signed_url("uploads/client1/img.jpg")
|
||||
assert url.startswith("/files/signed/")
|
||||
|
||||
Reference in New Issue
Block a user