Skip to content

Commit

Permalink
build(rust): upgrade dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
adrianbenavides committed Feb 26, 2025
1 parent 2f45238 commit 6f93085
Show file tree
Hide file tree
Showing 59 changed files with 643 additions and 573 deletions.
847 changes: 460 additions & 387 deletions Cargo.lock

Large diffs are not rendered by default.

5 changes: 3 additions & 2 deletions NOTICE.md
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,7 @@ This file contains attributions for any 3rd-party open source code used in this
| regex-syntax | MIT, Apache-2.0 | https://crates.io/crates/regex-syntax |
| reqwest | MIT, Apache-2.0 | https://crates.io/crates/reqwest |
| rfc6979 | Apache-2.0, MIT | https://crates.io/crates/rfc6979 |
| ring | | https://crates.io/crates/ring |
| ring | Apache-2.0, ISC | https://crates.io/crates/ring |
| riscv | ISC | https://crates.io/crates/riscv |
| roff | MIT, Apache-2.0 | https://crates.io/crates/roff |
| rustc-demangle | MIT, Apache-2.0 | https://crates.io/crates/rustc-demangle |
Expand Down Expand Up @@ -592,7 +592,6 @@ This file contains attributions for any 3rd-party open source code used in this
| volatile-register | MIT, Apache-2.0 | https://crates.io/crates/volatile-register |
| vsimd | MIT | https://crates.io/crates/vsimd |
| vte | Apache-2.0, MIT | https://crates.io/crates/vte |
| vte_generate_state_changes | Apache-2.0, MIT | https://crates.io/crates/vte_generate_state_changes |
| walkdir | Unlicense, MIT | https://crates.io/crates/walkdir |
| want | MIT | https://crates.io/crates/want |
| wasite | Apache-2.0, BSL-1.0, MIT | https://crates.io/crates/wasite |
Expand Down Expand Up @@ -624,6 +623,7 @@ This file contains attributions for any 3rd-party open source code used in this
| windows-core | MIT, Apache-2.0 | https://crates.io/crates/windows-core |
| windows-implement | MIT, Apache-2.0 | https://crates.io/crates/windows-implement |
| windows-interface | MIT, Apache-2.0 | https://crates.io/crates/windows-interface |
| windows-link | MIT, Apache-2.0 | https://crates.io/crates/windows-link |
| windows-registry | MIT, Apache-2.0 | https://crates.io/crates/windows-registry |
| windows-result | MIT, Apache-2.0 | https://crates.io/crates/windows-result |
| windows-strings | MIT, Apache-2.0 | https://crates.io/crates/windows-strings |
Expand All @@ -639,6 +639,7 @@ This file contains attributions for any 3rd-party open source code used in this
| windows_x86_64_msvc | MIT, Apache-2.0 | https://crates.io/crates/windows_x86_64_msvc |
| winnow | MIT | https://crates.io/crates/winnow |
| winsafe | MIT | https://crates.io/crates/winsafe |
| wit-bindgen-rt | Apache-2.0 WITH LLVM-exception, Apache-2.0, MIT | https://crates.io/crates/wit-bindgen-rt |
| write16 | Apache-2.0, MIT | https://crates.io/crates/write16 |
| writeable | Unicode-3.0 | https://crates.io/crates/writeable |
| x11-clipboard | MIT | https://crates.io/crates/x11-clipboard |
Expand Down
Original file line number Diff line number Diff line change
@@ -1,91 +1,91 @@
/// INTRODUCTION
///
/// This example shows how to use attribute-based credential in order to have
/// several devices connecting to a server, via the Ockam Orchestrator.
///
/// The corresponding example using the command-line can be found here: https://docs.ockam.io/use-cases/apply-fine-grained-permissions-with-attribute-based-access-control-abac.
///
/// You first need to:
///
/// - create a project with `ockam enroll`
/// - export the project information with `ockam project information > project.json`
///
/// Then you can start:
///
/// - a local Python webserver: `python3 -m http.server --bind 127.0.0.1 5000`
/// - the control node in `11-attribute-based-authentication-control-plane.rs`
/// - the edge node in `11-attribute-based-authentication-edge-plane.rs`
///
/// This will set up a TCP outlet on the control node, connected to the Python webserver
/// and a TCP inlet on the edge node which can be used to send HTTP requests (at 127.0.0.1:7000).
///
/// Then if you execute `curl --fail --head --max-time 10 127.0.0.1:7000` you should get back
/// a successful response like:
///
/// HTTP/1.0 200 OK
/// Server: SimpleHTTP/0.6 Python/3.9.6
/// Date: Tue, 07 Feb 2023 15:05:59 GMT
/// Content-type: text/html; charset=utf-8
/// Content-Length: 870
///
/// and observe that a successful connection has been made on the Python webserver:
///
/// ± python3 -m http.server --bind 127.0.0.1 5000 default
/// Serving HTTP on 127.0.0.1 port 5000 (http://127.0.0.1:5000/) ...
/// 127.0.0.1 - - [06/Feb/2023 15:52:20] "HEAD / HTTP/1.1" 200 -
///
/// TOPOLOGY
///
/// The network we establish between the control node, the edge node and the Orchestrator is the following
///
/// get credential +-------------------------------------+
/// via secure channel | | Inlet <-- 127.0.0.1:7000
/// +---------------+ Edge node | connected to "outlet"
/// | | | via secure channel
/// | +-------------------------------------+
/// | | |
/// | | | create secure channel to control
/// | | | via the relay
/// v v |
/// +--------------+ +-------------------------------+-------+
/// | Authority | | | |
/// | | | Orchestrator | |
/// | | | | |
/// +--------------+ +---------------------- forwarder ------+
/// ^ ^ to control
/// | | ^ |
/// | | create | |
/// | | | v
/// | | | "untrusted" secure channel
/// | +---------------------------------------+ listener
/// | | |
/// +---------------| Control node | "outlet" --> 127.0.0.1:5000
/// get credential | |
/// via secure channel +---------------------------------------+
///
///
/// - we create initially some secure channels to the Authority in order to retrieve credential
/// based on a one-time token generated with `ockam project ticket --attribute component=<name of node>`
///
/// - then the control node creates a relay on the Orchestrator in order to accept TCP traffic without
/// having to open a port to the internet. It also starts a channel listener ("untrusted", accept all incoming requests for now)
///
/// - on its side the edge node starts a secure channel via relay (named "forward_to_control_plane1"), to the "untrusted" listener
/// with the secure channel address it creates an Inlet which will direct TCP traffic via the secure channel to get to the
/// control node and then to the "outlet" worker to reach the Python webserver
///
/// - the outlet is configured to only receive messages from the edge node by checking its authenticated attributes
/// - the inlet is configured to only receive messages from the control node by checking its authenticated attributes
///
/// IMPLEMENTATION
///
/// The code for this example can be found in:
///
/// - examples/11-attribute-based-authentication-control-plane.rs: for the control node
/// - examples/11-attribute-based-authentication-edge-plane.rs: for the edge node
/// - src/project.rs: read the content of the project.json file
/// - src/token.rs: generate a one-time token using the ockam command line
///
//! INTRODUCTION
//!
//! This example shows how to use attribute-based credential in order to have
//! several devices connecting to a server, via the Ockam Orchestrator.
//!
//! The corresponding example using the command-line can be found here: https://docs.ockam.io/use-cases/apply-fine-grained-permissions-with-attribute-based-access-control-abac.
//!
//! You first need to:
//!
//! - create a project with `ockam enroll`
//! - export the project information with `ockam project information > project.json`
//!
//! Then you can start:
//!
//! - a local Python webserver: `python3 -m http.server --bind 127.0.0.1 5000`
//! - the control node in `11-attribute-based-authentication-control-plane.rs`
//! - the edge node in `11-attribute-based-authentication-edge-plane.rs`
//!
//! This will set up a TCP outlet on the control node, connected to the Python webserver
//! and a TCP inlet on the edge node which can be used to send HTTP requests (at 127.0.0.1:7000).
//!
//! Then if you execute `curl --fail --head --max-time 10 127.0.0.1:7000` you should get back
//! a successful response like:
//!
//! HTTP/1.0 200 OK
//! Server: SimpleHTTP/0.6 Python/3.9.6
//! Date: Tue, 07 Feb 2023 15:05:59 GMT
//! Content-type: text/html; charset=utf-8
//! Content-Length: 870
//!
//! and observe that a successful connection has been made on the Python webserver:
//!
//! ± python3 -m http.server --bind 127.0.0.1 5000 default
//! Serving HTTP on 127.0.0.1 port 5000 (http://127.0.0.1:5000/) ...
//! 127.0.0.1 - - [06/Feb/2023 15:52:20] "HEAD / HTTP/1.1" 200 -
//!
//! TOPOLOGY
//!
//! The network we establish between the control node, the edge node and the Orchestrator is the following
//!
//! get credential +-------------------------------------+
//! via secure channel | | Inlet <-- 127.0.0.1:7000
//! +---------------+ Edge node | connected to "outlet"
//! | | | via secure channel
//! | +-------------------------------------+
//! | | |
//! | | | create secure channel to control
//! | | | via the relay
//! v v |
//! +--------------+ +-------------------------------+-------+
//! | Authority | | | |
//! | | | Orchestrator | |
//! | | | | |
//! +--------------+ +---------------------- forwarder ------+
//! ^ ^ to control
//! | | ^ |
//! | | create | |
//! | | | v
//! | | | "untrusted" secure channel
//! | +---------------------------------------+ listener
//! | | |
//! +---------------| Control node | "outlet" --> 127.0.0.1:5000
//! get credential | |
//! via secure channel +---------------------------------------+
//!
//!
//! - we create initially some secure channels to the Authority in order to retrieve credential
//! based on a one-time token generated with `ockam project ticket --attribute component=<name of node>`
//!
//! - then the control node creates a relay on the Orchestrator in order to accept TCP traffic without
//! having to open a port to the internet. It also starts a channel listener ("untrusted", accept all incoming requests for now)
//!
//! - on its side the edge node starts a secure channel via relay (named "forward_to_control_plane1"), to the "untrusted" listener
//! with the secure channel address it creates an Inlet which will direct TCP traffic via the secure channel to get to the
//! control node and then to the "outlet" worker to reach the Python webserver
//!
//! - the outlet is configured to only receive messages from the edge node by checking its authenticated attributes
//! - the inlet is configured to only receive messages from the control node by checking its authenticated attributes
//!
//! IMPLEMENTATION
//!
//! The code for this example can be found in:
//!
//! - examples/11-attribute-based-authentication-control-plane.rs: for the control node
//! - examples/11-attribute-based-authentication-edge-plane.rs: for the edge node
//! - src/project.rs: read the content of the project.json file
//! - src/token.rs: generate a one-time token using the ockam command line
//!
/// unused main function
fn main() {}
2 changes: 1 addition & 1 deletion implementations/rust/ockam/ockam_abac/src/boolean_expr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -670,7 +670,7 @@ mod tests {
test_parse_error(&mut "a=\"\"", "the value can't be empty");
}

