Write the entire auth store to disk (creates parent dirs as needed).
(data: &HashMap<String, AuthEntry>)
| 67 | |
| 68 | /// Write the entire auth store to disk (creates parent dirs as needed). |
| 69 | async fn write_all(data: &HashMap<String, AuthEntry>) -> Result<(), std::io::Error> { |
| 70 | let path = auth_file_path(); |
| 71 | if let Some(parent) = path.parent() { |
| 72 | fs::create_dir_all(parent).await?; |
| 73 | } |
| 74 | let json = serde_json::to_string_pretty(data) |
| 75 | .map_err(|e| std::io::Error::new(std::io::ErrorKind::Other, e))?; |
| 76 | fs::write(&path, json).await |
| 77 | } |
| 78 | |
| 79 | // --------------------------------------------------------------------------- |
| 80 | // Public API – mirrors TS McpAuth namespace |
no test coverage detected