Skip to content

Commit 2abf21e

Browse files
authored
adjust keychainAccess impls to refactored keychain api (#112)
1 parent 826e29d commit 2abf21e

File tree

3 files changed

+7
-13
lines changed

3 files changed

+7
-13
lines changed

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040

4141
<!-- runtime dependencies -->
4242

43-
<api.version>1.5.1</api.version>
43+
<api.version>1.6.0</api.version>
4444
<secret-service.version>2.0.1-alpha</secret-service.version>
4545
<kdewallet.version>1.4.0</kdewallet.version>
4646
<slf4j.version>2.0.17</slf4j.version>

src/main/java/org/cryptomator/linux/keychain/GnomeKeyringKeychainAccess.java

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package org.cryptomator.linux.keychain;
22

33
import de.swiesend.secretservice.simple.SimpleCollection;
4+
import org.cryptomator.integrations.common.DisplayName;
45
import org.cryptomator.integrations.common.OperatingSystem;
56
import org.cryptomator.integrations.common.Priority;
67
import org.cryptomator.integrations.keychain.KeychainAccessException;
@@ -14,17 +15,13 @@
1415

1516
@Priority(900)
1617
@OperatingSystem(OperatingSystem.Value.LINUX)
18+
@DisplayName("GNOME Keyring")
1719
public class GnomeKeyringKeychainAccess implements KeychainAccessProvider {
1820

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

2123
private final String LABEL_FOR_SECRET_IN_KEYRING = "Cryptomator";
2224

23-
@Override
24-
public String displayName() {
25-
return "GNOME Keyring";
26-
}
27-
2825
@Override
2926
public boolean isSupported() {
3027
try {
@@ -48,7 +45,7 @@ public boolean isLocked() {
4845
}
4946

5047
@Override
51-
public void storePassphrase(String key, String displayName, CharSequence passphrase, boolean ignored) throws KeychainAccessException {
48+
public void storePassphrase(String key, String displayName, CharSequence passphrase) throws KeychainAccessException {
5249
try (SimpleCollection keyring = new SimpleCollection()) {
5350
List<String> list = keyring.getItems(createAttributes(key));
5451
if (list == null || list.isEmpty()) {

src/main/java/org/cryptomator/linux/keychain/KDEWalletKeychainAccess.java

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package org.cryptomator.linux.keychain;
22

3+
import org.cryptomator.integrations.common.DisplayName;
34
import org.cryptomator.integrations.common.OperatingSystem;
45
import org.cryptomator.integrations.common.Priority;
56
import org.cryptomator.integrations.keychain.KeychainAccessException;
@@ -20,6 +21,7 @@
2021

2122
@Priority(900)
2223
@OperatingSystem(OperatingSystem.Value.LINUX)
24+
@DisplayName("KDE Wallet")
2325
public class KDEWalletKeychainAccess implements KeychainAccessProvider {
2426

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

35-
@Override
36-
public String displayName() {
37-
return "KDE Wallet";
38-
}
39-
4037
@Override
4138
public boolean isSupported() {
4239
return wallet.map(ConnectedWallet::isSupported).orElse(false);
@@ -48,7 +45,7 @@ public boolean isLocked() {
4845
}
4946

5047
@Override
51-
public void storePassphrase(String key, String displayName, CharSequence passphrase, boolean ignored) throws KeychainAccessException {
48+
public void storePassphrase(String key, String displayName, CharSequence passphrase) throws KeychainAccessException {
5249
CheckUtil.checkState(wallet.isPresent(), "Keychain not supported.");
5350
wallet.get().storePassphrase(key, passphrase);
5451
}

0 commit comments

Comments
 (0)