mirror of
https://github.com/fawney19/Aether.git
synced 2026-09-03 09:50:21 +08:00
refactor: 移除 Python upstream 依赖,清理全部 legacy/Python 兼容层
- 移除 upstream_base_url 参数及 AETHER_GATEWAY_UPSTREAM 环境变量,gateway 不再需要指向 Python 宿主 - 删除所有 LEGACY_*/PYTHON_* 常量、路由组、header 定义及 sunset/phaseout 机制 - 将 legacy_gateway_bridge 重命名为 internal_gateway,executor 相关命名统一为 execution_runtime - dev.sh 新增 Postgres/Redis 预检查,移除 upstream 相关启动参数和提示 - 新增 ai_public 路由处理器 - 全量适配 handler、test、state、control 等模块的命名和接口变更
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
use super::*;
|
||||
use serde_json::json;
|
||||
|
||||
#[derive(Clone, Copy)]
|
||||
pub(crate) struct PublicCapabilityDefinition {
|
||||
|
||||
@@ -1,4 +1,9 @@
|
||||
use super::*;
|
||||
use super::enabled_key_capability_short_names;
|
||||
use crate::gateway::handlers::{json_string_list, masked_catalog_api_key, unix_secs_to_rfc3339};
|
||||
use crate::gateway::AppState;
|
||||
use serde_json::json;
|
||||
use std::collections::BTreeMap;
|
||||
use std::time::{SystemTime, UNIX_EPOCH};
|
||||
|
||||
pub(crate) async fn build_admin_keys_grouped_by_format_payload(
|
||||
state: &AppState,
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
use super::*;
|
||||
use super::{module_available_from_env, system_config_bool};
|
||||
use crate::gateway::{AppState, GatewayError};
|
||||
use serde_json::json;
|
||||
|
||||
#[derive(Clone, Copy)]
|
||||
struct PublicAuthModuleDefinition {
|
||||
|
||||
@@ -1,4 +1,16 @@
|
||||
use super::*;
|
||||
use crate::gateway::api::ai::admin_endpoint_signature_parts;
|
||||
use crate::gateway::handlers::{decrypt_catalog_secret_with_fallbacks, unix_secs_to_rfc3339};
|
||||
use crate::gateway::{AppState, GatewayError};
|
||||
use aether_crypto::encrypt_python_fernet_plaintext;
|
||||
use aether_data::repository::global_models::{
|
||||
AdminGlobalModelListQuery, AdminProviderModelListQuery,
|
||||
};
|
||||
use axum::body::Bytes;
|
||||
use axum::http;
|
||||
use chrono::Utc;
|
||||
use serde_json::json;
|
||||
use std::collections::{BTreeMap, BTreeSet};
|
||||
use std::fs;
|
||||
|
||||
#[derive(Debug, Clone, Copy)]
|
||||
struct AdminApiFormatDefinition {
|
||||
@@ -219,7 +231,7 @@ pub(crate) async fn build_admin_system_settings_payload(
|
||||
|
||||
pub(crate) async fn apply_admin_system_settings_update(
|
||||
state: &AppState,
|
||||
request_body: &axum::body::Bytes,
|
||||
request_body: &Bytes,
|
||||
) -> Result<Result<serde_json::Value, (http::StatusCode, serde_json::Value)>, GatewayError> {
|
||||
let payload = match serde_json::from_slice::<serde_json::Value>(request_body) {
|
||||
Ok(serde_json::Value::Object(payload)) => payload,
|
||||
@@ -603,7 +615,7 @@ pub(crate) fn render_admin_email_template_html(
|
||||
pub(crate) async fn apply_admin_email_template_update(
|
||||
state: &AppState,
|
||||
template_type: &str,
|
||||
request_body: &axum::body::Bytes,
|
||||
request_body: &Bytes,
|
||||
) -> Result<Result<serde_json::Value, (http::StatusCode, serde_json::Value)>, GatewayError> {
|
||||
let Some(definition) = admin_email_template_definition(template_type) else {
|
||||
return Ok(Err((
|
||||
@@ -677,7 +689,7 @@ pub(crate) async fn apply_admin_email_template_update(
|
||||
pub(crate) async fn preview_admin_email_template(
|
||||
state: &AppState,
|
||||
template_type: &str,
|
||||
request_body: Option<&axum::body::Bytes>,
|
||||
request_body: Option<&Bytes>,
|
||||
) -> Result<Result<serde_json::Value, (http::StatusCode, serde_json::Value)>, GatewayError> {
|
||||
let Some(definition) = admin_email_template_definition(template_type) else {
|
||||
return Ok(Err((
|
||||
@@ -1550,7 +1562,7 @@ pub(crate) async fn build_admin_system_config_detail_payload(
|
||||
pub(crate) async fn apply_admin_system_config_update(
|
||||
state: &AppState,
|
||||
requested_key: &str,
|
||||
request_body: &axum::body::Bytes,
|
||||
request_body: &Bytes,
|
||||
) -> Result<Result<serde_json::Value, (http::StatusCode, serde_json::Value)>, GatewayError> {
|
||||
let payload = match serde_json::from_slice::<serde_json::Value>(request_body) {
|
||||
Ok(serde_json::Value::Object(payload)) => payload,
|
||||
|
||||
Reference in New Issue
Block a user