@@ -26,6 +26,13 @@ use thiserror::Error;
2626/// It does not contain information about the outcome of the execution,
2727/// like the exit code or the duration of the execution. It only contains
2828/// the information that is necessary to reproduce the execution.
29+ ///
30+ /// # Fields
31+ /// - `executable`: The path to the executable that was run.
32+ /// - `arguments`: The command line arguments that were passed to the executable.
33+ /// Includes the executable itself as the first argument.
34+ /// - `working_dir`: The current working directory of the process.
35+ /// - `environment`: The environment variables that were set for the process.
2936#[ derive( Serialize , Deserialize , Debug , PartialEq , Clone ) ]
3037pub struct Execution {
3138 pub executable : PathBuf ,
@@ -39,6 +46,10 @@ impl Execution {
3946 ///
4047 /// This method retrieves the executable path, command-line arguments,
4148 /// current working directory, and environment variables of the process.
49+ ///
50+ /// **Security Note**: This method captures ALL environment variables from
51+ /// the current process, which may include sensitive information. Consider
52+ /// using the `trim()` method to filter to only relevant environment variables.
4253 pub fn capture ( ) -> Result < Self , CaptureError > {
4354 let executable = std:: env:: current_exe ( ) . map_err ( CaptureError :: CurrentExecutable ) ?;
4455 let arguments = std:: env:: args ( ) . collect ( ) ;
0 commit comments