Phase 2 of the full modernization: - App factory pattern with create_app() - Settings via dataclass with env vars - Dependency injection container - Router stubs for auth, storage, api, recipes, cache, runs - Service layer stubs for run, recipe, cache - Repository layer placeholder Routes are stubs that import from legacy server.py during migration. Next: Migrate each router fully with templates. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
36 lines
1.0 KiB
Python
36 lines
1.0 KiB
Python
"""
|
|
Storage provider routes for L1 server.
|
|
|
|
Manages user storage backends (Pinata, web3.storage, local, etc.)
|
|
"""
|
|
|
|
from fastapi import APIRouter, Request, Depends, HTTPException
|
|
from fastapi.responses import HTMLResponse
|
|
|
|
from artdag_common.middleware import UserContext, wants_html
|
|
|
|
from ..dependencies import require_auth, get_templates
|
|
|
|
router = APIRouter()
|
|
|
|
|
|
# TODO: Migrate routes from server.py lines 5473-5761
|
|
# - GET /storage - List storage providers
|
|
# - POST /storage - Add storage provider
|
|
# - POST /storage/add - Add via form
|
|
# - GET /storage/{storage_id} - Get storage details
|
|
# - PATCH /storage/{storage_id} - Update storage
|
|
# - DELETE /storage/{storage_id} - Delete storage
|
|
# - POST /storage/{storage_id}/test - Test connection
|
|
# - GET /storage/type/{provider_type} - Get provider config
|
|
|
|
|
|
@router.get("")
|
|
async def list_storage(
|
|
request: Request,
|
|
user: UserContext = Depends(require_auth),
|
|
):
|
|
"""List user's storage providers."""
|
|
# TODO: Implement
|
|
raise HTTPException(501, "Not yet migrated")
|