Repository navigation
Handle signed firmware device-info uploads and diagnose discarded metadata - #153
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Firmware POST /devices/{did}/info currently falls through to the generic acknowledgement, so its serial and feature metadata is discarded. Add a dedicated handler that retains verified metadata for existing inventory devices while preserving the complete acknowledgement body and device identities, names, product IDs and keys.
The handler verifies the fixed five-field form against the recovered device RSA public key (PKCS#1 v1.5 / SHA-256), checks path/body DID agreement and retains conservative field validation. All three persisted Qrevo MaxV uploads verified under this contract. G10S firmware inspection confirms that its upload callback accepts HTTP 200/201 and ignores response data; evidence and model limits are documented.
Sanitized logs distinguish stored, unchanged, unmatched, validation/authentication rejection and write failure using only DID, outcome and updated-record count. Inventory updates use the transaction and atomic persistence API from #152, whose commit is included as a dependency. Merge #152 first.
Validation: 58 focused storage, device-info, firmware, admin and home tests passed; git diff --check passed. Tests cover signature tampering, duplicate fields, unknown keys/devices, identity preservation, idempotence, diagnostic privacy and a real HTTP form with URL-escaped base64 + and / signatures, including the Roborock path prefix.
Limitations: acknowledgement may suppress future uploads when a key or inventory link is missing; captured signed reports are replayable; existing cloud snapshot precedence remains. No HA deployment changes.