r-lib / keyring

:closed_lock_with_key: Access the system credential store from R
https://keyring.r-lib.org/
Other
196 stars 28 forks source link

Secrets are deleted when unchecking 'Remember with keyring' in `rstudioapi::askForSecret()` #109

Closed nwstephens closed 2 years ago

nwstephens commented 3 years ago

Cross posting this to https://github.com/rstudio/rstudioapi/pull/226, because it's hard to tell if the issue is with the rstudioapi package or the keyring package.

nwstephens commented 3 years ago

This issue occurs with the current rstudioapi and keyring packages on CRAN. When a user unchecks the box Remember with keyring it also deletes the secret from the keyring. This is unexpected, especially now that askForPassword calls askForSecret. I would not expect the secret to be deleted when unchecking the box. Instead, I would expect to return the password and leave the secret in the keychain (in essence, I would expect to fall back to askForPassword).

nwstephens commented 3 years ago

This also raises the question of how to delete secrets in the keyring. From the console, I would just run key_delete(). With the dialogs, you could prompt the user to delete the secret when the entering a NULL value in the input window -- but I personally don't think that's necessary. Until there is a more complete UX for managing secrets in the IDE, I think issuing key_delete() is sufficient for deleting secrets.

gaborcsardi commented 2 years ago

I am fairly sure that this is not an issue with keyring, and it does not delete keys unless you explicitly call key_delete()

But please reopen if you think I am wrong.