aboutsummaryrefslogtreecommitdiffstats
path: root/packages/meshbay-hub/tests/test_revocation.py
diff options
context:
space:
mode:
authorChristophe Besson <cbesson@gmail.com>2026-09-15 02:16:39 +0200
committerChristophe Besson <cbesson@gmail.com>2026-09-15 02:21:01 +0200
commitbdefcd025604f2c3009fe5e0cc01213c2ba62a6a (patch)
treeeebd34aa234a9148045ca25b00bf7c8039e00ccf /packages/meshbay-hub/tests/test_revocation.py
parent027e7d55f3bb57ba5150fd77e8f0114a0baf8d5c (diff)
downloadmeshbay-bdefcd025604f2c3009fe5e0cc01213c2ba62a6a.tar.gz
feat(hub): usernames are at least 8 characters at registration
Existing shorter accounts keep signing in. Test usernames padded to match. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XuNrwLf5EFWCMHzfoEvnpm
Diffstat (limited to 'packages/meshbay-hub/tests/test_revocation.py')
-rw-r--r--packages/meshbay-hub/tests/test_revocation.py18
1 files changed, 9 insertions, 9 deletions
diff --git a/packages/meshbay-hub/tests/test_revocation.py b/packages/meshbay-hub/tests/test_revocation.py
index d1147e1..ad9caf4 100644
--- a/packages/meshbay-hub/tests/test_revocation.py
+++ b/packages/meshbay-hub/tests/test_revocation.py
@@ -33,7 +33,7 @@ async def test_revoke_user_marks_db(client):
pk_x = pk_to_b64(sk_x.public_key())
r = await client.post("/v1/users/register", json={
- "username": "vic1", "email": "v@t.com", "password": "vicpass99",
+ "username": "vic1_test", "email": "v@t.com", "password": "vicpass99",
"pk_user_ed25519": pk_ed, "pk_user_x25519": pk_x,
})
victim_id = r.json()["user_id"]
@@ -42,11 +42,11 @@ async def test_revoke_user_marks_db(client):
sk_admin_ed = Ed25519PrivateKey.generate()
sk_admin_x = X25519PrivateKey.generate()
admin_token, _ = await _register_and_login(
- client, "admin1",
+ client, "admin1_test",
pk_to_b64(sk_admin_ed.public_key()),
pk_to_b64(sk_admin_x.public_key()),
)
- set_admin_usernames(["admin1"])
+ set_admin_usernames(["admin1_test"])
r = await client.post("/v1/admin/revoke", json={
"target": "user", "target_id": victim_id, "reason": "spam",
@@ -58,7 +58,7 @@ async def test_revoke_user_marks_db(client):
# Victim can no longer login
r = await client.post("/v1/users/login", json={
- "username": "vic1", "password": "vicpass99"})
+ "username": "vic1_test", "password": "vicpass99"})
assert r.status_code == 403
@@ -69,7 +69,7 @@ async def test_revocation_token_verifiable_offline(client):
sk_x = X25519PrivateKey.generate()
r = await client.post("/v1/users/register", json={
- "username": "vic2", "email": "v2@t.com", "password": "vicpass99",
+ "username": "vic2_test", "email": "v2@t.com", "password": "vicpass99",
"pk_user_ed25519": pk_to_b64(sk_ed.public_key()),
"pk_user_x25519": pk_to_b64(sk_x.public_key()),
})
@@ -78,11 +78,11 @@ async def test_revocation_token_verifiable_offline(client):
sk_admin_ed = Ed25519PrivateKey.generate()
sk_admin_x = X25519PrivateKey.generate()
admin_token, _ = await _register_and_login(
- client, "admin2",
+ client, "admin2_test",
pk_to_b64(sk_admin_ed.public_key()),
pk_to_b64(sk_admin_x.public_key()),
)
- set_admin_usernames(["admin2"])
+ set_admin_usernames(["admin2_test"])
r = await client.post("/v1/admin/revoke", json={
"target": "user", "target_id": victim_id, "reason": "test",
@@ -106,11 +106,11 @@ async def test_revoke_group(client):
sk_ed = Ed25519PrivateKey.generate()
sk_x = X25519PrivateKey.generate()
admin_token, _ = await _register_and_login(
- client, "admin3",
+ client, "admin3_test",
pk_to_b64(sk_ed.public_key()),
pk_to_b64(sk_x.public_key()),
)
- set_admin_usernames(["admin3"])
+ set_admin_usernames(["admin3_test"])
hdrs = {"Authorization": f"Bearer {admin_token}"}
r = await client.post("/v1/groups", json={"name": "grp-to-revoke"}, headers=hdrs)