-
Notifications
You must be signed in to change notification settings - Fork 94
Move default location for credentials to .near-credentials #339
Conversation
Also fix an issue that login is not honoring the system-wide keystore and creating its own version.
Tested (on windows)
|
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.
This is a great idea! I was just thinking about something like this yesterday. But I thought the implementation might look a little different and I want to hold this up with a conversation, if I can.
A couple ideas for changing this:
- Why limit it to only storing credentials in the home directory? What if I want to be logged in with certain credentials most of the time, but override for certain projects/folders? We could make this look for
.near-credentials
in the current directory, and if none found, the next directory up, and so forth up to~
(or maybe/
but we'd probably run into permissions issues), and finally, at the end of the chain, the old./neardev
location. - Do we only want to store credentials in here? Could we make this a
.nearconfig
and make it use a toml format (or toml-like, as with.gitconfig
)?
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.
Wow, I'm surprised how little code this took when you use MergeKeyStore! Awesome 🙌
I think this is good stop-gap before we approve and implement the NEP where the key management does have an order of lookups described: We're at that odd spot where the NEP isn't "approved" but we could really use some of the functionality. I think this is a PR that will grow into the NEP. For instance, the NEP states that keys be in |
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.
Sounds good to me
These are all good options, the question is more of timing (i.e. specifically do we want to do all that before RL1 or not -- I thought we decided in a quick chat on Tuesday that we want to move to home dir right now). Maybe let's have this discussion in near/NEPs#31? |
@chadoh I'm not convinced we should use toml. Other than that I agree with @janedegtiareva that this is out of scope for this PR. Thanks for getting backwards compatibility for |
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.
Looks good to me, ./neardev
seems to work fine as well.
@janedegtiareva lint issues, but then ship it, Captain |
Also fix an issue that login is not honoring the system-wide keystore
and creating its own version.
The new location for keys is, for example on windows with default env: C:\Users\userid.near-credentials\default