aboutsummaryrefslogtreecommitdiffstats
path: root/packages/meshbay-hub/tests/test_revocation.py
diff options
context:
space:
mode:
Diffstat (limited to 'packages/meshbay-hub/tests/test_revocation.py')
-rw-r--r--packages/meshbay-hub/tests/test_revocation.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/packages/meshbay-hub/tests/test_revocation.py b/packages/meshbay-hub/tests/test_revocation.py
index f5d6050..494d77d 100644
--- a/packages/meshbay-hub/tests/test_revocation.py
+++ b/packages/meshbay-hub/tests/test_revocation.py
@@ -7,6 +7,7 @@ from cryptography.hazmat.primitives.asymmetric.ed25519 import Ed25519PrivateKey
from cryptography.hazmat.primitives.asymmetric.x25519 import X25519PrivateKey
from meshbay_common.crypto import pk_to_b64
+from meshbay_hub.api.deps import set_admin_usernames
async def _register_and_login(client, username, pk_ed, pk_x):
@@ -45,6 +46,7 @@ async def test_revoke_user_marks_db(client):
pk_to_b64(sk_admin_ed.public_key()),
pk_to_b64(sk_admin_x.public_key()),
)
+ set_admin_usernames(["admin1"])
r = await client.post("/v1/admin/revoke", json={
"target": "user", "target_id": victim_id, "reason": "spam",
@@ -80,6 +82,7 @@ async def test_revocation_token_verifiable_offline(client):
pk_to_b64(sk_admin_ed.public_key()),
pk_to_b64(sk_admin_x.public_key()),
)
+ set_admin_usernames(["admin2"])
r = await client.post("/v1/admin/revoke", json={
"target": "user", "target_id": victim_id, "reason": "test",
@@ -107,6 +110,7 @@ async def test_revoke_group(client):
pk_to_b64(sk_ed.public_key()),
pk_to_b64(sk_x.public_key()),
)
+ set_admin_usernames(["admin3"])
hdrs = {"Authorization": f"Bearer {admin_token}"}
r = await client.post("/v1/groups", json={"name": "grp-to-revoke"}, headers=hdrs)