Use without keyring
lzap opened this issue · 3 comments
Hey, I don't use keyring actively, I have gnome-keyring installed however is is empty. Now, when I started my bar for the first time, it asked for a password which I gave it. Honestly I am not even sure if it was correct, however it does not ask anymore. Everytime I try to start my gnome keyring it crashes so I have no idea what's stored there.
Now, I configured my github oauth in my code but I am getting error: open /home/xxx/.config/barista/oauth/github.com_XXXX-XXXX.json: no file or directory
all the time and the module does not work. I struggle to understand how this really works:
- How this is related to github? I gave the module both secret and token?
- What should create this file and when?
- Is there some way not using keyring and simply storing those on my filesystem? I am willing to accept the risk.
Thanks for explanation
How this is related to github? I gave the module both secret and token?
You should not be able to specify the token directly, since it can expire and embedding it in the binary would require frequent re-compiling.
In the binary you can specify the Client ID and Secret, both of which are only specific to the application, but not a user. You can then store a token using my-bar setup-oauth
, which will prompt you to login and grant permissions to the app to access your account.
What should create this file and when?
The bar will create this file when run with the setup-oauth
argument, and will update this file with a fresh token anytime the currently stored token expires.
Is there some way not using keyring and simply storing those on my filesystem? I am willing to accept the risk.
If you're building from source, then you can just replace
barista/samples/sample-bar/sample-bar.go
Lines 203 to 233 in 90a3419
func setupOauthEncryption() error {
oauth.SetEncryptionKey([]byte{/* some random numbers, e.g. */ 151,196,88,136,147,3,152})
return nil
}
This would skip the keyring entirely, and still keep the tokens somewhat secure, if you permission the go file appropriately. Storing unencrypted tokens is not something I want to support/enable here.
Thanks for explanation, the encryption key built into the binary is fine for me, I actually love that. My HDD is encrypted anyway and it's a PC.
However when I try to configure oauth, github gives me 404:
Oh I had to create those on my account. Thanks!