(&self, name: &str)
| 518 | } |
| 519 | |
| 520 | pub fn authenticate_mcp(&self, name: &str) -> anyhow::Result<McpStatusInfo> { |
| 521 | let url = format!("{}/mcp/{}/auth/authenticate", self.base_url, name); |
| 522 | let response = self.client.post(&url).send()?; |
| 523 | if !response.status().is_success() { |
| 524 | let status = response.status(); |
| 525 | let text = response.text().unwrap_or_default(); |
| 526 | anyhow::bail!( |
| 527 | "Failed to authenticate MCP `{}`: {} - {}", |
| 528 | name, |
| 529 | status, |
| 530 | text |
| 531 | ); |
| 532 | } |
| 533 | Ok(response.json::<McpStatusInfo>()?) |
| 534 | } |
| 535 | |
| 536 | pub fn remove_mcp_auth(&self, name: &str) -> anyhow::Result<bool> { |
| 537 | let url = format!("{}/mcp/{}/auth", self.base_url, name); |
no test coverage detected