feat(qr-link): add version-aware verify_qr function#1151
Open
danielle-tfh wants to merge 7 commits intomainfrom
Open
feat(qr-link): add version-aware verify_qr function#1151danielle-tfh wants to merge 7 commits intomainfrom
danielle-tfh wants to merge 7 commits intomainfrom
Conversation
Promote orb-relay-messages from dev-dependency to dependency so orb-qr-link owns the full QR decode → verify cycle. Consumers no longer need to match on version themselves.
- verify_qr now returns Result<bool, UnsupportedVersion> instead of silently returning false for unknown versions - Consolidate version constants: encode.rs reuses QR_VERSION_4/5 from lib.rs instead of maintaining separate ASCII constants - Gate verify_qr, AppAuthenticatedData re-export, and orb-relay-messages dep behind a new `verify` feature (included in default) - Bump rust-version to 1.88.0 to match orb-relay-messages MSRV - Add cross-version rejection test through verify_qr
Drop the separate `verify` feature — verify_qr and AppAuthenticatedData are gated behind `decode` instead, since anyone decoding will verify. Extract verify logic into src/verify.rs to match decode/encode structure.
verify_qr consumes the (version, hash) output of decode_qr_with_version so they belong together. Use thiserror for UnsupportedVersion to reduce boilerplate. Remove the separate verify.rs module.
…ify_qr Callers no longer need to care about QR versions. The new decode_and_verify_qr(qr, app_data) handles version dispatch internally and returns (Uuid, bool). Make decode_qr_with_version private, remove verify_qr and UnsupportedVersion from the public API, and demote the version constants to pub(crate).
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.
Promote
orb-relay-messagesfrom dev-dep to dep (behind thedecodefeature) soorb-qr-linkowns the full decode → verify cycle.Adds
decode_and_verify_qr(qr, app_data) -> Result<(Uuid, bool), DecodeError>which decodes the QR string and verifies the hash in one step. Version dispatch (v4 legacy BLAKE3 vs v5 length-prefixed) is handled internally — callers don't need to know about versions.Also consolidates the version constants (encode.rs no longer maintains its own), bumps
orb-relay-messagesrev tod5cf1e46, and bumps MSRV to 1.88.0.