Enhance CommonCLI and JWTHelper for MQTT owner public key support

- Added functionality to load, save, and handle the MQTT owner public key in CommonCLI.
- Implemented validation for the owner public key format and updated command handling to set the key.
- Modified JWTHelper to include optional owner and client fields in JWT token creation.
- Increased buffer sizes for JWT tokens in MQTTBridge to accommodate new fields.
This commit is contained in:
agessaman committed 2026-01-02 13:36:41 -08:00
1 parent e4ff06cbfd
commit e5dbd56b5d
7 files changed
+296 -14

No files matched your search

+12
View File
@@ -757,6 +757,18 @@ void MyMesh::begin(FILESYSTEM *fs) {
_fs = fs;
// load persisted prefs
_cli.loadPrefs(_fs);
// Ensure analyzer servers are enabled by default (in case no prefs were loaded)
if (_prefs.mqtt_analyzer_us_enabled == 0 && _prefs.mqtt_analyzer_eu_enabled == 0) {
_prefs.mqtt_analyzer_us_enabled = 1; // enabled
_prefs.mqtt_analyzer_eu_enabled = 1; // enabled
MESH_DEBUG_PRINTLN("Setting analyzer servers to enabled by default");
}
// Set MQTT origin to actual device name (not build-time ADVERT_NAME)
StrHelper::strncpy(_prefs.mqtt_origin, _prefs.node_name, sizeof(_prefs.mqtt_origin));
MESH_DEBUG_PRINTLN("MQTT origin set to device name: %s", _prefs.mqtt_origin);
acl.load(_fs);
// TODO: key_store.begin();
region_map.load(_fs);