3 stable releases
Uses new Rust 2024
| 2.0.1 | Nov 3, 2025 |
|---|---|
| 2.0.0 | Oct 8, 2025 |
| 1.0.0 | Sep 1, 2025 |
#1810 in Asynchronous
76,667 downloads per month
Used in 30 crates
(3 directly)
80KB
1K
SLoC
Tokio-based command execution implementation for reqsign.
This crate provides TokioCommandExecute, an async command executor that implements
the CommandExecute trait from reqsign_core using Tokio's process operations.
Overview
TokioCommandExecute enables reqsign to execute external commands asynchronously using
Tokio's process spawning capabilities. This is particularly useful when retrieving
credentials from external programs or CLI tools.
Example
use reqsign_core::Context;
use reqsign_command_execute_tokio::TokioCommandExecute;
use reqsign_file_read_tokio::TokioFileRead;
use reqsign_http_send_reqwest::ReqwestHttpSend;
#[tokio::main]
async fn main() {
// Create a context with Tokio command executor
let ctx = Context::new()
.with_file_read(TokioFileRead::default())
.with_http_send(ReqwestHttpSend::default())
.with_command_execute(TokioCommandExecute::default())
.unwrap();
// The context can now execute commands asynchronously
match ctx.command_execute("echo", &["hello", "world"]).await {
Ok(output) => {
if output.success() {
println!("Output: {}", String::from_utf8_lossy(&output.stdout));
}
}
Err(e) => eprintln!("Failed to execute command: {}", e),
}
}
Usage with Service Signers
use reqsign_core::{Context, Signer};
use reqsign_command_execute_tokio::TokioCommandExecute;
use reqsign_file_read_tokio::TokioFileRead;
use reqsign_http_send_reqwest::ReqwestHttpSend;
# async fn example() -> anyhow::Result<()> {
// Cloud services that use external credential processes need command execution
let ctx = Context::new()
.with_file_read(TokioFileRead::default())
.with_http_send(ReqwestHttpSend::default())
.with_command_execute(TokioCommandExecute::default())
?;
// Create a signer that can execute credential helper processes
// let signer = Signer::new(ctx, credential_loader, request_builder);
# Ok(())
# }
Dependencies
~8–12MB
~191K SLoC