M2: - schemas/auth.capnp: AuthenticationService (upload/fetch KeyPackage) - noiseml-core: IdentityKeypair (Ed25519), generate_key_package, NoiseTransport with send_envelope/recv_envelope, Noise_XX handshake (initiator + responder) - noiseml-proto: auth_capnp module, ParsedEnvelope helpers - noiseml-server: AuthServiceImpl backed by DashMap queue (single-use KPs) - noiseml-client: register + fetch-key subcommands, ping over Noise_XX - tests: auth_service integration test (upload → fetch round-trip) M3: - schemas/delivery.capnp: DeliveryService (enqueue/fetch opaque payloads) - noiseml-core/group.rs: GroupMember — MLS group lifecycle create_group, add_member (→ Commit+Welcome), join_group, send_message, receive_message; uses openmls 0.5 public API (extract() not into_welcome, KeyPackageIn::validate() not From<KeyPackageIn>) - noiseml-server: DeliveryServiceImpl on port 7001 alongside AS on 7000 - noiseml-proto: delivery_capnp module TODO (see M3_STATUS.md): - noiseml-client: group subcommands (create-group, invite, join, send, recv) - noiseml-client/tests/mls_group.rs: full MLS round-trip integration test
56 lines
1.7 KiB
Rust
56 lines
1.7 KiB
Rust
//! Build script for noiseml-proto.
|
|
//!
|
|
//! Invokes the `capnp` compiler to generate Rust types from `.capnp` schemas
|
|
//! located in the workspace-root `schemas/` directory.
|
|
//!
|
|
//! # Prerequisites
|
|
//!
|
|
//! The `capnp` CLI must be installed and on `PATH`.
|
|
//!
|
|
//! Debian/Ubuntu: apt-get install capnproto
|
|
//! macOS: brew install capnp
|
|
//! Docker: see docker/Dockerfile
|
|
|
|
use std::{env, path::PathBuf};
|
|
|
|
fn main() {
|
|
let manifest_dir = PathBuf::from(
|
|
env::var("CARGO_MANIFEST_DIR").expect("CARGO_MANIFEST_DIR not set by Cargo"),
|
|
);
|
|
|
|
// Workspace root is two levels above this crate (noiseml/crates/noiseml-proto).
|
|
let workspace_root = manifest_dir
|
|
.join("../..")
|
|
.canonicalize()
|
|
.expect("could not canonicalize workspace root path");
|
|
|
|
let schemas_dir = workspace_root.join("schemas");
|
|
|
|
// Re-run this build script whenever any schema file changes.
|
|
println!(
|
|
"cargo:rerun-if-changed={}",
|
|
schemas_dir.join("envelope.capnp").display()
|
|
);
|
|
println!(
|
|
"cargo:rerun-if-changed={}",
|
|
schemas_dir.join("auth.capnp").display()
|
|
);
|
|
println!(
|
|
"cargo:rerun-if-changed={}",
|
|
schemas_dir.join("delivery.capnp").display()
|
|
);
|
|
|
|
capnpc::CompilerCommand::new()
|
|
// Treat `schemas/` as the include root so that inter-schema imports
|
|
// resolve correctly.
|
|
.src_prefix(&schemas_dir)
|
|
.file(schemas_dir.join("envelope.capnp"))
|
|
.file(schemas_dir.join("auth.capnp"))
|
|
.file(schemas_dir.join("delivery.capnp"))
|
|
.run()
|
|
.expect(
|
|
"Cap'n Proto schema compilation failed. \
|
|
Is `capnp` installed? (apt-get install capnproto / brew install capnp)",
|
|
);
|
|
}
|