Skip to content

Commit 8a4954e

Browse files
committed
Review.
1 parent 5dc0d63 commit 8a4954e

File tree

6 files changed

+21
-29
lines changed

6 files changed

+21
-29
lines changed

core/pom.xml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@
2323
<artifactId>core</artifactId>
2424
<packaging>jar</packaging>
2525

26+
<properties>
27+
<nimbus-jose.version>10.5</nimbus-jose.version>
28+
</properties>
29+
2630
<build>
2731
<plugins>
2832
<plugin>
@@ -144,6 +148,11 @@
144148
<artifactId>auto-service-annotations</artifactId>
145149
<version>1.1.1</version>
146150
</dependency>
151+
<dependency>
152+
<groupId>com.nimbusds</groupId>
153+
<artifactId>nimbus-jose-jwt</artifactId>
154+
<version>${nimbus-jose.version}</version>
155+
</dependency>
147156
<dependency>
148157
<groupId>junit</groupId>
149158
<artifactId>junit</artifactId>
Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package ch.cyberduck.core.cryptomator.impl.uvf;
1+
package ch.cyberduck.core.vault;
22

33
/*
44
* Copyright (c) 2002-2025 iterate GmbH. All rights reserved.
@@ -20,17 +20,10 @@
2020
import ch.cyberduck.core.PasswordCallback;
2121
import ch.cyberduck.core.exception.LoginCanceledException;
2222

23-
public class JWKCallback implements PasswordCallback {
23+
public interface JWKCallback extends PasswordCallback {
2424

2525
@Override
26-
public void close(final String input) {
27-
28-
}
29-
30-
@Override
31-
public JWKCredentials prompt(final Host bookmark, final String title, final String reason, final LoginOptions options) throws LoginCanceledException {
32-
return null;
33-
}
26+
JWKCredentials prompt(Host bookmark, String title, String reason, LoginOptions options) throws LoginCanceledException;
3427

3528
static JWKCallback cast(PasswordCallback callback) {
3629
if(callback instanceof JWKCallback) {
Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package ch.cyberduck.core.cryptomator.impl.uvf;
1+
package ch.cyberduck.core.vault;
22

33
/*
44
* Copyright (c) 2002-2025 iterate GmbH. All rights reserved.
@@ -15,20 +15,18 @@
1515
* GNU General Public License for more details.
1616
*/
1717

18-
import ch.cyberduck.core.vault.VaultCredentials;
19-
2018
import com.nimbusds.jose.jwk.JWK;
2119

2220
public class JWKCredentials extends VaultCredentials {
2321

24-
private final JWK keyset;
22+
private final JWK key;
2523

26-
public JWKCredentials(final JWK keyset) {
24+
public JWKCredentials(final JWK key) {
2725
super(null);
28-
this.keyset = keyset;
26+
this.key = key;
2927
}
3028

31-
public JWK getKeyset() {
32-
return keyset;
29+
public JWK getKey() {
30+
return key;
3331
}
3432
}

core/src/main/java/ch/cyberduck/core/vault/VaultMetadataProvider.java

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,5 @@
1616
*/
1717

1818
public interface VaultMetadataProvider {
19-
20-
//Map<Path, byte[]> metadataFiles() throws BackgroundException;
21-
22-
//String dirPath();
19+
// Marker interface
2320
}

cryptomator/pom.xml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626

2727
<properties>
2828
<cryptolib.version>2.3.0.uvfdraft-SNAPSHOT</cryptolib.version>
29-
<nimbus-jose.version>10.5</nimbus-jose.version>
3029
</properties>
3130

3231
<dependencies>
@@ -47,11 +46,6 @@
4746
<artifactId>cryptolib</artifactId>
4847
<version>${cryptolib.version}</version>
4948
</dependency>
50-
<dependency>
51-
<groupId>com.nimbusds</groupId>
52-
<artifactId>nimbus-jose-jwt</artifactId>
53-
<version>${nimbus-jose.version}</version>
54-
</dependency>
5549
<dependency>
5650
<groupId>com.auth0</groupId>
5751
<artifactId>java-jwt</artifactId>

cryptomator/src/main/java/ch/cyberduck/core/cryptomator/impl/uvf/CryptoVault.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
import ch.cyberduck.core.features.Write;
3838
import ch.cyberduck.core.preferences.PreferencesFactory;
3939
import ch.cyberduck.core.transfer.TransferStatus;
40+
import ch.cyberduck.core.vault.JWKCallback;
4041
import ch.cyberduck.core.vault.VaultException;
4142
import ch.cyberduck.core.vault.VaultMetadata;
4243
import ch.cyberduck.core.vault.VaultMetadataProvider;
@@ -134,7 +135,7 @@ public CryptoVault load(final Session<?> session, final PasswordCallback callbac
134135
final JWEObjectJSON jweObject;
135136
try {
136137
jweObject = JWEObjectJSON.parse(new String(metadataProvider.getMetadata(), StandardCharsets.US_ASCII));
137-
jweObject.decrypt(new MultiDecrypter(jwk.prompt(session.getHost(), StringUtils.EMPTY, StringUtils.EMPTY, new LoginOptions()).getKeyset()));
138+
jweObject.decrypt(new MultiDecrypter(jwk.prompt(session.getHost(), StringUtils.EMPTY, StringUtils.EMPTY, new LoginOptions()).getKey()));
138139
}
139140
catch(ParseException | JOSEException e) {
140141
throw new VaultException("Failure retrieving key material", e);

0 commit comments

Comments
 (0)