Skip to content
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

Add UI option to choose between the different backends to save passwords on Linux #1301

Closed
purejava opened this issue Aug 14, 2020 · 10 comments
Assignees
Labels
misc:gui type:feature-request New feature or request
Milestone

Comments

@purejava
Copy link
Contributor

Cryptomator has the ability to save passwords in system keychains.
On Linux, this does work for the GNOME desktop environment and KDE.
To be precise: either gnome-keyring or kwalletd needs to be installed and configured, as they function as the backends to store passwords.

Right now, Cryptomator tests on start-up, if either one of the two is available and uses this backend from then on.

private static Optional<KeychainAccessStrategy> constructKeychainAccess() {
try { // is kwallet or gnome-keyring installed?
Class<?> clazz = Class.forName("org.cryptomator.keychain.LinuxKDEWalletKeychainAccessImpl");
KeychainAccessStrategy instance = (KeychainAccessStrategy) clazz.getDeclaredConstructor().newInstance();
if (instance.isSupported()) return Optional.of(instance);
clazz = Class.forName("org.cryptomator.keychain.LinuxSecretServiceKeychainAccessImpl");
instance = (KeychainAccessStrategy) clazz.getDeclaredConstructor().newInstance();
return Optional.of(instance);
} catch (Exception e) {
return Optional.empty();
}
}

It would be nice, if there was an UI option to choose and change on the fly, which backend should be used.

This idea occurred here.

@purejava purejava added the type:feature-request New feature or request label Aug 14, 2020
@infeo infeo added this to the 1.5.x milestone Aug 26, 2020
@purejava
Copy link
Contributor Author

We need the changes for secret-service described here being released, before we can implement this new feature.

@BeyerMart BeyerMart self-assigned this Sep 18, 2020
@purejava
Copy link
Contributor Author

Design decision

Would you prefer an application wide setting or per vault, to change between the different backends while on Linux?

@tobihagemann
Copy link
Member

Not an easy decision at all. I would've thought that an application-wide setting would be the least confusing because you usually won't use multiple keychains for the same application. However, we don't have anything password/keychain-related in "Preferences" yet. But we do have a password section in "Vault Options". Hm... @overheadhunter, what do you think?

@overheadhunter
Copy link
Member

Should be application-wide. The only reason I can think of, why one should use different keychains for different vaults is due to legacy keychain entries from before kwallet support was added. Affected users can then still migrate this manually. Normally there should be only one keychain in use.

@BeyerMart
Copy link
Contributor

Yes, I agree with this perspective.
I think one would like to use a keychain for all the same vaults.

@tobihagemann
Copy link
Member

All right, I guess it's a "General" dropdown setting in the application-wide "Preferences" then. 😄

@purejava
Copy link
Contributor Author

Thanks for the directions. 😃👏🏻

@BeyerMart
Copy link
Contributor

Wow @purejava your solution looks great. Thank you for your contribution.
I tried to store a List of Optional as "delegate", but that would mean refactoring every method of LinuxSystemKeychainAccess.

@purejava
Copy link
Contributor Author

purejava commented Oct 7, 2020

Thanks for the flowers @BeyerMart! 😃
The change is still under development and I'll explain the design desicions in the upcoming PR and let you comment on the change.

overheadhunter pushed a commit that referenced this issue Nov 2, 2020
* Add option to choose from available password backends on Linux
Implements #1301
overheadhunter added a commit that referenced this issue Nov 5, 2020
@overheadhunter overheadhunter modified the milestones: 1.5.x, 1.5.9 Nov 5, 2020
@overheadhunter
Copy link
Member

Fixed in #1375 (Linux) and refined in #1393 (for macOS, Windows)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
misc:gui type:feature-request New feature or request
Projects
None yet
Development

No branches or pull requests

5 participants