From 1263e71d31b7d7a93e03f9023b3aa550f1605c46 Mon Sep 17 00:00:00 2001 From: agessaman Date: Mon, 30 Mar 2026 21:44:05 -0700 Subject: [PATCH] Enhance MQTT implementation by adding support for JWT audience configuration in custom slots. Update MQTTBridge and CommonCLI to handle audience settings, enabling JWT authentication for custom brokers. Modify documentation to reflect changes in command usage and provide examples for custom broker setup with JWT authentication. --- MQTT_IMPLEMENTATION.md | 25 ++++++++++++- src/helpers/CommonCLI.cpp | 23 ++++++++++++ src/helpers/CommonCLI.h | 2 ++ src/helpers/MQTTPresets.h | 2 +- src/helpers/bridges/MQTTBridge.cpp | 56 ++++++++++++++++++++++-------- src/helpers/bridges/MQTTBridge.h | 3 +- 6 files changed, 93 insertions(+), 18 deletions(-) diff --git a/MQTT_IMPLEMENTATION.md b/MQTT_IMPLEMENTATION.md index 5f32a3ef4..b0b6a33f0 100644 --- a/MQTT_IMPLEMENTATION.md +++ b/MQTT_IMPLEMENTATION.md @@ -102,7 +102,7 @@ The MQTT bridge uses a slot-based architecture with up to 6 concurrent connectio | `meshrank` | meshrank.net:8883 | None (token in topic) | MQTT over TLS | | `waev` | mqtt.waev.app:443 | JWT (Ed25519) | WSS | | `meshomatic` | us-east.meshomatic.net:443 | JWT (Ed25519) | WSS | -| `cascadiamesh` | cascadiamesh.ddns.net:1883 | None | MQTT (unencrypted) | +| `cascadiamesh` | mqtt-v1.cascadiamesh.org:443 | JWT (Ed25519) | WSS | | `custom` | User-configured | Username/Password | MQTT or WSS | | `none` | (disabled) | — | — | @@ -218,6 +218,7 @@ Each slot (1-6) supports the following commands: - `get mqttN.password` - Get custom password for slot N - `get mqttN.token` - Get per-slot token (e.g., MeshRank account token) - `get mqttN.topic` - Get custom topic template for slot N +- `get mqttN.audience` - Get JWT audience for slot N (custom slots only) #### Set Commands - `set mqttN.preset analyzer-us` - Set slot N to LetsMesh Analyzer US @@ -235,6 +236,8 @@ Each slot (1-6) supports the following commands: - `set mqttN.password ` - Set custom password for slot N - `set mqttN.token ` - Set per-slot token (required for MeshRank preset) - `set mqttN.topic