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

Function plugin_auth_authorize

crates/opencode-server/src/routes.rs:4606–4623  ·  view source on GitHub ↗
(
    _state: State<Arc<ServerState>>,
    Path(name): Path<String>,
    Json(req): Json<PluginAuthAuthorizeRequest>,
)

Source from the content-addressed store, hash-verified

4604}
4605
4606async fn plugin_auth_authorize(
4607 _state: State<Arc<ServerState>>,
4608 Path(name): Path<String>,
4609 Json(req): Json<PluginAuthAuthorizeRequest>,
4610) -> Result<Json<PluginAuthAuthorizeResponse>> {
4611 let bridge = get_auth_bridge(&name).await?;
4612
4613 let result = bridge
4614 .authorize(req.method, req.inputs)
4615 .await
4616 .map_err(|e| ApiError::BadRequest(e.to_string()))?;
4617
4618 Ok(Json(PluginAuthAuthorizeResponse {
4619 url: result.url,
4620 instructions: result.instructions,
4621 method: result.method,
4622 }))
4623}
4624
4625#[derive(Debug, Deserialize)]
4626struct PluginAuthCallbackRequest {

Callers

nothing calls this directly

Calls 2

get_auth_bridgeFunction · 0.85
authorizeMethod · 0.45

Tested by

no test coverage detected