From d5ac351a690684f7ab053fefbeb6d0ebbce89286 Mon Sep 17 00:00:00 2001 From: David Kocher Date: Mon, 25 Nov 2024 11:37:13 +0100 Subject: [PATCH] Fix #16334. --- .../ch/cyberduck/core/s3/S3UrlProvider.java | 23 ++++++++----------- 1 file changed, 9 insertions(+), 14 deletions(-) diff --git a/s3/src/main/java/ch/cyberduck/core/s3/S3UrlProvider.java b/s3/src/main/java/ch/cyberduck/core/s3/S3UrlProvider.java index 2dcd21d019f..bcd7a5f2b56 100644 --- a/s3/src/main/java/ch/cyberduck/core/s3/S3UrlProvider.java +++ b/s3/src/main/java/ch/cyberduck/core/s3/S3UrlProvider.java @@ -17,19 +17,7 @@ * Bug fixes, suggestions and comments should be sent to feedback@cyberduck.ch */ -import ch.cyberduck.core.DescriptiveUrl; -import ch.cyberduck.core.DescriptiveUrlBag; -import ch.cyberduck.core.HostPasswordStore; -import ch.cyberduck.core.HostWebUrlProvider; -import ch.cyberduck.core.LocaleFactory; -import ch.cyberduck.core.PasswordStoreFactory; -import ch.cyberduck.core.Path; -import ch.cyberduck.core.PathContainerService; -import ch.cyberduck.core.Scheme; -import ch.cyberduck.core.SimplePathPredicate; -import ch.cyberduck.core.URIEncoder; -import ch.cyberduck.core.UrlProvider; -import ch.cyberduck.core.UserDateFormatterFactory; +import ch.cyberduck.core.*; import ch.cyberduck.core.cdn.Distribution; import ch.cyberduck.core.cdn.DistributionUrlProvider; import ch.cyberduck.core.preferences.HostPreferences; @@ -201,7 +189,14 @@ public PresignedUrl(final Path file, final Calendar expiry) { @Override public String getUrl() { - final String secret = store.findLoginPassword(session.getHost()); + final String secret; + final Credentials credentials = CredentialsConfiguratorFactory.get(session.getHost().getProtocol()).configure(session.getHost()); + if(credentials.isPasswordAuthentication()) { + secret = credentials.getPassword(); + } + else { + secret = store.findLoginPassword(session.getHost()); + } if(StringUtils.isBlank(secret)) { log.warn("No secret found in password store required to sign temporary URL"); return DescriptiveUrl.EMPTY.getUrl();