From a57449dcd2abe1fa5dae195470fccc9a9a398e04 Mon Sep 17 00:00:00 2001 From: Daniel Mueller Date: Sun, 26 May 2019 22:11:36 -0700 Subject: Allow for disabling of secret caching So far we have cached secrets in gpg-agent(1) whenever that made sense to do (i.e., for the two PINs in most contexts but not for passwords). While there is reason to believe that such caching is desired by the majority of users, not everybody has a use for it. To give users an opportunity to opt out of such caching, this change introduces a new environment variable, NITROCLI_NO_CACHE, that, when present in the environment, instructs the program to bypass the cache for all operations that require a secret and to instead inquire such secrets each time they are needed. --- nitrocli/src/args.rs | 2 ++ 1 file changed, 2 insertions(+) (limited to 'nitrocli/src/args.rs') diff --git a/nitrocli/src/args.rs b/nitrocli/src/args.rs index 82e9c2a..10a097e 100644 --- a/nitrocli/src/args.rs +++ b/nitrocli/src/args.rs @@ -91,6 +91,7 @@ pub struct ExecCtx<'io> { pub new_admin_pin: Option, pub new_user_pin: Option, pub password: Option, + pub no_cache: bool, pub verbosity: u64, } @@ -929,6 +930,7 @@ pub(crate) fn handle_arguments(ctx: &mut RunCtx<'_>, args: Vec) -> Resul new_admin_pin: ctx.new_admin_pin.take(), new_user_pin: ctx.new_user_pin.take(), password: ctx.password.take(), + no_cache: ctx.no_cache, verbosity, }; command.execute(&mut ctx, subargs) -- cgit v1.2.1