exec_vault_read_cmd

Function exec_vault_read_cmd 

Source
pub(crate) fn exec_vault_read_cmd(vault_path: &str) -> Result<VaultReadOutput>
Expand description

Executes the vault CLI to read a secret as JSON and deserialize it.

Runs vault read <vault_path> --format=json using std::process::Command and deserializes the JSON standard output into a VaultReadOutput.

ยงErrors

  • Launching or running the vault process fails (I/O error from Command).
  • The command standard output cannot be deserialized into VaultReadOutput via serde_json.
  • The standard output is not valid UTF-8 when constructing the contextual error message.