ui: gate community wizard capabilities

This commit is contained in:
a.tolmachev
2026-05-03 17:11:30 +00:00
parent 10433d5193
commit 49c46c0d0b
14 changed files with 221 additions and 225 deletions
+29
View File
@@ -1038,6 +1038,35 @@ mod tests {
assert_eq!(response["limits"]["max_agents_per_workspace"], 1);
}
#[tokio::test(flavor = "multi_thread")]
#[serial]
async fn returns_community_protocol_capabilities_only_for_supported_protocols() {
let registry = test_registry().await;
let storage_root = test_storage_root("community_protocol_capabilities");
let base_url = spawn_admin_api(build_test_app(registry, storage_root)).await;
let client = authorized_client(&base_url).await;
let response = assert_success_json(
client
.get(format!("{base_url}/protocol-capabilities"))
.send()
.await
.unwrap(),
)
.await;
assert_eq!(response["items"].as_array().unwrap().len(), 3);
assert_eq!(
response["items"]
.as_array()
.unwrap()
.iter()
.map(|item| item["protocol"].as_str().unwrap())
.collect::<Vec<_>>(),
vec!["rest", "graphql", "grpc"]
);
}
#[tokio::test(flavor = "multi_thread")]
#[serial]
async fn manages_workspace_access_lifecycle() {
+6 -10
View File
@@ -1556,16 +1556,12 @@ impl AdminService {
}
pub async fn list_protocol_capabilities(&self) -> Vec<ProtocolCapabilityView> {
[
Protocol::Rest,
Protocol::Graphql,
Protocol::Grpc,
Protocol::Websocket,
Protocol::Soap,
]
.into_iter()
.map(protocol_capability_view)
.collect()
self.get_capabilities()
.await
.supported_protocols
.into_iter()
.map(protocol_capability_view)
.collect()
}
pub async fn get_capabilities(&self) -> EditionCapabilities {