fix: handle real ProofMode bundles (iOS + Android)#1
Open
Conversation
Real ProofMode bundles from Android/iOS use writeMapToCSV which outputs headers on the first row and values on the second, not the vertical key-value format the parser assumed. Auto-detect the format by counting columns and zip headers with values.
Add .devicecheck handling for iOS DeviceCheck attestations, skip .txt documentation files, and match media files by known extensions instead of a catch-all that misidentified non-media files.
iOS ProofMode uses space-separated names like "Wifi MAC" and "File Hash SHA256" instead of dot-separated. Add aliases so these normalize to the canonical form.
The service Zod schema validates SRS as a URL. CRS84 is the correct OGC identifier for WGS84 longitude-latitude order which matches our GeoJSON coordinate layout.
Cover the real-world formats: horizontal header+data CSV parsing, iOS DeviceCheck attestation extraction, .txt file skipping, and signal name alias normalization.
Add .tiff, .tif, .avif to media allowlist for professional cameras. Add 2016-era ProofMode field aliases (CurrentDateTime0GMT, SHA256, File, Modified, etc.) to support older sample bundles.
Tests parse real ProofMode bundles through the full pipeline: - iOS bundle: horizontal CSV, DeviceCheck, OTS, PGP key, media - 2016 Android sample: legacy field aliases, no GPS data Private bundles are gitignored. The 2016 sample ZIP is from the public proofmode-android/samples/ directory.
ProofModePlugin now implements sign(stamp, signer) using the StampSigner abstraction, matching MockPlugin and WitnessChain. Signer is required since this plugin doesn't manage keys. createStampFromBundle now carries PGP.PublicKey and PGP.MetadataSignature (base64) in signals as provenance evidence, not just the HasPGPKey boolean.
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.
Summary
writeMapToCSV) while preserving vertical key-value compat.devicecheck(iOS DeviceCheck attestation), skips.txtdocumentation files, matches media by known extensions instead of catch-all that misidentified non-media filesWifi MAC,DeviceID Vendor,File Path,File Hash SHA256,File Modified,Proof Generated) and 2016-era legacy names (CurrentDateTime0GMT,SHA256, etc.)EPSG:4326→http://www.opengis.net/def/crs/OGC/1.3/CRS84(service Zod schema requires URL).tiff,.tif,.aviffor professional camerasTest plan