Share the saved admin password across ESP32 management services
Use the committed node credential for setup WiFi, WebConfig and browser OTA. Add persistent ESP32 WiFi Companion management credentials without changing preferences layouts, revoke stale browser sessions on rotation, retain scoped save receipts, and coordinate credential changes with flash uploads. Keep external-service credentials and trusted TCP protocol compatibility independent. Update live join QR codes, failure handling and documentation. Validated 51 native cases, 158 related host and browser methods, and serial Full V4 Companion, Station G3 Repeater, ESP32-C6 Room Server and V4 Sensor firmware builds.
This commit is contained in:
1 parent
a6a3cb5ebc
commit
cd02e55824
58 files changed
+5749
-2439
No files matched your search
@@ -41,6 +41,7 @@ static std::atomic<bool> ota_upload_busy{false};"""
|
||||
rx=tcp[tcp.index(" // RX Timeout"):tcp.index(" // Everything is fine")]
|
||||
return (fixture.replace("@REBOOT_STATE@",state)
|
||||
.replace("@UPLOAD_STATE@",extract_braced(source,"struct OtaUploadState")+";")
|
||||
.replace("@AUTH@",extract_braced(source,"bool AsyncElegantOtaClass::authenticateRequest("))
|
||||
.replace("@BEGIN@",begin)
|
||||
.replace("@RESTART@",extract_braced(source,"void AsyncElegantOtaClass::restart()"))
|
||||
.replace("@ACCEPT_TIMEOUT@",accept).replace("@RX_TIMEOUT@",rx))
|
||||
@@ -68,6 +69,17 @@ static std::atomic<bool> ota_upload_busy{false};"""
|
||||
with self.assertRaises(AssertionError):
|
||||
self.compile_and_run(old,"-DESP32=1","-DTEST_OTA_BODY_TIMEOUT=1")
|
||||
|
||||
def test_management_auth_precedes_all_routes_and_upload_side_effects(self):
|
||||
fixture = self.uploader_fixture()
|
||||
self.compile_and_run(fixture, "-DESP32=1", "-DTEST_OTA_MANAGEMENT_PASSWORD=1")
|
||||
# Exercise the actual chunk gate: omitting authentication must admit a
|
||||
# wrong password and fail the zero-flash-effects assertion above.
|
||||
gate = " if (!authenticateRequest(request, &authenticated_generation)) return;"
|
||||
old = fixture.replace(gate, " authenticated_generation = mesh::esp32::managementPassword::detail::state().current.generation;")
|
||||
self.assertNotEqual(old, fixture)
|
||||
with self.assertRaises(AssertionError):
|
||||
self.compile_and_run(old, "-DESP32=1", "-DTEST_OTA_MANAGEMENT_PASSWORD=1")
|
||||
|
||||
def premature_commit_fixture(self, fixture):
|
||||
commit=extract_braced(fixture,"if (state && state->file_final")
|
||||
end=extract_braced(commit,"if (!Update.end(true))")
|
||||
|
||||
Reference in new issue
Block a user