Skip to content

Adjust keychainAccess impls to refactored keychain api #112

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

Merged
merged 1 commit into from
May 30, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@

<!-- runtime dependencies -->

<api.version>1.5.1</api.version>
<api.version>1.6.0</api.version>
<secret-service.version>2.0.1-alpha</secret-service.version>
<kdewallet.version>1.4.0</kdewallet.version>
<slf4j.version>2.0.17</slf4j.version>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package org.cryptomator.linux.keychain;

import de.swiesend.secretservice.simple.SimpleCollection;
import org.cryptomator.integrations.common.DisplayName;
import org.cryptomator.integrations.common.OperatingSystem;
import org.cryptomator.integrations.common.Priority;
import org.cryptomator.integrations.keychain.KeychainAccessException;
Expand All @@ -14,17 +15,13 @@

@Priority(900)
@OperatingSystem(OperatingSystem.Value.LINUX)
@DisplayName("GNOME Keyring")
public class GnomeKeyringKeychainAccess implements KeychainAccessProvider {

private static final Logger LOG = LoggerFactory.getLogger(GnomeKeyringKeychainAccess.class);

private final String LABEL_FOR_SECRET_IN_KEYRING = "Cryptomator";

@Override
public String displayName() {
return "GNOME Keyring";
}

@Override
public boolean isSupported() {
try {
Expand All @@ -48,7 +45,7 @@ public boolean isLocked() {
}

@Override
public void storePassphrase(String key, String displayName, CharSequence passphrase, boolean ignored) throws KeychainAccessException {
public void storePassphrase(String key, String displayName, CharSequence passphrase) throws KeychainAccessException {
try (SimpleCollection keyring = new SimpleCollection()) {
List<String> list = keyring.getItems(createAttributes(key));
if (list == null || list.isEmpty()) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package org.cryptomator.linux.keychain;

import org.cryptomator.integrations.common.DisplayName;
import org.cryptomator.integrations.common.OperatingSystem;
import org.cryptomator.integrations.common.Priority;
import org.cryptomator.integrations.keychain.KeychainAccessException;
Expand All @@ -20,6 +21,7 @@

@Priority(900)
@OperatingSystem(OperatingSystem.Value.LINUX)
@DisplayName("KDE Wallet")
public class KDEWalletKeychainAccess implements KeychainAccessProvider {

private static final Logger LOG = LoggerFactory.getLogger(KDEWalletKeychainAccess.class);
Expand All @@ -32,11 +34,6 @@ public KDEWalletKeychainAccess() {
this.wallet = ConnectedWallet.connect();
}

@Override
public String displayName() {
return "KDE Wallet";
}

@Override
public boolean isSupported() {
return wallet.map(ConnectedWallet::isSupported).orElse(false);
Expand All @@ -48,7 +45,7 @@ public boolean isLocked() {
}

@Override
public void storePassphrase(String key, String displayName, CharSequence passphrase, boolean ignored) throws KeychainAccessException {
public void storePassphrase(String key, String displayName, CharSequence passphrase) throws KeychainAccessException {
CheckUtil.checkState(wallet.isPresent(), "Keychain not supported.");
wallet.get().storePassphrase(key, passphrase);
}
Expand Down