(_state: State<Arc<ServerState>>)
| 4566 | } |
| 4567 | |
| 4568 | async fn list_plugin_auth(_state: State<Arc<ServerState>>) -> Result<Json<Vec<PluginAuthInfo>>> { |
| 4569 | let Some(loader) = get_plugin_loader() else { |
| 4570 | return Ok(Json(Vec::new())); |
| 4571 | }; |
| 4572 | |
| 4573 | let bridges = loader.auth_bridges().await; |
| 4574 | let result: Vec<PluginAuthInfo> = bridges |
| 4575 | .values() |
| 4576 | .map(|bridge| PluginAuthInfo { |
| 4577 | provider: bridge.provider().to_string(), |
| 4578 | methods: bridge |
| 4579 | .methods() |
| 4580 | .iter() |
| 4581 | .map(|m| PluginAuthMethodInfo { |
| 4582 | method_type: m.method_type.clone(), |
| 4583 | label: m.label.clone(), |
| 4584 | }) |
| 4585 | .collect(), |
| 4586 | }) |
| 4587 | .collect(); |
| 4588 | |
| 4589 | Ok(Json(result)) |
| 4590 | } |
| 4591 | |
| 4592 | #[derive(Debug, Deserialize)] |
| 4593 | struct PluginAuthAuthorizeRequest { |
nothing calls this directly
no test coverage detected