fix(providers): set 0o700 when creating codex auth dir

The token file is 0o600 but the parent dir was created with default perms (0o755 after umask). Align with Codex CLI by forcing 0o700 on mkdir. Only applies at creation; existing dirs keep their mode.
This commit is contained in:
hqhq1025
2026-04-22 02:51:33 +08:00
parent 848fe115e6
commit 53e8b9cd7f
+1 -1
View File
@@ -81,7 +81,7 @@ export class CodexTokenStore {
}
async write(auth: StoredCodexAuth): Promise<void> {
await mkdir(dirname(this.filePath), { recursive: true });
await mkdir(dirname(this.filePath), { recursive: true, mode: 0o700 });
const body = JSON.stringify(auth, null, 2);
await writeFile(this.filePath, body, { encoding: 'utf8', mode: 0o600 });
this.cache = auth;