mirror of
https://github.com/router-for-me/CLIProxyAPI.git
synced 2026-11-29 21:33:01 +08:00
- Add misc.WriteFileAtomic to write credentials into a non-.json temporary file in the target directory with 0600 permissions, sync to disk, close, and atomically rename over the target path while cleaning up temporary files on failure. - Update FileTokenStore.Save and the Claude, Kimi, xAI, and Vertex SaveTokenToFile implementations to serialize JSON in memory and persist atomically instead of truncating files in place. - Add regression tests verifying sync ordering, failure cleanup, 0600 permissions, and atomic replacement semantics across all updated auth save paths. Closes: #8539