Conversation
89a9e16 to
c382eea
Compare
c382eea to
4ef5215
Compare
|
Fixed the review finding on `crates/shared/auth/src/config_profile.rs`: `AuthProfile::default()` / `AuthConfigBuilder::new()` were resolving the SQLite token store and Ed25519 JWT signing key to a bare relative `./.auth` path — cwd-dependent, and a regression from the previous `$HOME`-anchored behavior. Restored absolute resolution via a new `resolve_default_data_dir()` helper: platform data dir (`dirs::data_dir()`, i.e. `XDG_DATA_HOME`/`~/.local/share` etc.) → home dir (`dirs::home_dir()`) → bare relative path only as a last resort when neither is available. Added `dirs = "6"` to `crates/shared/auth/Cargo.toml` (same pin already used by `crates/soma/config`, `crates/soma/cli`, `crates/synapse/import`), so the crate stays publishable with no homelab-specific paths hard-coded. Added two unit tests pinning the resolution precedence and guarding against regressing back to the bare relative path, and updated the one existing test that asserted the buggy literal `.auth` value. Verification: `cargo test -q -p soma-auth --lib` → 131 passed, 0 failed. `cargo clippy -p soma-auth --lib -- -D warnings` and `cargo fmt -p soma-auth -- --check` both clean. |
5edf1d6 to
b495d48
Compare
…lative path AuthProfile::default()/AuthConfigBuilder::new() resolved the SQLite token store and Ed25519 JWT signing key to a bare relative "./.auth" path, which is cwd-dependent and can silently split or lose auth state across process restarts depending on the launch directory. Previously (before this crate's data dir became configurable via AuthProfile) it resolved under $HOME. Restore that behavior generically: prefer the platform data directory (XDG_DATA_HOME/~/.local/share via `dirs::data_dir()`), fall back to the home directory, and only fall back to the bare relative path when neither is available. No homelab-specific path is hard-coded, keeping the crate publishable; `dirs` is already used elsewhere in this workspace for the same purpose (crates/soma/config, crates/soma/cli, crates/synapse/import). Adds unit tests pinning the resolution precedence and guarding against regressing back to the bare relative path.
b495d48 to
a1aa2de
Compare
Summary
soma-auth 0.5.0as a crates.io-ready shared crate with zero local/path dependenciesAuthProfileand keeps Soma values insoma-integrationsEnvAuthConfigLoaderVerified
soma-authtestssoma-integrationstests.cratecompiled from a blank external consumer under every feature combinationcargo publish --dry-run --lockedreached the upload stageRelease
This PR does not publish the crate. Publication remains gated by the protected
crates-ioGitHub environment and thesoma-auth-vX.Y.Zrelease workflow.