Persist an auth entry (optionally updating the server URL).
(
mcp_name: &str,
entry: AuthEntry,
server_url: Option<&str>,
)
| 96 | } |
| 97 | /// Persist an auth entry (optionally updating the server URL). |
| 98 | pub async fn set( |
| 99 | mcp_name: &str, |
| 100 | entry: AuthEntry, |
| 101 | server_url: Option<&str>, |
| 102 | ) -> Result<(), std::io::Error> { |
| 103 | let mut data = read_all().await; |
| 104 | let mut entry = entry; |
| 105 | if let Some(url) = server_url { |
| 106 | entry.server_url = Some(url.to_string()); |
| 107 | } |
| 108 | data.insert(mcp_name.to_string(), entry); |
| 109 | write_all(&data).await |
| 110 | } |
| 111 | |
| 112 | /// Remove all stored auth data for a server. |
| 113 | pub async fn remove(mcp_name: &str) -> Result<(), std::io::Error> { |
no test coverage detected