storage
Class info¶
🛈 DocStrings¶
Private, atomic token files and a cross-process lock for token refreshes.
file_lock
¶
Hold an exclusive lock on <path>.lock (blocking; no-op where flock is missing).
Source code in src/llmling_models/auth/storage.py
write_private_json
¶
Write JSON to path, readable by the owner only, replacing it atomically.
The temp file is created with mode 0600 (mkstemp), so the secret is never in a world-readable file, and a concurrent reader sees the old or the new file, never a truncated one.