-
Notifications
You must be signed in to change notification settings - Fork 77
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
Feat/os keychain followup #1770
base: feat/os_keychain
Are you sure you want to change the base?
Conversation
244508d
to
a97ccbb
Compare
072a3af
to
e120595
Compare
df3543a
to
3311a50
Compare
6a4b0ff
to
f263d8d
Compare
c39bf60
to
fe02078
Compare
c0bfc66
to
f4e2913
Compare
f4e2913
to
3acc3d0
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I still need to try this out locally, but correct me if I'm wrong, but it's possible to have the name used in keys add
differ from what is used in entry-name
?
Good call! Yeah, at the moment, this is possible. It still ends up working because we are saving the value of Though, this may be confusing. 🤔 Instead, we could remove the But, now I'm starting to wonder if we shouldn't allow users to add keys from the keychain at all. If we do, we'd need to make sure that users add the keys to their secure store with:
And we could probably do that, but I'm not sure how necessary this feature is. 🤔 |
Since we are now planning to store the seed phrase instead of the signing key in the OS secure storage, I think that a more useful feature would be to allow a user to add a new key with their seed phrase, which is saved in secure storage instead of in the local file. So the command could look like this:
which would then prompt the user to enter their seed phrase or secret key, as is the default behavior of
|
config::{address::KeyName, locator, secret::{self, Secret}}, print::Print, signer::keyring::{self, StellarEntry} | ||
}; | ||
|
||
pub struct SecureStore {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not sure if this needs its own mod, but wanted to pull the code out where both add
and generate
could use it
let secret_key = read_password()?; | ||
|
||
if self.secure_store { | ||
// TODO: if secret_key is a private key, this will return error for now |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Curious to hear what others think - but I think that we'll be able to let user's create new keys that are stored in the OS secure storage, and the values saved can be either private keys or seed phrases. That is not quite supported yet here, but I think its possible. Does that make sense, or is it too confusing?
The only downside i'm seeing right now is that when we add the ability to fetch the seed phrase for a key, we'll need to return an error if the user entered their private key directly.
What
This PR is based on #1703 and adds some additional compatibility with the secure store like
keys rm
andkeys add
.keys rm
keys add
cargo run keys add --secure-store --entry-name alice alice
cargo run keys address alice
stello keys rm alice
cargo run keys add --secure-store --entry-name alice alice
cargo run keys address alice
stello keys rm alice
cargo run keys add --secure-store --entry-name alice alice
cargo run keys address alice
stello keys rm alice
Why
I wanted to keep #1703 from getting too big so it was easier to review.
Known limitations
[TODO or N/A]