test descriptions
This commit is contained in:
@@ -35,6 +35,7 @@ def _sign(priv, api_key: str, wallet: str) -> str:
|
||||
|
||||
|
||||
def test_verify_wallet_signature_accepts_valid_and_rejects_forged():
|
||||
"Verify wallet signature accepts valid and rejects forged\n\nTags: auth, security, wallet"
|
||||
priv, wallet = _keypair()
|
||||
other_priv, _ = _keypair()
|
||||
message = binding_message("client-key-1", wallet)
|
||||
@@ -49,6 +50,7 @@ def test_verify_wallet_signature_accepts_valid_and_rejects_forged():
|
||||
|
||||
|
||||
def test_bind_wallet_rejects_conflicting_rebind_without_admin_override():
|
||||
"Bind wallet rejects conflicting rebind without admin override\n\nTags: auth, security, wallet"
|
||||
ledger = BillingLedger(starting_credit=0.0)
|
||||
ledger.bind_wallet("key-1", "WalletA")
|
||||
assert ledger.api_key_for_wallet("WalletA") == "key-1"
|
||||
@@ -63,7 +65,8 @@ def test_bind_wallet_rejects_conflicting_rebind_without_admin_override():
|
||||
|
||||
|
||||
def test_gossip_bind_event_cannot_overwrite_existing_binding():
|
||||
"""A conflicting `bind` event applied via gossip must not clobber."""
|
||||
"A conflicting `bind` event applied via gossip must not clobber.\n\nTags: auth, gossip, network, security, wallet"
|
||||
|
||||
leader = BillingLedger(starting_credit=0.0)
|
||||
leader.bind_wallet("key-1", "WalletA")
|
||||
|
||||
@@ -101,6 +104,7 @@ def tracker():
|
||||
|
||||
|
||||
def test_bind_without_signature_is_rejected(tracker):
|
||||
"Bind without signature is rejected\n\nTags: auth, security, wallet"
|
||||
url, ledger = tracker
|
||||
_, wallet = _keypair()
|
||||
with pytest.raises(urllib.error.HTTPError) as exc_info:
|
||||
@@ -114,6 +118,7 @@ def test_bind_without_signature_is_rejected(tracker):
|
||||
|
||||
|
||||
def test_bind_with_forged_signature_is_rejected(tracker):
|
||||
"Bind with forged signature is rejected\n\nTags: auth, security, wallet"
|
||||
url, ledger = tracker
|
||||
priv, wallet = _keypair()
|
||||
forger_priv, _ = _keypair()
|
||||
@@ -128,6 +133,7 @@ def test_bind_with_forged_signature_is_rejected(tracker):
|
||||
|
||||
|
||||
def test_valid_signature_binds_wallet(tracker):
|
||||
"Valid signature binds wallet\n\nTags: auth, security, wallet"
|
||||
url, ledger = tracker
|
||||
priv, wallet = _keypair()
|
||||
reply = _post_json(
|
||||
@@ -140,6 +146,7 @@ def test_valid_signature_binds_wallet(tracker):
|
||||
|
||||
|
||||
def test_second_key_cannot_steal_bound_wallet(tracker):
|
||||
"Second key cannot steal bound wallet\n\nTags: auth, security, wallet"
|
||||
url, ledger = tracker
|
||||
priv, wallet = _keypair()
|
||||
_post_json(
|
||||
@@ -161,6 +168,7 @@ def test_second_key_cannot_steal_bound_wallet(tracker):
|
||||
|
||||
|
||||
def test_admin_session_can_force_rebind(tracker):
|
||||
"Admin session can force rebind\n\nTags: auth, security, wallet"
|
||||
url, ledger = tracker
|
||||
priv, wallet = _keypair()
|
||||
_post_json(
|
||||
|
||||
Reference in New Issue
Block a user