mirror of
https://github.com/fawney19/Aether.git
synced 2026-09-02 17:30:23 +08:00
Implement generic pool member scoring and probing
This commit is contained in:
@@ -240,6 +240,18 @@ pub(super) fn classify_admin_observability_family_route(
|
||||
"admin:pool",
|
||||
false,
|
||||
))
|
||||
} else if method == http::Method::GET
|
||||
&& normalized_path_no_trailing.starts_with("/api/admin/pool/")
|
||||
&& normalized_path_no_trailing.ends_with("/scores")
|
||||
&& normalized_path_no_trailing.matches('/').count() == 5
|
||||
{
|
||||
Some(classified(
|
||||
"admin_proxy",
|
||||
"pool_manage",
|
||||
"scores",
|
||||
"admin:pool",
|
||||
false,
|
||||
))
|
||||
} else if method == http::Method::POST
|
||||
&& normalized_path_no_trailing.starts_with("/api/admin/pool/")
|
||||
&& normalized_path_no_trailing.ends_with("/keys/batch-import")
|
||||
|
||||
@@ -52,6 +52,14 @@ fn classifies_admin_pool_provider_key_routes_as_admin_proxy_route() {
|
||||
assert_eq!(list.route_family.as_deref(), Some("pool_manage"));
|
||||
assert_eq!(list.route_kind.as_deref(), Some("list_keys"));
|
||||
|
||||
let scores_uri: Uri = "/api/admin/pool/provider-1/scores?api_format=openai:responses"
|
||||
.parse()
|
||||
.expect("uri should parse");
|
||||
let scores = classify_control_route(&http::Method::GET, &scores_uri, &headers)
|
||||
.expect("route should classify");
|
||||
assert_eq!(scores.route_family.as_deref(), Some("pool_manage"));
|
||||
assert_eq!(scores.route_kind.as_deref(), Some("scores"));
|
||||
|
||||
let batch_import_uri: Uri = "/api/admin/pool/provider-1/keys/batch-import"
|
||||
.parse()
|
||||
.expect("uri should parse");
|
||||
|
||||
Reference in New Issue
Block a user