Explorar el Código

Renamed btmsg to bttp.

Matthew Carr hace 1 año
padre
commit
43f461f7a9

+ 27 - 27
Cargo.lock

@@ -285,8 +285,8 @@ version = "0.1.0"
 dependencies = [
  "anyhow",
  "btlib",
- "btmsg",
  "btserde",
+ "bttp",
  "bytes",
  "fuse-backend-rs",
  "futures",
@@ -323,8 +323,8 @@ dependencies = [
  "btfproto",
  "btlib",
  "btlib-tests",
- "btmsg",
  "btserde",
+ "bttp",
  "ctor",
  "env_logger",
  "figment",
@@ -345,8 +345,8 @@ dependencies = [
  "btfproto",
  "btfproto-tests",
  "btlib",
- "btmsg",
  "btserde",
+ "bttp",
  "ctor",
  "env_logger",
  "figment",
@@ -411,29 +411,6 @@ dependencies = [
  "tempdir",
 ]
 
-[[package]]
-name = "btmsg"
-version = "0.1.0"
-dependencies = [
- "anyhow",
- "btlib",
- "btserde",
- "bytes",
- "chrono",
- "ctor",
- "env_logger",
- "futures",
- "lazy_static",
- "log",
- "quinn",
- "rustls",
- "serde",
- "tokio",
- "tokio-stream",
- "tokio-util",
- "zerocopy",
-]
-
 [[package]]
 name = "btprovision"
 version = "0.1.0"
@@ -455,8 +432,8 @@ dependencies = [
  "anyhow",
  "btlib",
  "btlib-tests",
- "btmsg",
  "btserde",
+ "bttp",
  "bytes",
  "ctor",
  "env_logger",
@@ -478,6 +455,29 @@ dependencies = [
  "serde-big-array",
 ]
 
+[[package]]
+name = "bttp"
+version = "0.1.0"
+dependencies = [
+ "anyhow",
+ "btlib",
+ "btserde",
+ "bytes",
+ "chrono",
+ "ctor",
+ "env_logger",
+ "futures",
+ "lazy_static",
+ "log",
+ "quinn",
+ "rustls",
+ "serde",
+ "tokio",
+ "tokio-stream",
+ "tokio-util",
+ "zerocopy",
+]
+
 [[package]]
 name = "bumpalo"
 version = "3.11.1"

+ 1 - 1
README.md

@@ -26,7 +26,7 @@ by the [tpm](./btlib/crypto/tpm/index.html) module.
 * [btrun](./btrun/index.html): Contains the actor runtime.
 * [btserde](./btserde/index.html): Defines the serde compact binary serialization format used to
 store data on disk and transmit over the network.
-* [btmsg](./btmsg/index.html): Defines the message passing interface.
+* [bttp](./bttp/index.html): Defines the message passing interface.
 * [btfproto](./btfproto/index.html): Defines the message protocol used to communicate with file
 servers.
 * [btfsd](./btfsd/index.html): Implements a file server daemon.

+ 1 - 1
crates/btfproto/Cargo.toml

@@ -13,7 +13,7 @@ default = ["client", "server", "local-fs"]
 
 [dependencies]
 btlib = { path = "../btlib" }
-btmsg = { path = "../btmsg" }
+bttp = { path = "../bttp" }
 serde = { version = "^1.0.136", features = ["derive"] }
 paste = "1.0.11"
 log = "0.4.17"

+ 1 - 1
crates/btfproto/src/client.rs

@@ -3,7 +3,7 @@
 use crate::{msg::*, server::FsProvider, Handle, Inode};
 
 use btlib::{bterr, crypto::ConcretePub, BlockPath, IssuedProcRec, Result};
-use btmsg::{DeserCallback, Transmitter};
+use bttp::{DeserCallback, Transmitter};
 
 use core::future::{ready, Future, Ready};
 use futures::FutureExt;

+ 1 - 1
crates/btfproto/src/msg.rs

@@ -5,7 +5,7 @@ use super::{Handle, Inode};
 use btlib::{
     bterr, crypto::ConcretePub, BlockMetaSecrets, DirEntry, DirEntryKind, Epoch, IssuedProcRec,
 };
-use btmsg::CallMsg;
+use bttp::CallMsg;
 use core::time::Duration;
 use paste::paste;
 use serde::{Deserialize, Serialize};

+ 1 - 1
crates/btfproto/src/server.rs

@@ -7,7 +7,7 @@
 use crate::msg::{Read as ReadMsg, *};
 
 use btlib::{crypto::Creds, BlockPath, Result};
-use btmsg::{MsgCallback, MsgReceived, Receiver};
+use bttp::{MsgCallback, MsgReceived, Receiver};
 use core::future::Future;
 use std::{net::IpAddr, ops::Deref, sync::Arc};
 

+ 1 - 1
crates/btfsd/Cargo.toml

@@ -7,7 +7,7 @@ edition = "2021"
 
 [dependencies]
 btlib = { path = "../btlib" }
-btmsg = { path = "../btmsg" }
+bttp = { path = "../bttp" }
 btfproto = { path = "../btfproto" }
 btconfig = { path = "../btconfig" }
 btconsole = { path = "../btconsole" }

+ 1 - 1
crates/btfsd/autobuild.sh

@@ -1,4 +1,4 @@
 #!/usr/bin/env bash
 # Automatically builds btconsole and btconsole-client when files in their respective crates change.
 set -euo pipefail
-RUST_LOG=warn,btfsd=debug,btconsole=debug,btmsg=debug cargo watch -- sh -c 'cd ../btconsole-client && trunk build && cd - && cargo run'
+RUST_LOG=warn,btfsd=debug,btconsole=debug,bttp=debug cargo watch -- sh -c 'cd ../btconsole-client && trunk build && cd - && cargo run'

+ 3 - 3
crates/btfsd/src/main.rs

@@ -6,7 +6,7 @@ use btfproto::{
     server::{new_fs_server, FsProvider},
 };
 use btlib::{bterr, crypto::Creds, error::DisplayErr, log::BuilderExt, Result};
-use btmsg::Receiver;
+use bttp::Receiver;
 use figment::{providers::Serialized, Figment};
 use serde::{Deserialize, Serialize};
 use std::{net::IpAddr, path::PathBuf, sync::Arc};
@@ -95,7 +95,7 @@ mod tests {
         AuthzAttrs, BlockMetaSecrets, Epoch, IssuedProcRec, Principaled, ProcRec,
     };
     use btlib_tests::{CredStoreTestingExt, TpmCredStoreHarness};
-    use btmsg::BlockAddr;
+    use bttp::BlockAddr;
     use btserde::from_slice;
     use std::net::{IpAddr, Ipv4Addr};
     use std::{future::ready, net::Ipv6Addr, time::Duration};
@@ -896,7 +896,7 @@ mod tests {
         let node_creds = case.harness.cred_store().node_creds().unwrap();
         let bind_path = node_creds.writecap().unwrap().bind_path();
         let block_addr = Arc::new(BlockAddr::new(LOCALHOST, Arc::new(bind_path)));
-        let tx = btmsg::Transmitter::new(block_addr, Arc::new(user_creds))
+        let tx = bttp::Transmitter::new(block_addr, Arc::new(user_creds))
             .await
             .unwrap();
         let client = FsClient::new(tx);

+ 1 - 1
crates/btfuse/Cargo.toml

@@ -11,7 +11,7 @@ btlib = { path = "../btlib" }
 btserde = { path = "../btserde" }
 swtpm-harness = { path = "../swtpm-harness" }
 btfproto = { path = "../btfproto" }
-btmsg = { path = "../btmsg" }
+bttp = { path = "../bttp" }
 btconfig = { path = "../btconfig" }
 tokio = { version = "1.24.2", features = ["rt", "rt-multi-thread"] }
 fuse-backend-rs = { version = "0.9.6", features = ["async-io"] }

+ 3 - 3
crates/btfuse/src/main.rs

@@ -11,7 +11,7 @@ use btlib::{
     crypto::{Creds, CredsPriv},
     Result,
 };
-use btmsg::{BlockAddr, Transmitter};
+use bttp::{BlockAddr, Transmitter};
 use serde::{Deserialize, Serialize};
 use std::{
     fs::{self},
@@ -191,7 +191,7 @@ mod test {
         log::BuilderExt,
         Epoch, Principaled,
     };
-    use btmsg::Receiver;
+    use bttp::Receiver;
     use ctor::ctor;
     use std::{
         ffi::{OsStr, OsString},
@@ -858,7 +858,7 @@ mod config_tests {
 
     use btconfig::CredStoreConfig;
     use btlib::BlockPath;
-    use btmsg::BlockAddr;
+    use bttp::BlockAddr;
     use figment::Jail;
 
     #[test]

+ 1 - 1
crates/btrun/Cargo.toml

@@ -7,7 +7,7 @@ edition = "2021"
 
 [dependencies]
 btlib = { path = "../btlib" }
-btmsg = { path = "../btmsg" }
+bttp = { path = "../bttp" }
 btserde = { path = "../btserde" }
 tokio = { version = "1.23.0", features = ["rt-multi-thread"] }
 futures = "0.3.25"

+ 5 - 5
crates/btrun/src/lib.rs

@@ -13,7 +13,7 @@ use std::{
 };
 
 use btlib::{bterr, crypto::Creds, error::StringError, BlockPath, Result};
-use btmsg::{DeserCallback, MsgCallback, Receiver, Replier, Transmitter};
+use bttp::{DeserCallback, MsgCallback, Receiver, Replier, Transmitter};
 use btserde::{field_helpers::smart_ptr, from_slice, to_vec, write_to};
 use serde::{de::DeserializeOwned, Deserialize, Serialize};
 use tokio::{
@@ -385,7 +385,7 @@ impl RuntimeCallback {
 impl MsgCallback for RuntimeCallback {
     type Arg<'de> = WireMsg<'de>;
     type CallFut<'de> = impl 'de + Future<Output = Result<()>>;
-    fn call<'de>(&'de self, arg: btmsg::MsgReceived<Self::Arg<'de>>) -> Self::CallFut<'de> {
+    fn call<'de>(&'de self, arg: bttp::MsgReceived<Self::Arg<'de>>) -> Self::CallFut<'de> {
         async move {
             let (_, body, replier) = arg.into_parts();
             if body.to.path() == self.rt.path() {
@@ -477,11 +477,11 @@ struct WireMsg<'a> {
     payload: &'a [u8],
 }
 
-impl<'a> btmsg::CallMsg<'a> for WireMsg<'a> {
+impl<'a> bttp::CallMsg<'a> for WireMsg<'a> {
     type Reply<'r> = WireReply<'r>;
 }
 
-impl<'a> btmsg::SendMsg<'a> for WireMsg<'a> {}
+impl<'a> bttp::SendMsg<'a> for WireMsg<'a> {}
 
 #[derive(Serialize, Deserialize)]
 enum WireReply<'a> {
@@ -656,7 +656,7 @@ mod tests {
         log::BuilderExt,
     };
     use btlib_tests::TEST_STORE;
-    use btmsg::BlockAddr;
+    use bttp::BlockAddr;
     use btserde::to_vec;
     use ctor::ctor;
     use lazy_static::lazy_static;

+ 1 - 1
crates/btmsg/Cargo.lock → crates/bttp/Cargo.lock

@@ -206,7 +206,7 @@ dependencies = [
 ]
 
 [[package]]
-name = "btmsg"
+name = "bttp"
 version = "0.1.0"
 dependencies = [
  "btlib",

+ 1 - 1
crates/btmsg/Cargo.toml → crates/bttp/Cargo.toml

@@ -1,5 +1,5 @@
 [package]
-name = "btmsg"
+name = "bttp"
 version = "0.1.0"
 edition = "2021"
 

+ 0 - 0
crates/btmsg/src/common.rs → crates/bttp/src/common.rs


+ 0 - 0
crates/btmsg/src/lib.rs → crates/bttp/src/lib.rs


+ 0 - 0
crates/btmsg/src/receiver.rs → crates/bttp/src/receiver.rs


+ 0 - 0
crates/btmsg/src/serialization.rs → crates/bttp/src/serialization.rs


+ 0 - 0
crates/btmsg/src/tls.rs → crates/bttp/src/tls.rs


+ 0 - 0
crates/btmsg/src/transmitter.rs → crates/bttp/src/transmitter.rs


+ 1 - 1
crates/btmsg/tests/tests.rs → crates/bttp/tests/tests.rs

@@ -1,7 +1,7 @@
 // SPDX-License-Identifier: AGPL-3.0-or-later
 #![feature(impl_trait_in_assoc_type)]
 
-use btmsg::*;
+use bttp::*;
 
 use btlib::{
     crypto::{ConcreteCreds, Creds, CredsPriv},

+ 1 - 1
website/content/en/_index.html

@@ -41,7 +41,7 @@ Information in the filesystem secured with confidentiality and integrity protect
 Key management is handled by the platform.
 {{% /blocks/feature %}}
 
-{{% blocks/feature icon="fa-solid fa-envelope" title="Message Passing" url="./rustdoc/btmsg/index.html" %}}
+{{% blocks/feature icon="fa-solid fa-envelope" title="Message Passing" url="./rustdoc/bttp/index.html" %}}
 Apps are implemented as message passing actors.
 Messages are addressed using filesystem paths.
 The platform uses mutual TLS authentication to ensure your messages are only seen by their intended