Add archived flag to entries

This commit is contained in:
thePR0M3TH3AN
2025-07-07 10:11:13 -04:00
parent 7e122367a3
commit eace2d95c5
8 changed files with 56 additions and 23 deletions

View File

@@ -34,7 +34,7 @@ def test_add_and_retrieve_entry():
"length": 12,
"username": "user",
"url": "",
"blacklisted": False,
"archived": False,
"type": "password",
"kind": "password",
"notes": "",

View File

@@ -63,5 +63,6 @@ def test_handle_add_totp(monkeypatch, capsys):
"index": 0,
"period": 30,
"digits": 6,
"archived": False,
}
assert "ID 0" in out

View File

@@ -61,7 +61,7 @@ def test_handle_display_totp_codes(monkeypatch, capsys):
assert "123456" in out
def test_display_totp_codes_excludes_blacklisted(monkeypatch, capsys):
def test_display_totp_codes_excludes_archived(monkeypatch, capsys):
with TemporaryDirectory() as tmpdir:
tmp_path = Path(tmpdir)
vault, enc_mgr = create_vault(tmp_path, TEST_SEED, TEST_PASSWORD)
@@ -83,7 +83,7 @@ def test_display_totp_codes_excludes_blacklisted(monkeypatch, capsys):
entry_mgr.add_totp("Visible", TEST_SEED)
entry_mgr.add_totp("Hidden", TEST_SEED)
entry_mgr.modify_entry(1, blacklisted=True)
entry_mgr.modify_entry(1, archived=True)
monkeypatch.setattr(pm.entry_manager, "get_totp_code", lambda *a, **k: "123456")
monkeypatch.setattr(

View File

@@ -30,6 +30,7 @@ def test_nostr_key_determinism():
"index": idx,
"label": "main",
"notes": "",
"archived": False,
}
npub1, nsec1 = entry_mgr.get_nostr_key_pair(idx, TEST_SEED)

View File

@@ -28,6 +28,7 @@ def test_add_and_retrieve_ssh_key_pair():
"index": index,
"label": "ssh",
"notes": "",
"archived": False,
}
priv1, pub1 = entry_mgr.get_ssh_key_pair(index, TEST_SEED)

View File

@@ -35,6 +35,7 @@ def test_add_totp_and_get_code():
"index": 0,
"period": 30,
"digits": 6,
"archived": False,
}
code = entry_mgr.get_totp_code(0, TEST_SEED, timestamp=0)
@@ -72,6 +73,7 @@ def test_add_totp_imported(tmp_path):
"secret": secret,
"period": 30,
"digits": 6,
"archived": False,
}
code = em.get_totp_code(0, timestamp=0)
assert code == pyotp.TOTP(secret).at(0)