23 行
611 B
Python
23 行
611 B
Python
"""API contract route handlers."""
|
|
|
|
from __future__ import annotations
|
|
|
|
from typing import Any
|
|
|
|
from backend.routes.common import handle_request
|
|
from backend.services.contract_service import ContractService
|
|
from core.identity import RequestContext
|
|
from core.security import require_authenticated
|
|
|
|
|
|
def get_api_contract(
|
|
ctx: RequestContext,
|
|
service: ContractService | None = None,
|
|
) -> dict:
|
|
contract_service = service or ContractService()
|
|
|
|
def action() -> dict[str, Any]:
|
|
require_authenticated(ctx)
|
|
return contract_service.get_contract()
|
|
|
|
return handle_request(ctx, action)
|