Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add option for forgetting pin after command #84

Closed
bircoph opened this issue May 25, 2019 · 6 comments
Closed

Add option for forgetting pin after command #84

bircoph opened this issue May 25, 2019 · 6 comments
Assignees

Comments

@bircoph
Copy link

bircoph commented May 25, 2019

Hi!

It would be nice to have an option to forget pin for commands requiring pin/password entrace. Of course I can call nitrocli pin clear after each such command, but it would be easier to do with an option.

Maybe it would be a good idea to have a config file support as well where users can specify their preferences including this option.

@d-e-s-o
Copy link
Owner

d-e-s-o commented May 25, 2019

I am not convinced such an option is necessary. As you said there is an easy way to achieve what you want. You can create an alias or a function or do whatever, but I don't like the idea of an option for this purpose very much.

The only thing I could live with is having a way to disable caching of PINs altogether, through whatever means work best (perhaps compile time feature; I haven't thought about possibilities here). Would that work for you @bircoph ?

@bircoph
Copy link
Author

bircoph commented May 25, 2019

Yes. Disabling pin cache completely will work for me.

Though I prefer this feature to be configurable run-time. Let's consider nitrocli within Linux distro: some users may want to have it disabled and some may want to have the cache enabled. It's not a problem for Gentoo, but binary distributions will want to have universal binary available.

@robinkrahl
Copy link
Collaborator

I think the best solution would be to allow the user to set the cache TTL (or -1 to disable caching). Unfortunately, only gpg-agent’s PRESET_PASSPHRASE command has an option for the TTL (we use GET_PASSPHRASE). So as far as I see, there is no way to disable caching (other than not using gpg-agent at all or changing gpg-agent’s global configuration).

@d-e-s-o
Copy link
Owner

d-e-s-o commented May 27, 2019

I agree that run time configurability would be nice. Even more so if having a compile time feature does not reduce the number of dependencies (I don't think that would be possible here).

So as far as I see, there is no way to disable caching (other than not using gpg-agent at all or changing gpg-agent’s global configuration).

Hm, I thought we already support circumventing the cache?

// "X" is a sentinel value indicating that no caching is desired.

@d-e-s-o d-e-s-o self-assigned this May 27, 2019
@d-e-s-o
Copy link
Owner

d-e-s-o commented May 27, 2019

I believe the existing infrastructure provides what we need. I've created #86 that should do what you are asking for. I am honoring a new environment variable, NITROCLI_NO_CACHE to disable the caching at run time.

@bircoph mind giving it a try?

@d-e-s-o
Copy link
Owner

d-e-s-o commented Jun 1, 2019

I merged the change.

@d-e-s-o d-e-s-o closed this as completed Jun 1, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants