feat(verity-go): add Go fs-verity implementation and metadata package#117
Open
imlk0 wants to merge 14 commits into
Open
feat(verity-go): add Go fs-verity implementation and metadata package#117imlk0 wants to merge 14 commits into
imlk0 wants to merge 14 commits into
Conversation
These methods are needed by the metadata package to calculate descriptor hashes and rebuild root hashes.
Implements SerializeMetadata, DeserializeMetadata, VerifySelf, CalculateFsVerityHash, and CalculateMetadataHash. Includes: - Round-trip and tamper detection tests - Cross-language fixture tests for Rust interop - Interop tests using Rust CLI format/verify commands - Golden fixture tests with Rust-generated expected hashes - Shared .fbs schema files via symlips to Rust source
Add test_cross_deserialize_go_metadata and test_cross_serialize_rust_metadata to verify Rust can consume Go's FlatBuffers output and vice versa.
Add go-test job to CI with race detection, schema sync check, cross-language tests, and interop tests. Add Makefile targets for check-fbs, go-test, cross-test, interop-rust-produces, interop-go-produces, interop-test, and check-all.
- Move interop tests to a dedicated CI job running in a RHEL container (was failing on ubuntu-latest due to yum-builddep) - Populate rustFixtureBase64 in cross_test.go with Rust-serialized output - Add skip guard to TestInterop_RustProducesGoVerifies when interop data directory is missing - Move cleanup of interop temp dirs from interop-go-produces to interop-test parent target
- verity algorithm tests: exec call to make_testfiles.py to generate test files, compare against reference values from digest.rs - Rust/Go interop tests: load file-based metadata fixture generated by Rust CLI, verify Go deserialization and descriptor hashes Changes: - Delete golden_fixtures.json (no longer needed, values inlined) - Delete cross_test.go (merged into interop_test.go) - Add testdata/rust.metadata.fb fixture and gen_fixture.sh - Add fixture staleness check to CI (regenerate + diff) - Add gen-interop-fixture Makefile target - Remove cross_lang_test.sh and cross-test Makefile target
Add English and Chinese README files documenting package usage and installation. Also fix the CI go-test job to install Rust toolchain before the interop fixture verification step that calls cargo, and add testfiles/ to .gitignore.
Split Usage into two parts: (1) Serialize directory metadata with Rust CLI (recommended) and Go implementation options, and (2) Deserialize and verify with three levels — metadata root hash comparison, per-file self-verification, and per-block verification.
|
@imlk0 ,您好,您的请求已接收,请耐心等待结果。 |
|
@imlk0 ,您好,未检测到有镜像需要构建,如需重新检测请评论 /start 。 |
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
verity-go/Go module with fs-verity core types (FsVerityDescriptor,HashAlgorithm,FsVerityDigest,MerkleTree)metadatapackage: FlatBuffers serialization/deserialization of directory integrity metadata, includingCalculateMetadataHash,SerializeMetadata,DeserializeMetadata, and per-fileVerifySelfmetadatahash module (metadata_hash.fbs/CalculateMetadataHash) matching the Rust schema.fbsfilesverity/golden_test.go): execmake_testfiles.py, compare Go-computed descriptor hashes against 13 hardcoded Rust reference valuesmetadata/interop_test.go): loadtestdata/rust.metadata.fbfixture generated by Rust CLI, verify deserialization, labels, hashes, and per-file block-level recalculationgo-testjob (race detector, all packages) with fixture drift detection stepinterop-testMakefile targetREADME.md/README_CN.md) with usage examplestestfiles/to.gitignoreTest plan
cd verity-go && go test -race -v ./...make interop-test(requires Rust + Go)make check-fbs(FlatBuffers schema sync)go-testjob passes (including fixture verification step)🤖 Generated with Claude Code