unsloth/studio/backend/auth
Daniel Han 729cb51e44 Normalise the bootstrap file in place so a cleared credential stays cleared
The rename-based rewrite could recreate the file: if a password change ran
clear_bootstrap_password(), or the CLI cleanup deleted it, between the read and
the write, os.replace put the revoked plaintext back on disk, where a later
auth.db reset would re-seed it.

Open the existing file without O_CREAT instead, so a deleted file cannot be
resurrected, and re-check the contents through that descriptor so an in-place
truncation or a rotated credential is not overwritten either.

That gives up the atomic rename, so the in-place path is restricted to
trailing-whitespace fixes. Every partial state is then the secret plus leftover
whitespace, which still strips to the same credential. Files with leading
whitespace are left alone; every reader strips, so they keep working.

Creation still goes through the atomic writer.
2026-07-29 05:19:43 +00:00
..
.gitkeep root studio folder 2026-02-02 09:13:49 +00:00
__init__.py Studio: make code comments and docstrings more succinct (#6029) 2026-06-08 23:07:28 -07:00
authentication.py Studio: tighten the comments added by the OpenAI model-admission work (#7501) 2026-07-27 05:59:03 -07:00
bootstrap_timeout.py Replace standalone Studio wording with Unsloth (#7221) 2026-07-19 00:47:04 -07:00
hashing.py Reduce and tighten code comments and docstrings repo-wide (#6095) 2026-06-08 23:09:51 -07:00
storage.py Normalise the bootstrap file in place so a cleared credential stays cleared 2026-07-29 05:19:43 +00:00
terminal_prompt.py Studio: reject whitespace-only passwords (#7341) 2026-07-23 00:44:37 -07:00