refactor: use shared ServiceLink blueprint

- Replace the local /rpc Quart route with the shared ServiceLink blueprint helper.
- Move mesh scope enforcement into bearer_verifier via require_scope.
- Update ServiceLink tests to call the public handle_envelope and verify exports.
- Advance the servicelink submodule to include the shared CLI and RPC discovery work.
This commit is contained in:
2026-06-14 00:32:27 +02:00
parent 1dbf3b36ff
commit ca85dc2265
3 changed files with 14 additions and 42 deletions
+3 -3
View File
@@ -9,7 +9,7 @@ sys.path.insert(0, str(Path(__file__).resolve().parents[1]))
from quart import Quart
from servicelink import Request
from servicelink import Request, handle_envelope
# Load routes/api/link.py in isolation. Importing it as `routes.api.link` would
# run routes/__init__.py -> my_modules.app.setup -> constens (asyncio.run at
@@ -63,11 +63,11 @@ def _call(envelope, token=None):
app = Quart(__name__)
app.convex = FakeConvex()
async with app.test_request_context('/rpc', method='POST'):
status, body, _ = await link.handle_envelope(
status, body, _ = await handle_envelope(
link.router,
json.dumps(envelope).encode('utf-8'),
authorization=f'Bearer {token}' if token else None,
verify=link._verify,
verify=link.verify,
content_type='application/json',
)
return status, json.loads(body)