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

Function set_auth

crates/opencode-server/src/routes.rs:4495–4504  ·  view source on GitHub ↗
(
    State(state): State<Arc<ServerState>>,
    Path(id): Path<String>,
    Json(req): Json<SetAuthRequest>,
)

Source from the content-addressed store, hash-verified

4493}
4494
4495async fn set_auth(
4496 State(state): State<Arc<ServerState>>,
4497 Path(id): Path<String>,
4498 Json(req): Json<SetAuthRequest>,
4499) -> Result<Json<serde_json::Value>> {
4500 let auth_info = parse_auth_info_payload(req.body)
4501 .ok_or_else(|| ApiError::BadRequest("Invalid auth payload".to_string()))?;
4502 state.auth_manager.set(&id, auth_info).await;
4503 Ok(Json(serde_json::json!({ "success": true })))
4504}
4505
4506async fn delete_auth(
4507 State(state): State<Arc<ServerState>>,

Callers

nothing calls this directly

Calls 2

parse_auth_info_payloadFunction · 0.85
setMethod · 0.45

Tested by

no test coverage detected