Repository navigation
fix(builderlab-auth): default non-macOS session storage to a private file - #43
Open
corydouthat-sq wants to merge 2 commits into
Open
corydouthat-sq wants to merge 2 commits into
corydouthat-sq wants to merge 2 commits into
Conversation
…file The OS keyring backend exists only on macOS, but it was the default everywhere, and the session header lookup returned None off macOS unless BL_AUTH_STORAGE was set. Linux and Windows logins were never stored or sent. Default to <bl home>/auth-sessions.json off macOS and drop the early return. Serialize writes with an OS lock on a sibling .lock file, write each document to a temporary sibling that is restricted (0600 on Unix, an explicit icacls ACL on Windows) before any bytes reach it, and rename it over the store. Resolve bl home from USERPROFILE on Windows when HOME is unset. Ported from block/berd#327. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Cory Douthat <80133232+corydouthat-sq@users.noreply.github.com>
The repository CI runs on Linux only, so the Windows ACL and USERPROFILE paths in builderlab-auth were never exercised. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Cory Douthat <80133232+corydouthat-sq@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This ports block/berd#327 from
bb-cliintobuilderlab-auth, sincebb-cliis moving to this repository.On Linux and Windows, login sessions are never saved or sent today:
BL_AUTH_STORAGEset, the default storage is the OS keyring. That backend exists only on macOS, so login fails everywhere else.stored_session_credential_header_valuereturnsNoneearly on non-macOS unlessBL_AUTH_STORAGEorBL_AUTH_STORAGE_FILEis set. So even a session saved by hand is never sent.This change:
<bl home>/auth-sessions.json, the same path thatBL_AUTH_STORAGE=filealready selects. macOS still defaults to the keyring.auth-sessions.json.lock(File::lock, so the MSRV moves from 1.88 to 1.89).icaclsdetaches it from the parent folder's permissions and grants the current user full control.SYSTEMandAdministrators. Those two can remain from the default ACL Windows applies when the parent folder passes nothing down, as on GitHub's Windows runners.USERPROFILEwhenHOMEis unset (cmd and PowerShell don't set it). Before, it fell back to a.blrelative to the working directory.docs/bl-auth-local-testing.md.Testing
cargo test -p builderlab-auth(38 passed; 53 with--all-features),cargo clippy -p builderlab-auth --all-targets -- -D warnings,cargo fmt --check,cargo build --bin bl.cargo test --locked --workspace --all-featurespasses except one existing failure this change doesn't touch:bl::skills::tests::is_path_like_detects_local_pathsassertsis_path_like("dir/skill"), which is false on Windows.file:<path>andBL_AUTH_STORAGE_FILEoverridescreate_newrefusing an existing pathAuth storage (Windows)job runningcargo test --locked -p builderlab-authonwindows-latest. The existing Linux job covers the Unix paths. I couldn't runjust cilocally: Hermit has no Windows support.Related
bb-cli). It passes CI on macOS, Linux, and Windows and is awaiting review.🤖 Generated with Claude Code