-
-
Notifications
You must be signed in to change notification settings - Fork 53
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
[feature request] gracefully handle Secret Service absence #25
Comments
ah, sorry I didn't respond! I thought I had. I like this idea, I'll try to implement this soon. As for the gmp dependency, removing that is part of a long-awaited refactor. |
hmmm... I thought more about the "file not found" error. I'm not sure how to handle this inside the library. secret service has to dynamically link libdbus, and from my understanding shared libraries are loaded before symbols in the executable. The solution that comes to mind first is to put the keyring dependency behind a feature flag. Let me know if you have any other ideas; I'm definitely not an expert in building and linking against shared libraries. |
Hmm yeah I see how that gets complicated... This looks relevant though: https://www.reddit.com/r/rust/comments/3hrzsk/optionalruntime_loading_of_system_libraries/ |
Interesting; am I correct in thinking that this would have to be implemented at the level of the wrapper around libdbus, or would a check at a higher level (in |
It looks like you could check in keyring pretty easily: https://doc.rust-lang.org/1.0.0/std/dynamic_lib/struct.DynamicLibrary.html. It would involve a limited bit of |
I don’t have the bandwidth to look into this right now, but it’s something I can look at for my next round of maintenance. |
This looks like a candidate for an error code and improved handling in #70. I'll take a look. |
So I've done the research and I stand corrected about this having anything to do with error handling. Although the Rust infrastructure for using dynamically loaded libraries has gotten pretty good over time, it would still be a tremendous amount of work for us to use secret-service this way. In fact, I believe it would be far easier for our clients to use this approach with keyring than for us to use it with secret-service. That is, if you want to make an application that uses keyring when secret-service available, then:
I'm going to close this request as an enhancement that we won't fix. |
There are a number of scenarios in which there's either no Secret Service running on the machine or it's not available, eg. running in a Docker image. When trying to run an executable that depends on keyring-rs, the shell will respond with simply "No such file or directory". Debugging a bit shows us that the binary can't be run without gmp and dbus-1 available on the host system:
It would be nice to be able to actually run the executable but return an error at runtime when the program attempts to access the keyring.
The text was updated successfully, but these errors were encountered: