Remove deprecated website field

This commit is contained in:
thePR0M3TH3AN
2025-07-05 10:00:46 -04:00
parent 8a8bd0ada5
commit bacf32b46e
16 changed files with 123 additions and 68 deletions

View File

@@ -25,7 +25,7 @@ def test_backup_restore_workflow(monkeypatch):
"schema_version": 3,
"entries": {
"0": {
"website": "a",
"label": "a",
"length": 10,
"type": "password",
"kind": "password",
@@ -48,7 +48,7 @@ def test_backup_restore_workflow(monkeypatch):
"schema_version": 3,
"entries": {
"0": {
"website": "b",
"label": "b",
"length": 12,
"type": "password",
"kind": "password",

View File

@@ -30,7 +30,7 @@ def test_add_and_retrieve_entry():
entry = entry_mgr.retrieve_entry(index)
assert entry == {
"website": "example.com",
"label": "example.com",
"length": 12,
"username": "user",
"url": "",
@@ -69,9 +69,9 @@ def test_round_trip_entry_types(method, expected_type):
index = 0
else:
if method == "add_ssh_key":
index = entry_mgr.add_ssh_key(TEST_SEED)
index = entry_mgr.add_ssh_key("ssh", TEST_SEED)
elif method == "add_seed":
index = entry_mgr.add_seed(TEST_SEED)
index = entry_mgr.add_seed("seed", TEST_SEED)
else:
index = getattr(entry_mgr, method)()

View File

@@ -34,7 +34,7 @@ def test_index_export_import_round_trip():
"schema_version": 3,
"entries": {
"0": {
"website": "example",
"label": "example",
"type": "password",
"notes": "",
"custom_fields": [],
@@ -52,7 +52,7 @@ def test_index_export_import_round_trip():
"schema_version": 3,
"entries": {
"0": {
"website": "changed",
"label": "changed",
"type": "password",
"notes": "",
"custom_fields": [],

View File

@@ -20,7 +20,7 @@ def test_migrate_v0_to_v3(tmp_path: Path):
data = vault.load_index()
assert data["schema_version"] == LATEST_VERSION
expected_entry = {
"website": "a",
"label": "a",
"length": 8,
"type": "password",
"notes": "",
@@ -37,7 +37,7 @@ def test_migrate_v1_to_v3(tmp_path: Path):
data = vault.load_index()
assert data["schema_version"] == LATEST_VERSION
expected_entry = {
"website": "b",
"label": "b",
"length": 10,
"type": "password",
"notes": "",
@@ -59,7 +59,7 @@ def test_migrate_v2_to_v3(tmp_path: Path):
data = vault.load_index()
assert data["schema_version"] == LATEST_VERSION
expected_entry = {
"website": "c",
"label": "c",
"length": 5,
"type": "password",
"notes": "",

View File

@@ -58,7 +58,7 @@ def test_nostr_index_size_limits(pytestconfig: pytest.Config):
if max_entries is not None and entry_count >= max_entries:
break
entry_mgr.add_entry(
website_name=f"site-{entry_count + 1}",
label=f"site-{entry_count + 1}",
length=12,
username="u" * size,
url="https://example.com/" + "a" * size,

View File

@@ -19,7 +19,9 @@ def test_pgp_key_determinism():
backup_mgr = BackupManager(tmp_path, cfg_mgr)
entry_mgr = EntryManager(vault, backup_mgr)
idx = entry_mgr.add_pgp_key(TEST_SEED, key_type="ed25519", user_id="Test")
idx = entry_mgr.add_pgp_key(
"pgp", TEST_SEED, key_type="ed25519", user_id="Test"
)
key1, fp1 = entry_mgr.get_pgp_key(idx, TEST_SEED)
key2, fp2 = entry_mgr.get_pgp_key(idx, TEST_SEED)

View File

@@ -23,8 +23,8 @@ def test_seed_phrase_determinism():
backup_mgr = BackupManager(tmp_path, cfg_mgr)
entry_mgr = EntryManager(vault, backup_mgr)
idx_12 = entry_mgr.add_seed(TEST_SEED, words_num=12)
idx_24 = entry_mgr.add_seed(TEST_SEED, words_num=24)
idx_12 = entry_mgr.add_seed("seed12", TEST_SEED, words_num=12)
idx_24 = entry_mgr.add_seed("seed24", TEST_SEED, words_num=24)
phrase12_a = entry_mgr.get_seed_phrase(idx_12, TEST_SEED)
phrase12_b = entry_mgr.get_seed_phrase(idx_12, TEST_SEED)

View File

@@ -20,9 +20,15 @@ def test_add_and_retrieve_ssh_key_pair():
backup_mgr = BackupManager(tmp_path, cfg_mgr)
entry_mgr = EntryManager(vault, backup_mgr)
index = entry_mgr.add_ssh_key(TEST_SEED)
index = entry_mgr.add_ssh_key("ssh", TEST_SEED)
entry = entry_mgr.retrieve_entry(index)
assert entry == {"type": "ssh", "kind": "ssh", "index": index, "notes": ""}
assert entry == {
"type": "ssh",
"kind": "ssh",
"index": index,
"label": "ssh",
"notes": "",
}
priv1, pub1 = entry_mgr.get_ssh_key_pair(index, TEST_SEED)
priv2, pub2 = entry_mgr.get_ssh_key_pair(index, TEST_SEED)

View File

@@ -21,7 +21,7 @@ def test_ssh_private_key_corresponds_to_public():
backup_mgr = BackupManager(tmp_path, cfg_mgr)
entry_mgr = EntryManager(vault, backup_mgr)
idx = entry_mgr.add_ssh_key(TEST_SEED)
idx = entry_mgr.add_ssh_key("ssh", TEST_SEED)
priv_pem, pub_pem = entry_mgr.get_ssh_key_pair(idx, TEST_SEED)
priv_key = serialization.load_pem_private_key(