Add Rust protobuf bindings (prost-build)#138
Draft
rucoder wants to merge 4 commits intolf-edge:mainfrom
Draft
Conversation
40d1dbd to
163d6f5
Compare
- rust/build.rs: compile all proto packages via prost-build - rust/src/lib.rs: module declarations with doc comments and re-exports - rust/Cargo.toml: prost 0.13, bytes, clippy lints for generated code - Makefile: add rust, rust-test, rust-check, rust-clean targets - .gitignore: add rust/target/ and swagger/ Signed-off-by: Mikhail Malyshev <mike.malyshev@gmail.com>
Add Rust toolchain (rustup, clippy, rustfmt, gcc, musl-dev) to the devcontainer Dockerfile. Rust builds alongside Go and Python as part of proto-local. Pass PROTO_DEPS_DIR to cargo so build.rs finds validate.proto from the container's proto deps. local build still fetches validate.proto from net Signed-off-by: Mikhail Malyshev <mike.malyshev@gmail.com>
163d6f5 to
af29e2a
Compare
Fixes clippy::uninlined_format_args warnings introduced in Rust 1.87+. Signed-off-by: Mikhail Malyshev <mike.malyshev@gmail.com>
adfdbe5 to
0a01d1c
Compare
…Authenticatable) Add eve_api::crypto module with protocol-level cryptographic traits for EVE Device API OBJECT-SIGNING authentication. Traits: - Signer: sign(data) -> fixed R||S, verify(data, sig, cert) -> bool - CertStore: device/signing cert access (DER + hash + PEM) - CryptoProvider: Signer + CertStore bound - Authenticatable: blanket impl for prost::Message -> AuthContainer Also adds CryptoError enum for structured error handling across crypto implementations (software, TPM, etc.). Dependencies added: thiserror 2, base64 0.22 Signed-off-by: Mikhail Malyshev <mike.malyshev@gmail.com>
0a01d1c to
9ddf638
Compare
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
Add auto-generated Rust bindings for all EVE Device API v2 protobuf packages using prost. Bindings are generated at build time from
.protosources — no pre-generated files committed.TODO:
What's included
rust/build.rs— compiles all proto packages viaprost-build(evecommon, auth, register, certs, attest, config, info, metrics, logs, flowlog, eveuuid, hardwarehealth, profile, nestedappinstancemetrics)rust/src/lib.rs— module declarations with doc comments, convenience re-exports (AuthContainer,EdgeDevConfig,ZRegisterMsg, etc.), and roundtrip testsrust/Cargo.toml— prost 0.13, bytes, clippy lint suppressions for generated codeMakefile—rust,rust-test,rust-check,rust-cleantargets;rustintegrated intoproto-local.gitignore—rust/target/Design decisions
.rsfiles. Consumers only need the proto sources and a Rust toolchain (prost-build is pure Rust, noprotocbinary required).bytes::Bytesfor all binary fields — zero-copy efficiency for payloads likeAuthContainer.signature_hashandZRegisterMsg.pem_cert.build.rs.empty_docs,doc_lazy_continuation,doc_overindented_list_items, andlarge_enum_variant— all originate from generated code.Downstream usage
These bindings are consumed by micro-eve, a Rust implementation of an EVE-compatible device agent. The following endpoints are working end-to-end with these types:
/ping,/certs,/register,/uuid.Testing