Return the secret sentinel for remote admin config gets - #11093
Conversation
writeSecret is a setter, so calling it on the NETWORK_CONFIG get path was a no-op: the buffer already holds the stored psk, never the sentinel. MQTT_CONFIG returned the broker password verbatim. Both get paths now return secretReserved when req.from != 0, and the matching set paths call writeSecret so a read-modify-write round trip keeps the stored value.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
📝 WalkthroughWalkthroughAdds reserved-placeholder handling for WiFi and MQTT credentials. Configuration updates preserve stored secrets when given ChangesCredential protection
Estimated code review effort: 3 (Moderate) | ~20 minutes Possibly related PRs
Suggested labels: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
⚡ Try this PR in the Web FlasherWarning This is an automated, unreviewed CI test build. Back up your device configuration Supported boards built by this PR (30)
Build artifacts expire on 2026-08-19. Updated for |
writeSecretis a setter: it swaps in the stored value only when the buffer holds thesekritsentinel. On theNETWORK_CONFIGget path the buffer already holds the stored psk, so the call was a no-op.MQTT_CONFIGreturnedmoduleConfig.mqtt.passwordverbatim.Both get paths now return
secretReservedwhenreq.from != 0, matching the existingSECURITY_CONFIGhandling. The sentinel rather than an empty string, because the set paths are wholesale struct copies with no preservation of the previous value, so a client that gets and writes back would otherwise clear the stored secret. Both set paths now callwriteSecretto complete that round trip.Tests in
test_admin_session_repro: remote and local gets forwifi_pskandmqtt.password, plus a set-path round trip.handleGetModuleConfigadded toAdminModuleTestShim.20/20 on
native-windows.Summary by CodeRabbit