From 21da7b782e4cb0faefb19c4cad982e2b66101a29 Mon Sep 17 00:00:00 2001 From: Alex Clarke Date: Sun, 1 Feb 2026 14:47:43 -0700 Subject: [PATCH] fix: Secrets are now stored exactly as passed without newlines stripped --- src/bin/gman/main.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/bin/gman/main.rs b/src/bin/gman/main.rs index 73175ad..f4cf0fa 100644 --- a/src/bin/gman/main.rs +++ b/src/bin/gman/main.rs @@ -4,12 +4,12 @@ use crate::cli::secrets_completer; use anyhow::{Context, Result}; use clap::Subcommand; use clap::{ - CommandFactory, Parser, ValueEnum, crate_authors, crate_description, crate_name, crate_version, + crate_authors, crate_description, crate_name, crate_version, CommandFactory, Parser, ValueEnum, }; use clap_complete::{ArgValueCompleter, CompleteEnv}; use crossterm::execute; -use crossterm::terminal::{LeaveAlternateScreen, disable_raw_mode}; -use gman::config::{Config, get_config_file_path, load_config}; +use crossterm::terminal::{disable_raw_mode, LeaveAlternateScreen}; +use gman::config::{get_config_file_path, load_config, Config}; use std::ffi::OsString; use std::io::{self, IsTerminal, Read, Write}; use std::panic::PanicHookInfo; @@ -159,7 +159,7 @@ async fn main() -> Result<()> { let plaintext = read_all_stdin().with_context(|| "unable to read plaintext from stdin")?; secrets_provider - .set_secret(&name, plaintext.trim_end()) + .set_secret(&name, &plaintext) .await .map(|_| match cli.output { Some(_) => (), @@ -190,7 +190,7 @@ async fn main() -> Result<()> { let plaintext = read_all_stdin().with_context(|| "unable to read plaintext from stdin")?; secrets_provider - .update_secret(&name, plaintext.trim_end()) + .update_secret(&name, &plaintext) .await .map(|_| match cli.output { Some(_) => (),