generated from napi-rs/package-template
-
-
Notifications
You must be signed in to change notification settings - Fork 2
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
Fall back to keyutils if secret-service not available in Linux #12
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Brooooooklyn
approved these changes
Jul 10, 2023
The lint issue should be fixed, and hopefully the broken freebsd build as well. Could you please approve the workflow run? |
Haha, geez, okay. This time I have faith :D |
All green! I can't press the merge button, so if you would go ahead and merge and release when you have the chance, I would appreciate it. 😃 |
shantanuraj
added a commit
to watercooler-labs/toggl-cli
that referenced
this pull request
Sep 6, 2024
- Update keyring package. - Fallsback to keyutils if secure storage cannot be accessed. Usually happens on headless environments or WSL on windows Context: Brooooooklyn/keyring-node#12 Closes #72
shantanuraj
added a commit
to watercooler-labs/toggl-cli
that referenced
this pull request
Sep 6, 2024
- Update keyring package. - Fallsback to keyutils if secure storage cannot be accessed. Usually happens on headless environments or WSL on windows Context: Brooooooklyn/keyring-node#12 Closes #72
shantanuraj
added a commit
to watercooler-labs/toggl-cli
that referenced
this pull request
Sep 6, 2024
- Update keyring package. - Fallsback to keyutils if secure storage cannot be accessed. Usually happens on headless environments or WSL on windows Context: Brooooooklyn/keyring-node#12 Closes #72
shantanuraj
added a commit
to watercooler-labs/toggl-cli
that referenced
this pull request
Sep 6, 2024
* 🎩 Report underlying error when credential write or delete fails * 🔑 Enable `linux-default-keyutils` feature for keyring - Update keyring package. - Falls back to keyutils if secure storage cannot be accessed. Usually happens on headless environments or WSL on windows * 🏚️ Fix lint, drop usage of legacy numeric constant Context: Brooooooklyn/keyring-node#12 Closes #72
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When using this library from the context of WSL, where gnome-keyring etc is not available, it fails with a generic error along the lines of:
Even after installing gnome-keyring, you still get an error like:
Reading the keyring-rs source, it pretty much sounds like using Secret Service from a headless environment is not going to work. Since I'm using this library from the context of a cross-platform CLI, where some of my users are using WSL2, I need a way to use keyutils instead. So I've implemented a custom CredentialBuilder for Linux, that tries to use Secret Service but falls back to keyutils if Secret Service doesn't work, based on this comment
I haven't implemented this same support for the
find_credentials
functions, as I can't really figure out what it's trying to do or why it isn't using keyring-rs. In my case I'm not usingfind_credentials
, so having at least partial support for headless Linux is enough for me. The tests are passing in WSL2 if I remove the calls tofind_credentials
and instead testget_password
,set_password
anddelete_password
etc.I'm definitely no rust developer, so let me know if something about this is wonky.