From 49df948de25d28601469e9ca993f33530989ebd0 Mon Sep 17 00:00:00 2001 From: salmonik Date: Thu, 29 Oct 2026 22:55:49 +0100 Subject: v3.0.0: cursor-driven roulette felt with splits and corners; drop schema migrations; require 80x24 --- tests/storage.rs | 49 ------------------------------------------------- 1 file changed, 49 deletions(-) (limited to 'tests/storage.rs') diff --git a/tests/storage.rs b/tests/storage.rs index 19936c2..e6ad2d1 100644 --- a/tests/storage.rs +++ b/tests/storage.rs @@ -88,55 +88,6 @@ fn forgetting_one_address_keeps_the_shared_credentials() { assert_eq!(client_database::get_credentials(&conn, "server-a"), None); } -#[test] -fn legacy_host_keyed_credentials_are_rekeyed_by_fingerprint() { - let (_, conn) = tmp_db("creds-migrate"); - conn.execute_batch( - "CREATE TABLE hosts ( - host TEXT PRIMARY KEY, - last_used DATETIME DEFAULT CURRENT_TIMESTAMP, - fingerprint TEXT - ); - CREATE TABLE credentials ( - host TEXT PRIMARY KEY, - username TEXT NOT NULL, - password TEXT NOT NULL - ); - INSERT INTO hosts (host, last_used, fingerprint) - VALUES ('a:1', '2020-01-01 00:00:00', 'server-a'); - INSERT INTO hosts (host, last_used, fingerprint) - VALUES ('b:2', '2021-01-01 00:00:00', 'server-a'); - INSERT INTO hosts (host, last_used, fingerprint) - VALUES ('c:3', '2022-01-01 00:00:00', NULL); - INSERT INTO credentials VALUES ('a:1', 'alice', 'old'); - INSERT INTO credentials VALUES ('b:2', 'alice', 'recent'); - INSERT INTO credentials VALUES ('c:3', 'carol', 'untrusted');", - ) - .unwrap(); - - client_database::init_db(&conn); - - assert_eq!( - client_database::get_credentials(&conn, "server-a"), - Some(("alice".to_string(), "recent".to_string())), - "the most recently used address wins when legacy rows disagree" - ); - assert_eq!( - client_database::get_credentials(&conn, "carol"), - None, - "a host with no trusted key cannot be re-keyed" - ); - - // The old table is gone: the column set is the fingerprint schema. - let mut statement = conn.prepare("PRAGMA table_info(credentials)").unwrap(); - let columns: Vec = statement - .query_map([], |row| row.get(1)) - .unwrap() - .filter_map(|row| row.ok()) - .collect(); - assert_eq!(columns, vec!["fingerprint", "username", "password"]); -} - #[test] fn client_last_host_tracking() { let (_, conn) = tmp_db("hosts"); -- cgit v1.2.3