/// HELPERS
// HELPERS

/// Test the parsing of a name
fn test_parse_name(input: &str) {
Expand Down
2 changes: 1 addition & 1 deletion implementations/rust/ockam/ockam_abac/src/expr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -610,7 +610,7 @@ mod tests {
test_failure("a or b", &format!("The first identifier of the expression: `a or b` must be an operation. The available operations are: {}", OPERATORS.join(", ")));
}

/// HELPERS
// HELPERS
fn test_failure(s: &str, expected_message: &str) {
match parse(s) {
Err(e) => assert!(e.to_string().contains(expected_message)),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ mod test {
Ok(())
}

/// HELPERS
// HELPERS
async fn resource_policy_repository() -> Result<Arc<dyn ResourcePoliciesRepository>> {
Ok(Arc::new(ResourcePolicySqlxDatabase::create().await?))
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ mod test {
Ok(())
}

/// HELPERS
// HELPERS
async fn create_repository() -> Result<Arc<dyn ResourcesRepository>> {
Ok(Arc::new(ResourcesSqlxDatabase::create().await?))
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ mod test {
Ok(())
}

/// HELPERS
// HELPERS
async fn create_repository() -> Result<Arc<dyn ResourceTypePoliciesRepository>> {
Ok(Arc::new(ResourceTypePolicySqlxDatabase::create().await?))
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -523,7 +523,7 @@ pub mod tests {
result.unwrap()
}

/// HELPERS
// HELPERS

/// Create an Authority configuration with:
///
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -448,7 +448,7 @@ mod tests {
.await
}

/// HELPERS
// HELPERS
fn list_file_names(dir: &Path) -> Vec<String> {
fs::read_dir(dir)
.unwrap()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ mod tests {
assert_eq!(now_as_string(datetime("2024-03-31T12:00:00Z")), "240330");
}

/// HELPERS
// HELPERS
fn datetime(s: &str) -> DateTime<Utc> {
Utc.from_utc_datetime(&DateTime::parse_from_rfc3339(s).unwrap().naive_utc())
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use opentelemetry::Key;
use std::fmt::{Display, Formatter};

/// List of attribute keys for journey event creation
// List of attribute keys for journey event creation

pub const TCP_OUTLET_AT: &Key = &Key::from_static_str("app.tcp_outlet.at");
pub const TCP_OUTLET_FROM: &Key = &Key::from_static_str("app.tcp_outlet.from");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ mod tests {
Ok(())
}

/// HELPERS
// HELPERS
async fn create_identity(db: SqlxDatabase, name: &str) -> Result<Identity> {
let identities = identities().await?;
let identifier = identities.identities_creation().create_identity().await?;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,7 @@ mod tests {
.await
}

/// HELPERS
// HELPERS
async fn create_identity() -> Result<Identifier> {
let identities = identities().await?;
identities.identities_creation().create_identity().await
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,7 @@ mod test {
.await
}

/// HELPERS
// HELPERS
async fn create_identity() -> Result<Identifier> {
let identities = identities().await?;
identities.identities_creation().create_identity().await
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -755,7 +755,7 @@ mod test {
.await
}

/// HELPERS
// HELPERS
fn create_project(
id: &str,
name: &str,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -442,7 +442,7 @@ mod test {
use std::net::SocketAddr;
use tokio::net::TcpStream;

async fn send_http_request<'a, S: Serialize + Send, D: DeserializeOwned + Send>(
async fn send_http_request<S: Serialize + Send, D: DeserializeOwned + Send>(
request: Request<S>,
) -> Response<D> {
let host = request.uri().host().expect("uri has no host");
Expand Down
12 changes: 6 additions & 6 deletions implementations/rust/ockam/ockam_api/src/logs/default_values.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
use crate::logs::LogFormat;
use std::time::Duration;

///
/// LOGGING
///
//
// LOGGING
//

/// Log format for files. See LogFormat for other values
pub(crate) const DEFAULT_LOG_FORMAT: LogFormat = LogFormat::Default;
Expand All @@ -18,9 +18,9 @@ pub(crate) const DEFAULT_LOG_MAX_FILES: u64 = 60;
pub(crate) const DEFAULT_OPENTELEMETRY_ENDPOINT: &str =
"https://otelcoll.orchestrator.ockam.io:443";

///
/// TRACING
///
//
// TRACING
//

/// Timeout for trying to access the Telemetry collector endpoint when running a command
/// It is quite high but experimentation shows that sometimes there's quite some lag even if the endpoint is available
Expand Down
Loading

0 comments on commit 6f93085

Please sign in to comment.