unsloth/studio/backend/auth
Daniel Han d404cade59 Run the newline migration on the path upgrades actually take
ensure_default_admin() short-circuits to _load_bootstrap_password() once the
admin row exists, so the normalisation added in the previous commit sat on
generate_bootstrap_password(), which only fresh installs reach. An upgraded
install kept its newline-less file. Both readers now share
_read_persisted_bootstrap_password().

Make the write atomic while it is here: it can now rewrite a live file, and a
partial write would destroy the only plaintext copy of the recovery
credential. Same mkstemp plus os.replace shape the CLI writer already uses.

Tests cover the upgrade path through ensure_default_admin(), a well-formed
file not being rewritten on every start, a failing migration not blocking
startup, and the atomic replace.
2026-07-29 04:38:12 +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 Run the newline migration on the path upgrades actually take 2026-07-29 04:38:12 +00:00
terminal_prompt.py Studio: reject whitespace-only passwords (#7341) 2026-07-23 00:44:37 -07:00