Merge gitea/main, preserving security fixes and current dependency versions

This commit is contained in:
AITBC System
2026-03-24 16:18:25 +01:00
252 changed files with 18525 additions and 1029 deletions

View File

@@ -48,7 +48,7 @@ async def blockchain_sync_status():
rpc_url = settings.blockchain_rpc_url.rstrip('/')
async with httpx.AsyncClient() as client:
response = await client.get(f"{rpc_url}/rpc/sync", timeout=5.0)
response = await client.get(f"{rpc_url}/rpc/syncStatus", timeout=5.0)
if response.status_code == 200:
data = response.json()
return {

View File

@@ -20,7 +20,7 @@ limiter = Limiter(key_func=get_remote_address)
router = APIRouter(tags=["marketplace"])
def _get_service(session: Annotated[Session, Depends(get_session)]) -> MarketplaceService:
def _get_service(session: Session = Depends(get_session)) -> MarketplaceService:
return MarketplaceService(session)
@@ -33,7 +33,7 @@ def _get_service(session: Annotated[Session, Depends(get_session)]) -> Marketpla
async def list_marketplace_offers(
request: Request,
*,
session: Annotated[Session, Depends(get_session)],
session: Session = Depends(get_session),
status_filter: str | None = Query(default=None, alias="status", description="Filter by offer status"),
limit: int = Query(default=100, ge=1, le=500),
offset: int = Query(default=0, ge=0),
@@ -60,7 +60,7 @@ async def list_marketplace_offers(
async def get_marketplace_stats(
request: Request,
*,
session: Annotated[Session, Depends(get_session)]
session: Session = Depends(get_session)
) -> MarketplaceStatsView:
marketplace_requests_total.labels(endpoint="/marketplace/stats", method="GET").inc()
service = _get_service(session)
@@ -80,7 +80,7 @@ async def get_marketplace_stats(
async def submit_marketplace_bid(
request: Request,
payload: MarketplaceBidRequest,
session: Annotated[Session, Depends(get_session)],
session: Session = Depends(get_session),
) -> dict[str, str]:
marketplace_requests_total.labels(endpoint="/marketplace/bids", method="POST").inc()
service = _get_service(session)
@@ -102,7 +102,7 @@ async def submit_marketplace_bid(
)
async def list_marketplace_bids(
*,
session: Annotated[Session, Depends(get_session)],
session: Session = Depends(get_session),
status_filter: str | None = Query(default=None, alias="status", description="Filter by bid status"),
provider_filter: str | None = Query(default=None, alias="provider", description="Filter by provider ID"),
limit: int = Query(default=100, ge=1, le=500),
@@ -127,7 +127,7 @@ async def list_marketplace_bids(
)
async def get_marketplace_bid(
bid_id: str,
session: Annotated[Session, Depends(get_session)],
session: Session = Depends(get_session),
) -> MarketplaceBidView:
marketplace_requests_total.labels(endpoint="/marketplace/bids/{bid_id}", method="GET").inc()
service = _get_service(session)

View File

@@ -50,7 +50,7 @@ class MarketplaceAnalyticsRequest(BaseModel):
async def create_royalty_distribution(
request: RoyaltyDistributionRequest,
offer_id: str,
session: Session = Depends(Annotated[Session, Depends(get_session)]),
session: Session = Depends(get_session),
current_user: str = Depends(require_admin_key())
):
"""Create royalty distribution for marketplace offer"""
@@ -74,7 +74,7 @@ async def create_royalty_distribution(
async def calculate_royalties(
offer_id: str,
sale_amount: float,
session: Session = Depends(Annotated[Session, Depends(get_session)]),
session: Session = Depends(get_session),
current_user: str = Depends(require_admin_key())
):
"""Calculate royalties for a sale"""
@@ -97,7 +97,7 @@ async def calculate_royalties(
async def create_model_license(
request: ModelLicenseRequest,
offer_id: str,
session: Session = Depends(Annotated[Session, Depends(get_session)]),
session: Session = Depends(get_session),
current_user: str = Depends(require_admin_key())
):
"""Create model license for marketplace offer"""
@@ -123,7 +123,7 @@ async def create_model_license(
async def verify_model(
request: ModelVerificationRequest,
offer_id: str,
session: Session = Depends(Annotated[Session, Depends(get_session)]),
session: Session = Depends(get_session),
current_user: str = Depends(require_admin_key())
):
"""Verify model quality and performance"""
@@ -145,7 +145,7 @@ async def verify_model(
@router.post("/analytics")
async def get_marketplace_analytics(
request: MarketplaceAnalyticsRequest,
session: Session = Depends(Annotated[Session, Depends(get_session)]),
session: Session = Depends(get_session),
current_user: str = Depends(require_admin_key())
):
"""Get marketplace analytics and insights"""