mirror of
https://github.com/jpochyla/psst.git
synced 2026-04-27 15:35:56 +03:00
[GH-ISSUE #32] Store user credentials in the system keychain #25
Labels
No labels
api
bug
build
documentation
duplicate
enhancement
good first issue
help wanted
idea
invalid
linux
lowprio
macos
pull-request
upstream
windows
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/psst#25
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @auravoid on GitHub (Feb 2, 2021).
Original GitHub issue: https://github.com/jpochyla/psst/issues/32
Saving the authentication credentials to the disk in a config file is great, but saving them raw is a bit insecure. It would be really helpful if the passwords get encrypted for user's privacy and safety.
@jpochyla commented on GitHub (Feb 2, 2021):
I understand the sentiment, but we don't really have any key to encrypt with, and it's not really different from all the other stored passwords in other apps. One possible solution would be to use the platform capabilities for this, i.e. Keychain Access on Mac, through the keyring crate: https://crates.io/crates/keyring. PRs welcome!
@SpyrosRoum commented on GitHub (Feb 6, 2021):
Hey, looking at the keyring crate, this looks easy enough so I'm gonna give it a try!
@SpyrosRoum commented on GitHub (Feb 6, 2021):
I have one question @jpochyla
How do you want to handle the transition from "Password stored in config file" to "Use keyring"?
I am thinking for the next release we make the
passwordfield inConfigto only be de-serializable but not serializable so we can read it but not write it.Additionally we will save it in the keyring if it's not already there and we will delete it from the file.
In the next release we will tell serde to completely skip the password and we can remove some code since we will now assume the the password is either in the keyring or nowhere.
This way we give a transactional period for user and we will only have issues if a user skips the next release.
Alternatively we can tell serde to skip the
passwordand just force the user to tell us the password again so we can save it in the keyring.Thoughts?
@jpochyla commented on GitHub (Mar 10, 2021):
@BachoSeven commented on GitHub (Mar 10, 2021):
@jpochyla Perhaps we could take inspiration from the (recent) switch that
ncspothas made, from storing plaintext(albeit base64-encoded) credentials to a librespot token (seegithub.com/hrkfdn/ncspot@d6db7a54d6).Original ncspot issue for reference: https://github.com/hrkfdn/ncspot/issues/447
@jpochyla commented on GitHub (Mar 13, 2021):
@BachoSeven Yup!
masteris now storing the token instead of user credentials. Unfortunately it means users need to re-authenticate.