mirror of
https://github.com/mgeeky/decode-spam-headers.git
synced 2026-02-22 13:33:30 +01:00
17 lines
568 B
Python
17 lines
568 B
Python
from __future__ import annotations
|
|
|
|
from fastapi import APIRouter
|
|
|
|
from app.engine.scanner_registry import ScannerRegistry
|
|
from app.schemas.tests import TestListResponse, TestResponse
|
|
|
|
router = APIRouter(prefix="/api", tags=["tests"])
|
|
|
|
|
|
@router.get("/tests", response_model=TestListResponse)
|
|
def list_tests() -> TestListResponse:
|
|
registry = ScannerRegistry()
|
|
tests = registry.list_tests()
|
|
response_tests = [TestResponse.model_validate(test.model_dump()) for test in tests]
|
|
return TestListResponse(tests=response_tests, total_count=len(response_tests))
|