index : bitwarden-ssh-agent.git

ascending towards madness

author holly sparkles <sparkles@holly.sh> 2023-08-02 8:09:49.0 +00:00:00
committer holly sparkles <sparkles@holly.sh> 2023-08-02 8:09:49.0 +00:00:00
commit
c310d5376fb3ad7e181487910d269c7e1169259b [patch]
tree
d946f0bc87582b2f99ffbb0b10ec7fb42512fe13
parent
36f8f9a9bd23614c7fea302b0aef3e11af75baea
download
c310d5376fb3ad7e181487910d269c7e1169259b.tar.gz

fix: fixed the `--key` argument not being used



Diff

 src/main.rs | 4 +---
 src/util.rs | 2 +-
 2 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/src/main.rs b/src/main.rs
index f9517c8..fa331ee 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -7,8 +7,6 @@ mod bwutil;

/// Environment variable housing an existing Bitwarden session.
const SESSION_ENV_KEY: &str = "BW_SESSION";
/// Environment variable referencing the name of the field containing the SSH key filename. 
const BW_FIELD_KEY_FILENAME: &str = "private";
/// Environment variable referencing the name of the field containing the SSH key passphrase (if any).
const BW_FIELD_KEY_PASSPHRASE: &str = "passphrase";

@@ -43,7 +41,7 @@ fn main() -> Result<()> {
					let mut key_filename = String::new();
					let mut key_passphrase = String::new();
					for field in fields {
						if field.name.to_lowercase().eq(&String::from(BW_FIELD_KEY_FILENAME).to_lowercase()) {
						if field.name.to_lowercase().eq(&args.key.to_lowercase()) {
							key_filename.push_str(&field.value);
						}
						if field.name.to_lowercase().eq(&String::from(BW_FIELD_KEY_PASSPHRASE).to_lowercase()) {
diff --git a/src/util.rs b/src/util.rs
index 9421fed..a9c551d 100644
--- a/src/util.rs
+++ b/src/util.rs
@@ -11,7 +11,7 @@ pub struct Cli {
	pub debug: bool,
	#[options(help = "folder name to use to search for SSH keys", default = "ssh-agent")]
	pub folder: String,
	#[options(help = "custom field name where the private key is stored", meta = "PRIVATE_KEY", default = "private-key")]
	#[options(help = "custom field name where the private key filename is stored", meta = "NAME", default = "private")]
	pub key: String,
	#[options(help = "custom field name where the key passphrase is stored", meta = "PASS", default = "passphrase")]
	pub passphrase: String,