mirror of
https://github.com/PR0M3TH3AN/SeedPass.git
synced 2026-10-29 08:52:04 +00:00
Add agent security controls, broker auth, and capability discovery
This commit is contained in:
1 parent
1febbd4b2c
commit
fe96ccd7c7
15 files changed
+2381
-99
No files matched your search
@@ -24,9 +24,35 @@ def test_cli_vault_unlock(monkeypatch):
|
||||
result = runner.invoke(app, ["vault", "unlock"])
|
||||
assert result.exit_code == 0
|
||||
assert "Unlocked in" in result.stdout
|
||||
assert "seedpass --help" in result.stdout
|
||||
assert called["pw"] == "pw"
|
||||
|
||||
|
||||
def test_cli_vault_unlock_with_env_broker(monkeypatch):
|
||||
called = {}
|
||||
broker_called = {}
|
||||
|
||||
def unlock_vault(pw):
|
||||
called["pw"] = pw
|
||||
return 0.25
|
||||
|
||||
pm = SimpleNamespace(unlock_vault=unlock_vault, select_fingerprint=lambda fp: None)
|
||||
monkeypatch.setattr(cli_common, "PasswordManager", lambda: pm)
|
||||
monkeypatch.setattr(
|
||||
"seedpass.cli.vault.resolve_broker_password",
|
||||
lambda **kwargs: broker_called.update(kwargs) or "broker-pw",
|
||||
)
|
||||
monkeypatch.setattr(
|
||||
cli.typer,
|
||||
"prompt",
|
||||
lambda *a, **k: (_ for _ in ()).throw(AssertionError("prompt should not be called")),
|
||||
)
|
||||
result = runner.invoke(app, ["vault", "unlock", "--auth-broker", "env"])
|
||||
assert result.exit_code == 0
|
||||
assert called["pw"] == "broker-pw"
|
||||
assert broker_called["broker"] == "env"
|
||||
|
||||
|
||||
def test_cli_entry_add_search_sync(monkeypatch):
|
||||
calls = {}
|
||||
|
||||
|
||||
Reference in new issue
Block a user