mirror of
https://github.com/fawney19/Aether.git
synced 2026-09-03 09:50:21 +08:00
Normalize canonical API formats
This commit is contained in:
@@ -469,7 +469,7 @@ async fn gateway_exports_admin_provider_key_locally_with_trusted_admin_principal
|
||||
let mut key = sample_key(
|
||||
"key-kiro-a",
|
||||
"provider-kiro",
|
||||
"claude:cli",
|
||||
"claude:messages",
|
||||
"oauth-access-token",
|
||||
);
|
||||
key.auth_type = "oauth".to_string();
|
||||
@@ -1569,7 +1569,12 @@ async fn gateway_handles_admin_keys_grouped_by_format_locally_with_trusted_admin
|
||||
key_a.health_by_format = Some(json!({"openai:chat": {"health_score": 0.8}}));
|
||||
key_a.circuit_breaker_by_format = Some(json!({"openai:chat": {"open": false}}));
|
||||
|
||||
let mut key_b = sample_key("key-claude-a", "provider-claude", "claude:chat", "sk-ant-a");
|
||||
let mut key_b = sample_key(
|
||||
"key-claude-a",
|
||||
"provider-claude",
|
||||
"claude:messages",
|
||||
"sk-ant-a",
|
||||
);
|
||||
key_b.internal_priority = 20;
|
||||
key_b.request_count = Some(2);
|
||||
key_b.success_count = Some(1);
|
||||
@@ -1592,7 +1597,7 @@ async fn gateway_handles_admin_keys_grouped_by_format_locally_with_trusted_admin
|
||||
sample_endpoint(
|
||||
"endpoint-claude-chat",
|
||||
"provider-claude",
|
||||
"claude:chat",
|
||||
"claude:messages",
|
||||
"https://api.claude.example",
|
||||
),
|
||||
],
|
||||
@@ -1633,7 +1638,7 @@ async fn gateway_handles_admin_keys_grouped_by_format_locally_with_trusted_admin
|
||||
"https://api.openai.example"
|
||||
);
|
||||
assert_eq!(payload["openai:chat"][0]["capabilities"], json!(["1h缓存"]));
|
||||
assert_eq!(payload["claude:chat"][0]["provider_active"], false);
|
||||
assert_eq!(payload["claude:messages"][0]["provider_active"], false);
|
||||
assert_eq!(*upstream_hits.lock().expect("mutex should lock"), 0);
|
||||
|
||||
gateway_handle.abort();
|
||||
|
||||
@@ -472,7 +472,7 @@ async fn gateway_refreshes_admin_provider_quota_locally_for_kiro_with_trusted_ad
|
||||
)
|
||||
.expect("key should build")
|
||||
.with_transport_fields(
|
||||
Some(json!(["claude:cli"])),
|
||||
Some(json!(["claude:messages"])),
|
||||
encrypted_api_key,
|
||||
Some(encrypted_auth_config),
|
||||
None,
|
||||
@@ -495,7 +495,7 @@ async fn gateway_refreshes_admin_provider_quota_locally_for_kiro_with_trusted_ad
|
||||
vec![sample_endpoint(
|
||||
"endpoint-kiro-cli",
|
||||
"provider-kiro",
|
||||
"claude:cli",
|
||||
"claude:messages",
|
||||
"https://q.us-west-2.amazonaws.com",
|
||||
)],
|
||||
vec![key],
|
||||
@@ -830,7 +830,7 @@ async fn gateway_refreshes_admin_provider_quota_locally_for_antigravity_with_tru
|
||||
)
|
||||
.expect("key should build")
|
||||
.with_transport_fields(
|
||||
Some(json!(["gemini:chat"])),
|
||||
Some(json!(["gemini:generate_content"])),
|
||||
encrypt_python_fernet_plaintext(DEVELOPMENT_ENCRYPTION_KEY, "ya29.ant-token")
|
||||
.expect("api key ciphertext should build"),
|
||||
Some(encrypted_auth_config),
|
||||
@@ -854,7 +854,7 @@ async fn gateway_refreshes_admin_provider_quota_locally_for_antigravity_with_tru
|
||||
vec![sample_endpoint(
|
||||
"endpoint-antigravity-chat",
|
||||
"provider-antigravity",
|
||||
"gemini:chat",
|
||||
"gemini:generate_content",
|
||||
"https://daily-cloudcode-pa.googleapis.com",
|
||||
)],
|
||||
vec![key],
|
||||
|
||||
Reference in New Issue
Block a user