aboutsummaryrefslogtreecommitdiffstats
path: root/packages/meshbay-node/tests/test_hub_client.py
diff options
context:
space:
mode:
Diffstat (limited to 'packages/meshbay-node/tests/test_hub_client.py')
-rw-r--r--packages/meshbay-node/tests/test_hub_client.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/packages/meshbay-node/tests/test_hub_client.py b/packages/meshbay-node/tests/test_hub_client.py
index e733610..95c93c7 100644
--- a/packages/meshbay-node/tests/test_hub_client.py
+++ b/packages/meshbay-node/tests/test_hub_client.py
@@ -10,6 +10,7 @@ import pytest
from cryptography.hazmat.primitives import serialization
from cryptography.hazmat.primitives.asymmetric.ed25519 import Ed25519PrivateKey
from cryptography.hazmat.primitives.asymmetric.x25519 import X25519PrivateKey
+from meshbay_common.tokens import HUB_API_AUD
from meshbay_node.hub_client import HubClient, HubConfig
from meshbay_node.keystore import NodeKeys
@@ -52,7 +53,7 @@ def make_node_token(sk_pem, user_id, pk_user_b64, hub_id="fake-hub", ttl=3600):
return jwt.encode({
"iss": hub_id, "sub": user_id, "pk_user": pk_user_b64,
"hub_id": hub_id, "jti": "test-jti", "scope": "node",
- "iat": now, "exp": now + ttl,
+ "iat": now, "exp": now + ttl, "aud": HUB_API_AUD,
}, sk_pem, algorithm="EdDSA")
@@ -89,7 +90,7 @@ async def test_login_rejects_missing_jti(hub_keys, node_keys, hub_config):
sk_hub, sk_hub_pem, pk_hub_pem = hub_keys
bad_token = jwt.encode({
"iss": "fake-hub", "sub": "uid", "pk_user": node_keys.pk_ed25519_b64,
- "hub_id": "fake-hub", "scope": "node",
+ "hub_id": "fake-hub", "scope": "node", "aud": HUB_API_AUD,
"iat": int(time.time()), "exp": int(time.time()) + 3600,
}, sk_hub_pem, algorithm="EdDSA")