-
Notifications
You must be signed in to change notification settings - Fork 0
feat(rust/signed-doc): Implement new Catalyst Signed Doc #338
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
bkioshn
wants to merge
16
commits into
main
Choose a base branch
from
feat/new-cat-signed-doc
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
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
Signed-off-by: bkioshn <[email protected]>
Signed-off-by: bkioshn <[email protected]>
* feat(signed-doc): add new type DocType Signed-off-by: bkioshn <[email protected]> * fix(signed-doc): add conversion policy Signed-off-by: bkioshn <[email protected]> * fix(signed-doc): doc type Signed-off-by: bkioshn <[email protected]> * fix(signed-doc): doc type error Signed-off-by: bkioshn <[email protected]> * fix(signed-doc): seperate test Signed-off-by: bkioshn <[email protected]> * fix(signed-doc): format Signed-off-by: bkioshn <[email protected]> --------- Signed-off-by: bkioshn <[email protected]>
…gned Documents (#349) * wip * wip * fix fmt * fix spelling * fix clippy
8 tasks
* feat(signed-doc): add new type DocType Signed-off-by: bkioshn <[email protected]> * wip: apply doctype Signed-off-by: bkioshn <[email protected]> * fix(signed-doc): add more function to DocType Signed-off-by: bkioshn <[email protected]> * fix(signed-doc): map old doctype to new doctype Signed-off-by: bkioshn <[email protected]> * fix(signed-doc): add eq to uuidv4 Signed-off-by: bkioshn <[email protected]> * fix(signed-doc): fix validator Signed-off-by: bkioshn <[email protected]> * fix(signed-doc): minor fixes Signed-off-by: bkioshn <[email protected]> * fix(catalyst-types): add hash to uuidv4 Signed-off-by: bkioshn <[email protected]> * fix(signed-doc): decoding test Signed-off-by: bkioshn <[email protected]> * fix(signed-doc): doctype Signed-off-by: bkioshn <[email protected]> * fix(signed-doc): minor fixes Signed-off-by: bkioshn <[email protected]> * chore(sign-doc): fix comment Signed-off-by: bkioshn <[email protected]> * fix(catalyst-types): add fromstr to uuidv4 and 7 Signed-off-by: bkioshn <[email protected]> * fix(signed-doc): restructure doctypes Signed-off-by: bkioshn <[email protected]> * fix(signed-doc): test Signed-off-by: bkioshn <[email protected]> * Update rust/signed_doc/tests/proposal.rs * Update rust/signed_doc/tests/comment.rs * Update rust/signed_doc/tests/submission.rs --------- Signed-off-by: bkioshn <[email protected]> Co-authored-by: Alex Pozhylenkov <[email protected]>
…350) * feat: initial * test: minor check * test: more test * fix: minor * Update rust/signed_doc/src/validator/rules/content_type.rs Co-authored-by: Alex Pozhylenkov <[email protected]> * chore: remove proptest * chore: cleanup * chore: split json and cbor * chore: minor adjustment * Update rust/signed_doc/src/validator/rules/content_type.rs Co-authored-by: Artur Helmanau <[email protected]> * fix: import json raw value --------- Co-authored-by: Alex Pozhylenkov <[email protected]> Co-authored-by: Artur Helmanau <[email protected]>
✅ Test Report | |
8 tasks
8 tasks
8 tasks
8 tasks
* feat: metadata enum map representation * add encode/decode impl for Metadata * fix integer label, upd its doc * upd integer label doc. * use ProblemReport, remove map ord decode validation * Update rust/signed_doc/src/metadata/mod.rs
…or (#353) * wip * wip * wip * wip * wip * fix * fix clippy * wip * cleanup * wip * wip * wip * wip * wip * wip * wip * update test * fix spelling * wip * wip * Update rust/signed_doc/src/lib.rs Co-authored-by: Artur Helmanau <[email protected]> * Revert "wip" This reverts commit 5b209bb. * fix clippy --------- Co-authored-by: Artur Helmanau <[email protected]>
* feat(deterministic decoder): rfc template WIP * fix: implement minimal length validation for string types Adds validation for minimal length encoding of string types (Str and Bytes) in the DeterministicDecoder according to RFC 8949 Section 4.2. This ensures that string lengths are encoded using the minimal number of bytes required. For example, strings of length 0-23 must use direct encoding, length 24-255 must use one byte, etc. The changes: - Add length validation for Type::Str and Type::Bytes - Check for indefinite length strings - Validate minimal length encoding using check_minimal_length function * test: expand deterministic CBOR decoding tests Adds comprehensive test coverage for RFC 8949 Section 4.2 deterministic encoding requirements. The new tests verify: - Minimal length integer encoding rules for values 0-23, 24-255, etc. - Floating point value requirements including shortest form and non-finite prohibition - String/array/map length encoding rules and indefinite length checks - Map key ordering rules with length-first canonical ordering Each test includes detailed comments explaining: - The specific RFC requirement being tested - Byte-level breakdown of CBOR encodings - Why each test case is valid or invalid - References to relevant RFC sections This ensures proper validation of all deterministic encoding rules and helps maintainers understand the requirements. * cbor: Add comprehensive tests for deterministic encoding Add detailed test cases for deterministic CBOR encoding rules as specified in RFC 8949 section 4.2. The new tests cover: - Integer boundary conditions and minimal encoding requirements - Negative integer encoding across different ranges - Map key ordering (length-first, then lexicographic) - Floating point encoding with different precision requirements - String comparison ordering including UTF-8 handling - Nested structure validation - Array length encoding rules - Duplicate map key detection The tests are extensively documented with RFC requirements and include TODOs for future validation improvements, particularly for floating point handling where additional checks for non-finite values and minimal encoding could be added. Includes commented-out test cases that can be enabled once support for validating non-finite floating point values is implemented. RFC: https://datatracker.ietf.org/doc/html/rfc8949#section-4.2 * cbor: Fix clippy warnings in deterministic tests Refactor test cases to fix clippy warnings: - Use simpler iterator chaining in array length test - Remove redundant calls - Replace explicit type annotations with inferred types - Fix collect() with redundant map operations Also simplify floating point test cases to match current implementation and improve RFC 8949 compliance documentation. The floating point tests now focus on valid encodings while keeping commented-out future test cases for non-finite values validation. Tests still verify the same RFC requirements but with more idiomatic Rust code. * fmt * docs * docs: enhance CBOR deterministic validation documentation Improve documentation and refactor validate_next() to align with RFC 8949 § 4.2 specification for deterministically encoded CBOR. Split validation logic into smaller, focused functions for better maintainability. - Split validate_next into specialized validation functions: * validate_integer() - Handles minimal integer encoding * validate_array() - Validates definite-length arrays * validate_string() - Checks string/bytes encoding * validate_map() - Ensures proper key ordering - Add comprehensive documentation referencing RFC 8949: * Detail core deterministic encoding requirements * Document rules for integer minimality * Explain length field constraints * Specify map key ordering rules * Include examples of valid/invalid encodings This refactoring improves code organization while maintaining full compliance with the CBOR deterministic encoding specification. The enhanced documentation helps developers understand both implementation details and RFC requirements. * docs: enhance CBOR deterministic validation documentation Improve documentation and refactor validate_next() to align with RFC 8949 § 4.2 specification for deterministically encoded CBOR. Split validation logic into smaller, focused functions for better maintainability. - Split validate_next into specialized validation functions: * validate_integer() - Handles minimal integer encoding * validate_array() - Validates definite-length arrays * validate_string() - Checks string/bytes encoding * validate_map() - Ensures proper key ordering - Add comprehensive documentation referencing RFC 8949: * Detail core deterministic encoding requirements * Document rules for integer minimality * Explain length field constraints * Specify map key ordering rules * Include examples of valid/invalid encodings This refactoring improves code organization while maintaining full compliance with the CBOR deterministic encoding specification. The enhanced documentation helps developers understand both implementation details and RFC requirements. * docs: Add comprehensive documentation for CBOR deterministic validation * Add violation test cases for string comparison ordering * Add violation test cases for string comparison ordering * feat(deterministic cbor): toggle validation * feat(deterministic cbor): toggle validation * feat(deterministic cbor): toggle validation * refactor(generic decoder): helper functions * refactor(generic decoder): helper functions * refactor(generic decoder): helper functions * refactor(deterministic maps): rfc validation * refactor(deterministic maps): rfc validation * refactor(deterministic maps): rfc validation * refactor(deterministic maps): rfc validation * refactor(deterministic maps): rfc validation * refactor(deterministic maps): rfc validation * refactor(deterministic maps): rfc validation * refactor(deterministic maps): rfc validation * refactor(deterministic maps): rfc validation * refactor(deterministic maps): rfc validation * refactor(deterministic maps): rfc validation * refactor(deterministic maps): rfc validation * refactor(deterministic maps): rfc validation * refactor(deterministic maps): rfc validation * refactor(minimal length check): maps only * refactor(minimal length check): maps only * refactor(minimal length check): maps only * refactor(minimal length check): maps only * docs: enhance CBOR deterministic validation documentation * feat(deterministic map decoder only): rfc 8949 * feat(deterministic map decoder only): rfc 8949 * feat(deterministic map decoder only): rfc 8949 * feat(deterministic map decoder only): rfc 8949 * feat(deterministic map decoder only): rfc 8949 * feat(deterministic map decoder only): rfc 8949 * feat(deterministic map decoder only): rfc 8949 * feat(deterministic map decoder only): rfc 8949 * feat(deterministic map decoder only): rfc 8949 * feat(deterministic map decoder only): rfc 8949 * feat(deterministic map decoder only): rfc 8949 * refactor(pr changes): houskeeping * fmt * refactor(pr changes): houskeeping * refactor(pr changes): houskeeping * refactor(pr changes): houskeeping * refactor(pr changes): houskeeping * refactor(cleanup): actual vs declared length helper * refactor(cleanup): actual vs declared length helper * refactor(cleanup): actual vs declared length helper * Add comprehensive MapEntry ordering tests - Test length-first and lexicographic key ordering per RFC 8949 - Verify equality vs ordering distinction for CBOR deterministic encoding - Cover edge cases: empty keys, identical entries, duplicate key scenarios * Add comprehensive MapEntry ordering tests - Test length-first and lexicographic key ordering per RFC 8949 - Verify equality vs ordering distinction for CBOR deterministic encoding - Cover edge cases: empty keys, identical entries, duplicate key scenarios * refactor(err): rm deterministic error type * Update rust/cbork-utils/src/deterministic_helper.rs Co-authored-by: Artur Helmanau <[email protected]> * Fix MapEntry ordering to prioritize length over lexicographic comparison The Ord implementation now compares key_bytes by length first, then lexicographically if lengths are equal. This fixes the failing test case where shorter keys should be ordered before longer keys regardless of byte content. * Update rust/cbork-utils/src/deterministic_helper.rs Co-authored-by: Alex Pozhylenkov <[email protected]> * Update rust/cbork-utils/src/deterministic_helper.rs Co-authored-by: Alex Pozhylenkov <[email protected]> * Update rust/cbork-utils/src/deterministic_helper.rs Co-authored-by: Alex Pozhylenkov <[email protected]> * fmt * fmt * fmt * refactor(rm fn): get bytes * refactor(indefinite length items): laconic * refactor(indefinite length items): laconic --------- Co-authored-by: Artur Helmanau <[email protected]> Co-authored-by: Alex Pozhylenkov <[email protected]>
…non-optional (#369) * wip * wip * wip * wip * wip * cleanup * wip * wip * fix clippy
8 tasks
* fix(signed-doc): log and to value Signed-off-by: bkioshn <[email protected]> * fix(signed-doc): add from doctype to vec uuid Signed-off-by: bkioshn <[email protected]> * fix(signed-doc): add more doc type Signed-off-by: bkioshn <[email protected]> * fix(signed-doc): from doctype for vec string Signed-off-by: bkioshn <[email protected]> * fix(signed-doc): revert Signed-off-by: bkioshn <[email protected]> * fix(signed-doc): revert Signed-off-by: bkioshn <[email protected]> * fix(signed-doc): backward compatible rule Signed-off-by: bkioshn <[email protected]> * fix(signed-doc): remove unused doc type Signed-off-by: bkioshn <[email protected]> * fix(signed-doc): improve static doc types Signed-off-by: bkioshn <[email protected]> * fix(signed-doc): add more doc-types Signed-off-by: bkioshn <[email protected]> --------- Signed-off-by: bkioshn <[email protected]> Co-authored-by: Alex Pozhylenkov <[email protected]>
* impl deserialize * refactor from_metadata_fields & remove InnerMetadata * rename visitor * handle aliasing * kebab-case only deserialization for SupportedLabel * cleanup * fmt --------- Co-authored-by: Alex Pozhylenkov <[email protected]>
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.
Description
Feature base branch for new Catalyst Signed Doc
Related Issue(s)
Closes #330
Related Pull Requests