-
-
Notifications
You must be signed in to change notification settings - Fork 1
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
Trying to retrieve token from Keyring causes an error on WSL2 #39
Comments
I think ghr should also support the fallback to non-secure storage if the official gh CLI support it. I am going to de-deprecate retrive_token in gh-config-rs then switch to use it in ghr. |
After taking a look at: I rethinked about how to retrieve a token and use it to communicate with github. gh-cli delegates how to retrieve auth token naively to go-gh, and tries to retrieve token from secure storage last. Acknowledging the above, I believe the concise way to handle tokens should be: gh-config (aims to be consistent with cli/cli and cli/go-gh): (go-gh and cli both ignores any error occurred while searching tokens)
tools using this library (e.g. ghr):
and use the first available token I think this guideline might be helpful to make decisions on future development of this library and tools that use this library. |
Regarding the above, will there be a problem if I made a PR to support this? |
@s3i7h Sorry for the late response. I prepared a PR to add support of the env variables in retrieve_token or dedicated retrieve_token_from_env. Could you please review the PR to confirm the changes will resolve this issue? |
sure thing! I'll get to it tonight. Thank you for the implementation |
feat!: Revert deprecating retrieve_token, adding support of environment variables
Although WSL provides a lot of features available in Linux, dbus is not well-supported (microsoft/WSL#8842) and causes the following error:
and even if you work-around it (by logging into wsl with
wsl.exe -u root -- su <USER>
) and created the proper dbus, there will be another error:Currently gh-config's implementation returns Err when Keyring returns an error as
self.retrieve_token_secure(hostname)?
, but I would personally like gh-config to fall back to retrieving tokens naively from yaml files. I'm not sure how to properly handle this error so I'd appreciate thoughts over this issue. Maybe returning Ok(None) when Keyring fails connecting to dbus or fails to find a service?gh-config-rs/src/lib.rs
Lines 172 to 184 in a8157c0
The text was updated successfully, but these errors were encountered: