diff --git a/app/fanout/community_mqtt.py b/app/fanout/community_mqtt.py index c9b2761..632572d 100644 --- a/app/fanout/community_mqtt.py +++ b/app/fanout/community_mqtt.py @@ -20,6 +20,7 @@ from datetime import datetime from typing import Any, Protocol import aiomqtt + from app.fanout.mqtt_base import BaseMqttPublisher from app.keystore import ed25519_sign_expanded from app.path_utils import parse_packet_envelope, split_path_hex diff --git a/app/fanout/map_upload.py b/app/fanout/map_upload.py index 2f258f2..a9af2a7 100644 --- a/app/fanout/map_upload.py +++ b/app/fanout/map_upload.py @@ -56,6 +56,7 @@ _REUPLOAD_SECONDS = 3600 # blocklist so that new roles cannot accidentally start populating the map. _ALLOWED_DEVICE_ROLES = {2, 3} + def _get_radio_params() -> dict: """Read radio frequency parameters from the connected radio's self_info. diff --git a/app/keystore.py b/app/keystore.py index 27a157c..28031e9 100644 --- a/app/keystore.py +++ b/app/keystore.py @@ -13,7 +13,6 @@ import logging from typing import TYPE_CHECKING import nacl.bindings - from meshcore import EventType from app.decoder import derive_public_key @@ -38,9 +37,7 @@ _private_key: bytes | None = None _public_key: bytes | None = None -def ed25519_sign_expanded( - message: bytes, scalar: bytes, prefix: bytes, public_key: bytes -) -> bytes: +def ed25519_sign_expanded(message: bytes, scalar: bytes, prefix: bytes, public_key: bytes) -> bytes: """Sign a message using MeshCore's expanded Ed25519 key format. MeshCore stores 64-byte keys as scalar(32) || prefix(32). Standard diff --git a/tests/test_community_mqtt.py b/tests/test_community_mqtt.py index 5cd5abb..462860d 100644 --- a/tests/test_community_mqtt.py +++ b/tests/test_community_mqtt.py @@ -23,12 +23,12 @@ from app.fanout.community_mqtt import ( _generate_jwt_token, _get_client_version, ) -from app.keystore import ed25519_sign_expanded from app.fanout.mqtt_community import ( _config_to_settings, _publish_community_packet, _render_packet_topic, ) +from app.keystore import ed25519_sign_expanded def _make_test_keys() -> tuple[bytes, bytes]: diff --git a/tests/test_fanout.py b/tests/test_fanout.py index 9c5461c..8422194 100644 --- a/tests/test_fanout.py +++ b/tests/test_fanout.py @@ -707,6 +707,7 @@ class TestSqsValidation: {"queue_url": "https://sqs.us-east-1.amazonaws.com/123456789012/mesh-events"} ) + class TestMapUploadValidation: def test_rejects_bad_api_url_scheme(self): from fastapi import HTTPException @@ -798,7 +799,6 @@ class TestMapUploadValidation: scope = _enforce_scope("map_upload", {"messages": "all", "raw_packets": "none"}) assert scope == {"messages": "none", "raw_packets": "all"} - def test_enforce_scope_sqs_preserves_raw_packets_setting(self): from app.routers.fanout import _enforce_scope diff --git a/tests/test_fanout_integration.py b/tests/test_fanout_integration.py index e520cc8..a91048e 100644 --- a/tests/test_fanout_integration.py +++ b/tests/test_fanout_integration.py @@ -1887,4 +1887,3 @@ class TestMapUploadIntegration: mock_msg.assert_not_called() await manager.stop_all() -