feat(config): added initial keyring support (#83)#350
feat(config): added initial keyring support (#83)#350kangasta merged 9 commits intoUpCloudLtd:mainfrom
Conversation
|
Thanks for the pull request! We'll do some testing with this and let's discuss what would be the best approach to get this merged. We are also working on adding tokens support for authentication (product radar), so probably best to start with minimal implementation, like you described above, and add more features once the initial functionality is on the main. |
kangasta
left a comment
There was a problem hiding this comment.
Did some testing with this and seems to work nicely on mac 👍 We'll have to still confirm that this does not have conflicts with the upcoming API tokens feature.
Added one comment about the unittest and seems that at least the ubuntu test workflow needs a step for installing keyring support. I guess something like the snippet below would work for that 🤔
- name: Install keyring test dependencies on Ubuntu
run: apt install gnome-keyring
if: matrix.os == 'ubuntu-latest'… workflow test to support keyring
|
We now have the initial token support available in v3.15.0, so I added option to read token from the keyring when no credentials are defined. I also changed the service name to |
villevsv-upcloud
left a comment
There was a problem hiding this comment.
Tested locally on Linux with Kwallet.
This PR adds initial support for the keyring.
I used zalando/go-keyring because of recent commits on repo (compared to 99designs/keyring).
When I say initial, I mean it's open for discussion and adding more features (create auth command and save it to keyring?).
How it works:
If a username is set and the password is empty, check the keyring for service
upctlwhere the username is coming either from the config file or env.This type of logic does not break current.
Problem:
This PR does not read the username from the keyring, so it still needs a username from config or env. Maybe to introduce a config command
--keyring?For me, it works by using UPCLOUD_USERNAME and creating username/password upctl services on keyring so I can switch easily between accounts without providing passwords.