Pin VoelinProtocol at the tag v0.2.0
The three entries of [workspace.dependencies] (voelin-identity, voelin-proto,
voelin-model) were pinned by rev c5bb6b9 and are now { git, tag = "v0.2.0" }
(a45c154), and so is voelin-model in spikes/gpui. Cargo.lock of both
workspaces changes in those packages only: the three sources, and
voelin-model 0.1.0 -> 0.2.0 (the crates' manifests are otherwise the same
at both revisions, so the lock was edited by hand and checked with
--locked; `cargo update -p` also moved eleven unrelated edges, such as
windows-sys 0.61.2 -> 0.52.0, and was discarded). One revision of each
crate in both locks. THIRD_PARTY_NOTICES.md is unchanged
(scripts/notices.sh --check is clean).
What "For consumers" of the protocol's CHANGELOG lists for this pin:
- KeyStore::sign_out lists a device key once. The test that unbinds a device
key whose row carries a device-only binding counted it with `contains`; it
now counts one entry in `unbound` and none in `removed`, and a new test
does the same for Forget (one entry in `removed`, none in `unbound`). Both
fail with the pin at c5bb6b9.
- Debug of Hello, Welcome, Server and others prints <redacted>: no test of
the client compares a Debug text of a protocol message.
- The conformance suite still has 17 cases; the two places that named the old
rev in a string or a comment name the tag.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
dccedf2fcd
commit
6938dbed3a
7 files changed
+70
-21
No files matched your search
@@ -313,7 +313,7 @@ async fn the_conformance_suite_passes_on_a_session_of_the_registry() {
|
||||
}
|
||||
let report = conformance::run(&through_the_registry).await;
|
||||
assert_eq!(report.cases.len(), conformance::CASES.len());
|
||||
assert_eq!(report.cases.len(), 17, "the suite of c5bb6b9 has 17 cases");
|
||||
assert_eq!(report.cases.len(), 17, "the suite of v0.2.0 has 17 cases");
|
||||
assert!(
|
||||
report.cases.iter().all(|(_, verdict)| *verdict == Verdict::Passed),
|
||||
"{:?}",
|
||||
|
||||
@@ -333,7 +333,7 @@ enum Expect {
|
||||
}
|
||||
use Expect::{NotRun, Passes, Skipped};
|
||||
|
||||
/// Every case of the suite of the protocol repository at `c5bb6b9`, in its
|
||||
/// Every case of the suite of the protocol repository at `v0.2.0`, in its
|
||||
/// order, with what a TeamSpeak session does with it. A case the suite gains
|
||||
/// fails `the_suite_is_known` until it is listed here.
|
||||
///
|
||||
|
||||
@@ -791,6 +791,11 @@ fn pair(blob: &IdentityBlob) -> (String, String) {
|
||||
(blob.kind.clone(), blob.uid.clone())
|
||||
}
|
||||
|
||||
/// How many times a sign-out's list names the identity `key` (by kind and uid).
|
||||
fn times_listed(infos: &[IdentityInfo], key: &IdentityInfo) -> usize {
|
||||
infos.iter().filter(|info| info.kind == key.kind && info.uid == key.uid).count()
|
||||
}
|
||||
|
||||
/// The record of the install replaced by damaged JSON.
|
||||
fn damage_the_record(store: &SqliteKeyStore, json: &str) {
|
||||
let mut damaged = store.get(KIND_ACCOUNT, &record().blob_uid()).unwrap().unwrap();
|
||||
@@ -1887,9 +1892,19 @@ fn a_device_key_that_carries_a_binding_is_unbound_and_keeps_the_rest_of_its_row(
|
||||
};
|
||||
assert!(bound(&before), "the setup binds the key");
|
||||
|
||||
// It is listed once, as kept: VoelinProtocol before v0.2.0 listed a key whose
|
||||
// row carried the binding twice in `unbound`.
|
||||
let done = install.store.sign_out(&binding().account, DeviceKeyChoice::Auto).unwrap();
|
||||
assert!(done.unbound.contains(&device_key_info()), "{bound_existing_key}: {done:?}");
|
||||
assert!(!done.removed.contains(&device_key_info()), "{bound_existing_key}: {done:?}");
|
||||
assert_eq!(
|
||||
times_listed(&done.unbound, &device_key_info()),
|
||||
1,
|
||||
"{bound_existing_key}: {done:?}"
|
||||
);
|
||||
assert_eq!(
|
||||
times_listed(&done.removed, &device_key_info()),
|
||||
0,
|
||||
"{bound_existing_key}: {done:?}"
|
||||
);
|
||||
|
||||
let after = named_row(&db, KIND_VOELIN, &uid);
|
||||
assert!(!bound(&after), "{bound_existing_key}: unbound");
|
||||
@@ -1905,6 +1920,37 @@ fn a_device_key_that_carries_a_binding_is_unbound_and_keeps_the_rest_of_its_row(
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn a_device_key_that_carries_a_binding_is_listed_once_as_deleted_when_it_is_forgotten() {
|
||||
// The same row, named by `Forget`: the sign-out unbinds it in its loop over
|
||||
// the account's identities and deletes it after. It is listed once, as
|
||||
// deleted; VoelinProtocol before v0.2.0 also left it in `unbound`.
|
||||
for bound_existing_key in [true, false] {
|
||||
let Install { store, .. } = signed_in_install(bound_existing_key);
|
||||
let device_only = AccountBinding { synced: false, ..binding() };
|
||||
store.put(&IdentityBlob::voelin(&key()).unwrap().with_binding(device_only)).unwrap();
|
||||
|
||||
let done =
|
||||
store.sign_out(&binding().account, DeviceKeyChoice::Forget(key().uid())).unwrap();
|
||||
assert_eq!(
|
||||
times_listed(&done.removed, &device_key_info()),
|
||||
1,
|
||||
"{bound_existing_key}: {done:?}"
|
||||
);
|
||||
assert_eq!(
|
||||
times_listed(&done.unbound, &device_key_info()),
|
||||
0,
|
||||
"{bound_existing_key}: {done:?}"
|
||||
);
|
||||
assert!(store.voelin_key(&key().uid()).unwrap().is_none(), "the key is deleted");
|
||||
assert_eq!(store.account_record().unwrap(), None);
|
||||
assert_eq!(
|
||||
store.sign_out(&binding().account, DeviceKeyChoice::Auto).unwrap(),
|
||||
SignOut::default()
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn a_sign_out_scrubs_the_copies_it_deletes_and_leaves_the_kept_keys_in_the_file() {
|
||||
// What a sign-out still deletes is a synced copy (a private key, which
|
||||
|
||||
Reference in new issue
Block a user