MCPcopy Index your code
hub / github.com/ChrisFeldmeier/OpenCodeRust / get_provider_auth

Function get_provider_auth

crates/opencode-server/src/routes.rs:2316–2337  ·  view source on GitHub ↗
(
    State(_state): State<Arc<ServerState>>,
)

Source from the content-addressed store, hash-verified

2314}
2315
2316async 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)]
2340pub struct OAuthAuthorizeRequest {

Callers

nothing calls this directly

Calls 2

get_plugin_loaderFunction · 0.85
newFunction · 0.85

Tested by

no test coverage detected