2026-04-04 01:40:24 +08:00
|
|
|
use std::convert::Infallible;
|
|
|
|
|
use std::sync::{Arc, Mutex};
|
|
|
|
|
|
|
|
|
|
use axum::body::{to_bytes, Body, Bytes};
|
|
|
|
|
use axum::response::Response;
|
|
|
|
|
use axum::routing::any;
|
|
|
|
|
use axum::{extract::Request, Json, Router};
|
|
|
|
|
use http::header::{HeaderName, HeaderValue};
|
|
|
|
|
use http::StatusCode;
|
|
|
|
|
use serde_json::json;
|
|
|
|
|
|
2026-04-05 20:23:16 +08:00
|
|
|
use crate::constants::{
|
2026-04-04 01:40:24 +08:00
|
|
|
CONTROL_EXECUTED_HEADER, CONTROL_EXECUTE_FALLBACK_HEADER, DEPENDENCY_REASON_HEADER,
|
|
|
|
|
EXECUTION_PATH_EXECUTION_RUNTIME_STREAM, EXECUTION_PATH_EXECUTION_RUNTIME_SYNC,
|
|
|
|
|
EXECUTION_PATH_HEADER, EXECUTION_PATH_LOCAL_EXECUTION_RUNTIME_MISS,
|
|
|
|
|
LOCAL_EXECUTION_RUNTIME_MISS_REASON_HEADER, TRACE_ID_HEADER,
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
use super::{
|
|
|
|
|
build_router, build_router_with_execution_runtime_override, build_router_with_state,
|
|
|
|
|
build_state_with_execution_runtime_override, start_server, wait_until, AppState,
|
2026-04-05 20:23:16 +08:00
|
|
|
FrontdoorCorsConfig, FrontdoorUserRpmConfig, GatewayFallbackMetricKind, GatewayFallbackReason,
|
|
|
|
|
UsageRuntimeConfig, VideoTaskTruthSourceMode,
|
2026-04-04 01:40:24 +08:00
|
|
|
};
|
2026-03-31 19:19:04 +08:00
|
|
|
use aether_crypto::{encrypt_python_fernet_plaintext, DEVELOPMENT_ENCRYPTION_KEY};
|
|
|
|
|
use aether_data::repository::auth::{
|
|
|
|
|
InMemoryAuthApiKeySnapshotRepository, StoredAuthApiKeySnapshot,
|
|
|
|
|
};
|
2026-04-07 02:50:19 +08:00
|
|
|
use aether_data::repository::candidate_selection::InMemoryMinimalCandidateSelectionReadRepository;
|
|
|
|
|
use aether_data::repository::candidates::InMemoryRequestCandidateRepository;
|
|
|
|
|
use aether_data::repository::provider_catalog::InMemoryProviderCatalogReadRepository;
|
|
|
|
|
use aether_data_contracts::repository::candidate_selection::{
|
|
|
|
|
StoredMinimalCandidateSelectionRow, StoredProviderModelMapping,
|
2026-03-31 19:19:04 +08:00
|
|
|
};
|
2026-04-07 02:50:19 +08:00
|
|
|
use aether_data_contracts::repository::candidates::{
|
|
|
|
|
RequestCandidateReadRepository, RequestCandidateStatus,
|
2026-03-31 19:19:04 +08:00
|
|
|
};
|
2026-04-07 02:50:19 +08:00
|
|
|
use aether_data_contracts::repository::provider_catalog::{
|
|
|
|
|
StoredProviderCatalogEndpoint, StoredProviderCatalogKey, StoredProviderCatalogProvider,
|
2026-03-31 19:19:04 +08:00
|
|
|
};
|
|
|
|
|
use sha2::{Digest, Sha256};
|
|
|
|
|
|
|
|
|
|
mod failover;
|
|
|
|
|
mod local_decision;
|