Skip to content

Commit 2637ae9

Browse files
committed
Reset credentials in logout.
1 parent 9f61824 commit 2637ae9

File tree

5 files changed

+5
-103
lines changed

5 files changed

+5
-103
lines changed

core/src/main/java/ch/cyberduck/core/CopyCredentialsHolder.java

Lines changed: 0 additions & 93 deletions
This file was deleted.

core/src/main/java/ch/cyberduck/core/KeychainLoginService.java

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -213,11 +213,5 @@ public void save(final Host bookmark) {
213213
else {
214214
log.info("Skip writing credentials for bookmark {}", bookmark.getHostname());
215215
}
216-
// Nullify password and tokens
217-
log.debug("Reset credentials for {}", bookmark);
218-
switch(bookmark.getProtocol().getStatefulness()) {
219-
case stateless:
220-
credentials.reset();
221-
}
222216
}
223217
}

core/src/main/java/ch/cyberduck/core/Session.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,9 @@ public void interrupt() throws BackgroundException {
200200
}
201201
}
202202

203-
protected abstract void logout() throws BackgroundException;
203+
protected void logout() throws BackgroundException {
204+
host.getCredentials().reset();
205+
}
204206

205207
/**
206208
* Close the connection to the remote host. Subsequent calls to #getClient() must return null.

oauth/src/main/java/ch/cyberduck/core/oauth/OAuth2AuthorizationService.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ public OAuth2AuthorizationService(final HttpTransport transport, final Host host
106106
final LoginCallback prompt) throws LoginCanceledException {
107107
this.transport = transport;
108108
this.host = host;
109-
this.credentials = new CopyCredentialsHolder(host.getCredentials());
109+
this.credentials = host.getCredentials();
110110
this.tokenServerUrl = tokenServerUrl;
111111
this.authorizationServerUrl = authorizationServerUrl;
112112
this.prompt = prompt;

s3/src/main/java/ch/cyberduck/core/sts/STSRequestInterceptor.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
* GNU General Public License for more details.
1616
*/
1717

18-
import ch.cyberduck.core.CopyCredentialsHolder;
1918
import ch.cyberduck.core.Credentials;
2019
import ch.cyberduck.core.Host;
2120
import ch.cyberduck.core.LoginCallback;
@@ -55,7 +54,7 @@ public abstract class STSRequestInterceptor extends STSAuthorizationService impl
5554

5655
public STSRequestInterceptor(final Host host, final X509TrustManager trust, final X509KeyManager key, final LoginCallback prompt) {
5756
super(host, trust, key, prompt);
58-
this.credentials = new CopyCredentialsHolder(host.getCredentials());
57+
this.credentials = host.getCredentials();
5958
this.tokens = host.getCredentials().getTokens();
6059
}
6160

0 commit comments

Comments
 (0)