ruview @ v3809
integrity
- size
- 62.0 MiB
- downloaded
- last checked
release notes
Source snapshot validated by the CI pipeline. This entry does not contain firmware bundles.
Changes: [SECURITY-SENSITIVE] fix(ruview-auth): one refresh across processes; no proceed after lock timeout; a sent token is never kept (#2599)
- fix(ruview-auth): one refresh across processes, no proceed after a lock timeout, a sent token is never kept
Identity (cognitum-one/console#857) revokes the whole session family when a used refresh token is presented again. ensure_fresh could do that in ordinary use:
- after 3 s waiting on another process's lock it went ahead anyway;
- it presented the token it loaded earlier instead of re-reading the file under the lock;
- it kept the old token after a failed or timed-out request;
- it reused the old token when an answer carried no new one;
- on non-Unix it had no lock at all.
Now:
- login/lock.rs: flock on Unix. Elsewhere, an atomic
credentials.lock.ddirectory (stale after 120 s), and if the lock state can't be read it fails closed. A waiter polls for up to LOCK_WAIT (30 s, longer than the request timeout). If it still has no lock it returns the new StoreError::RefreshBusy, having sent nothing and changed nothing. - Under the lock the file is re-read, and a record another process already refreshed is used.
- Before sending, the stored record loses its refresh token (a token-less marker). A process that dies mid-request leaves a record that answers NoRefreshToken, never a reusable spent token.
- Any failure once the request may have reached Identity clears the stored credentials, and the in-memory session goes token-less too. That covers a timeout, a reset, an error answer, a bad body, and a failed save of the new pair. Only a connection that was never made restores the old token.
- An answer with no new refresh token stores none; the spent one is not kept.
- client::refresh is bounded by REFRESH_TIMEOUT (20 s).
Tests (store_refresh_tests.rs). Each scenario runs in a child process, which is this test binary re-invoked. Identity is a 127.0.0.1 fixture and all tokens are fixtures.
- Two processes with one expired file: 1 refresh, and both get the new pair.
- A timeout after sending clears the file, and the next run sends nothing.
- A leftover token-less record is never sent.
- A held lock gives RefreshBusy and sends nothing.
- A refused connection keeps the token.
- An answer without a refresh token keeps none.
Mutation checks: dropping the re-read under the lock gives 2 refreshes;
keeping the token after an error fails the timeout test.
cargo test -p ruview-auth --all-features: 70 + 25 + 2 pass.
- fix(ruview-auth): File::lock on a never-deleted lock file everywhere; durable writes (review-393)
Fixes from review-393 on #2599:
- Lock. A takeover-by-removal lock (like the non-Unix lock directory in the
previous commit) can let two takers both hold it; review-393 reproduced this
1 in 100 on the console CLI's equivalent. The lock is now
File::lock(stable since 1.89, the repo's pinned toolchain) on every platform:- it locks
credentials.lock, which is never deleted; - it uses flock on Unix and LockFileEx on Windows;
- the OS releases it when the holder exits or dies, so there is no staleness heuristic;
- a lock that can't be taken at all fails closed;
- the 30 s wait followed by RefreshBusy is unchanged.
The crate no longer calls libc. The optional
libcdependency is left in Cargo.toml so Cargo.lock doesn't change in this PR.
- it locks
- Durability. On Unix the parent directory is fsynced after the rename. On other platforms write_private now sync_all's the tmp file before the rename.
- Child processes in the refresh tests have the test-only hooks removed from their environment.
New tests:
- a lock held by a live child process blocks; once the child is killed (never releasing), the lock frees;
- 8 threads x 25 rounds never have more than one holder;
- the lock file is never unlinked. Stress: the full lib test binary ran 90 times, 6 in parallel, with 90 passes.
- fix(ruview-auth): make the credentials directory fsync best effort (L8)
The parent-directory fsync ran after the rename had already put the new pair in place, and its error was fatal. On FUSE or network mounts that reject a directory fsync (EINVAL/ENOTSUP), every refresh would clear the new pair and sign the user out. It is now logged with tracing::warn and ignored; the tmp file's sync_all before the rename stays fatal.
Corrects the marker-save comment, adds tests that inject a directory-fsync failure through RUVIEW_TEST_FAIL_DIR_FSYNC (save succeeds; refresh rotates and keeps the new pair), and drops the now-unused optional libc dependency.
- fix(ruview-auth): never launch a browser from tests
open_browser's unit test called the real launcher, so every
cargo test -p ruview-auth opened a tab at http://127.0.0.1:1/nope in the
developer's browser. Under cfg(test), open_browser now records the command
it would run instead of spawning it, and the test asserts that command.
Source commit: f7de049ebd637aae7f5d20d51cc23162938cbad9
Container images publish separately through the sensing-server release workflow.
Firmware downloads are attached to the dedicated vX.Y.Z-esp32 releases.
download
curl -fL -o v3809.zip https://ratatoskr.space/pkg/ruview/v3809.zip
printf '%s %s\n' 'df9f50c38c532cc71ab6d9456a0327e82b728bb169e778748fac940339eef227' 'v3809.zip' | sha256sum -c -
$url = "https://ratatoskr.space/pkg/ruview/v3809.zip"
$out = "v3809.zip"
Invoke-WebRequest -Uri $url -OutFile $out
if ((Get-FileHash $out -Algorithm SHA256).Hash.ToLowerInvariant() -ne "df9f50c38c532cc71ab6d9456a0327e82b728bb169e778748fac940339eef227") { throw "sha256 mismatch" }
curl -fL -o v3809.tar.gz https://ratatoskr.space/pkg/ruview/v3809.tar.gz
printf '%s %s\n' '4381fdb28eee89d59e01079a63ae0fa5bc77d801e7aa6515d9cebc3de528f439' 'v3809.tar.gz' | sha256sum -c -
$url = "https://ratatoskr.space/pkg/ruview/v3809.tar.gz"
$out = "v3809.tar.gz"
Invoke-WebRequest -Uri $url -OutFile $out
if ((Get-FileHash $out -Algorithm SHA256).Hash.ToLowerInvariant() -ne "4381fdb28eee89d59e01079a63ae0fa5bc77d801e7aa6515d9cebc3de528f439") { throw "sha256 mismatch" }
download via yggdrasil mesh
curl -fL -o v3809.zip http://14cc7d57b5e70f679b851fe5b272ce17c70632ff4beb5b35ab64bc706b2485af.pk.ygg/pkg/ruview/v3809.zip
printf '%s %s\n' 'df9f50c38c532cc71ab6d9456a0327e82b728bb169e778748fac940339eef227' 'v3809.zip' | sha256sum -c -
$url = "http://14cc7d57b5e70f679b851fe5b272ce17c70632ff4beb5b35ab64bc706b2485af.pk.ygg/pkg/ruview/v3809.zip"
$out = "v3809.zip"
Invoke-WebRequest -Uri $url -OutFile $out
if ((Get-FileHash $out -Algorithm SHA256).Hash.ToLowerInvariant() -ne "df9f50c38c532cc71ab6d9456a0327e82b728bb169e778748fac940339eef227") { throw "sha256 mismatch" }
curl -fL -o v3809.tar.gz http://14cc7d57b5e70f679b851fe5b272ce17c70632ff4beb5b35ab64bc706b2485af.pk.ygg/pkg/ruview/v3809.tar.gz
printf '%s %s\n' '4381fdb28eee89d59e01079a63ae0fa5bc77d801e7aa6515d9cebc3de528f439' 'v3809.tar.gz' | sha256sum -c -
$url = "http://14cc7d57b5e70f679b851fe5b272ce17c70632ff4beb5b35ab64bc706b2485af.pk.ygg/pkg/ruview/v3809.tar.gz"
$out = "v3809.tar.gz"
Invoke-WebRequest -Uri $url -OutFile $out
if ((Get-FileHash $out -Algorithm SHA256).Hash.ToLowerInvariant() -ne "4381fdb28eee89d59e01079a63ae0fa5bc77d801e7aa6515d9cebc3de528f439") { throw "sha256 mismatch" }
| artifact | format | size | hashes |
|---|---|---|---|
| v3809.zip | zip | 62.2 MiB |
blake3-24 db76862a973860fda17cfb3224b5845d11d0bfe399358468
sha256 df9f50c38c532cc71ab6d9456a0327e82b728bb169e778748fac940339eef227
sha1 850cd5b7ffd78e3abfc91b78f8784cc01986b594
|
| v3809.tar.gz | tar.gz | 59.7 MiB |
blake3-24 d69c5fb6a494a76335f5cab421d177d0c94bba49fc9e4179
sha256 4381fdb28eee89d59e01079a63ae0fa5bc77d801e7aa6515d9cebc3de528f439
sha1 9ed5006e2faed3061ad537417d7d81b91a5f8cd7
|
install
http_archive(
name = "ruview",
urls = ["https://ratatoskr.space/pkg/ruview/v3809.tar.gz"],
integrity = "sha256-Q4H9so7uidWeAQeaY64Ppbx32AHnqmUV2c68PeUo9Dk=",
strip_prefix = "ruview-v3809",
)
.url = "https://ratatoskr.space/pkg/ruview/v3809.tar.gz",
install via yggdrasil mesh
http_archive(
name = "ruview",
urls = ["http://14cc7d57b5e70f679b851fe5b272ce17c70632ff4beb5b35ab64bc706b2485af.pk.ygg/pkg/ruview/v3809.tar.gz"],
integrity = "sha256-Q4H9so7uidWeAQeaY64Ppbx32AHnqmUV2c68PeUo9Dk=",
strip_prefix = "ruview-v3809",
)
.url = "http://14cc7d57b5e70f679b851fe5b272ce17c70632ff4beb5b35ab64bc706b2485af.pk.ygg/pkg/ruview/v3809.tar.gz",