(
State(_state): State<Arc<ServerState>>,
)
| 2314 | } |
| 2315 | |
| 2316 | async fn get_provider_auth( |
| 2317 | State(_state): State<Arc<ServerState>>, |
| 2318 | ) -> Json<HashMap<String, Vec<AuthMethodInfo>>> { |
| 2319 | let Some(loader) = get_plugin_loader() else { |
| 2320 | return Json(HashMap::new()); |
| 2321 | }; |
| 2322 | let methods = ProviderAuth::methods(loader).await; |
| 2323 | let result = methods |
| 2324 | .into_iter() |
| 2325 | .map(|(provider, values)| { |
| 2326 | let mapped = values |
| 2327 | .into_iter() |
| 2328 | .map(|method| AuthMethodInfo { |
| 2329 | name: method.label, |
| 2330 | description: method.method_type, |
| 2331 | }) |
| 2332 | .collect::<Vec<_>>(); |
| 2333 | (provider, mapped) |
| 2334 | }) |
| 2335 | .collect::<HashMap<_, _>>(); |
| 2336 | Json(result) |
| 2337 | } |
| 2338 | |
| 2339 | #[derive(Debug, Deserialize)] |
| 2340 | pub struct OAuthAuthorizeRequest { |
nothing calls this directly
no test coverage detected