Commit Graph

7 Commits

Author SHA1 Message Date
teknium1 2be8e6147a refactor(secrets): every private-credential file is written by utils.atomic_json_write(mode=0o600)
Ten hand-rolled "write a token file safely" routines each carried a
different subset of {0600-on-create, fsync, atomic_replace, parent-0700
guard, BaseException cleanup}. Two of them (iron_proxy state files,
the exchanged-JWT store) still opened the temp file at process umask
and chmod'ed afterwards - the exact TOCTOU window the others document
as fixed. None of the bare-os.replace copies got atomic_replace's
Windows-contention retry or EXDEV fallback.

utils gains fsync_dir= (absorbs auth.py's dir fsync), atomic_write_bytes
(vault blob) and mode= on atomic_write_text; the ten sites become 1-3
line callers. mkstemp creates the temp file O_EXCL at 0600 regardless of
umask, so the payload is never umask-readable.

Behavior change: iron_proxy proxy.yaml/mappings.json and the exchanged-JWT
store are now 0600 from creation and fsync'd; every credential write goes
through atomic_replace (symlink-preserving, Windows retry, EXDEV copy).
auth_nous shared store now uses atomic_replace too (it forced os.replace
with no recorded reason). secret_sources cache parent-0700 goes through
the guarded secure_parent_dir instead of an unguarded chmod.
2026-09-13 05:07:11 -07:00
Teknium 00a3cfe5c9 simplify(compat): hermes_cli split-module docstrings — drop 're-exported there' compat pointers (9 files, comments only) 2026-09-03 13:08:40 -07:00
Teknium 16579014cb refactor(hermes_cli): group C auth modules — compact WHY-preserving comments and docstrings 2026-09-02 21:59:38 -07:00
Teknium 7010f2d996 refactor(hermes_cli): group C — pack short dict/kwarg spans (AST-verified) 2026-09-02 21:26:16 -07:00
Teknium 0e3203618b refactor(hermes_cli): group C — AST-neutral layout compaction (hug/pack/join, verified ast.dump-equal) 2026-09-02 20:56:23 -07:00
Teknium 77d6e5700d refactor(hermes_cli): auth_zai_kimi/auth_qwen — priority-walk helper, shared probe model list, packed layout 2026-09-02 20:31:18 -07:00
Teknium ffa9e0ff39 refactor(auth): split Qwen OAuth flow into hermes_cli/auth_qwen.py 2026-09-02 15:25:47 -07:00