From 1fde3650cacb08b04cc1f58ef55cc715dd04f6f1 Mon Sep 17 00:00:00 2001 From: Sebastian Stenzel Date: Wed, 11 Mar 2026 21:47:33 +0100 Subject: [PATCH] renamed classes --- .../java/org/cryptomator/ui/common/FxmlFile.java | 4 ++-- ...roller.java => CheckHostTrustController.java} | 13 +++++++------ .../ui/keyloading/hub/HubKeyLoadingModule.java | 16 ++++++++-------- .../ui/keyloading/hub/HubKeyLoadingStrategy.java | 10 ++++------ ...troller.java => UntrustedHostController.java} | 4 ++-- ...thenticity.fxml => hub_check_host_trust.fxml} | 8 ++++---- ...horized_host.fxml => hub_untrusted_host.fxml} | 6 +++--- src/main/resources/i18n/strings.properties | 14 +++++++------- ...st.java => CheckHostTrustControllerTest.java} | 6 +++--- 9 files changed, 40 insertions(+), 41 deletions(-) rename src/main/java/org/cryptomator/ui/keyloading/hub/{CheckHostAuthenticityController.java => CheckHostTrustController.java} (88%) rename src/main/java/org/cryptomator/ui/keyloading/hub/{UnauthorizedHostController.java => UntrustedHostController.java} (81%) rename src/main/resources/fxml/{hub_check_host_authenticity.fxml => hub_check_host_trust.fxml} (77%) rename src/main/resources/fxml/{hub_unauthorized_host.fxml => hub_untrusted_host.fxml} (84%) rename src/test/java/org/cryptomator/ui/keyloading/hub/{CheckHostAuthenticityControllerTest.java => CheckHostTrustControllerTest.java} (85%) diff --git a/src/main/java/org/cryptomator/ui/common/FxmlFile.java b/src/main/java/org/cryptomator/ui/common/FxmlFile.java index b5ffa9fb4..b31245b4c 100644 --- a/src/main/java/org/cryptomator/ui/common/FxmlFile.java +++ b/src/main/java/org/cryptomator/ui/common/FxmlFile.java @@ -19,7 +19,7 @@ public enum FxmlFile { HEALTH_START("/fxml/health_start.fxml"), // HEALTH_CHECK_LIST("/fxml/health_check_list.fxml"), // HUB_NO_KEYCHAIN("/fxml/hub_no_keychain.fxml"), // - HUB_CHECK_HOST_AUTHENTICITY("/fxml/hub_check_host_authenticity.fxml"), // + HUB_CHECK_HOST_TRUST("/fxml/hub_check_host_trust.fxml"), // HUB_AUTH_FLOW("/fxml/hub_auth_flow.fxml"), // HUB_INVALID_LICENSE("/fxml/hub_invalid_license.fxml"), // HUB_RECEIVE_KEY("/fxml/hub_receive_key.fxml"), // @@ -30,7 +30,7 @@ public enum FxmlFile { HUB_REGISTER_FAILED("/fxml/hub_register_failed.fxml"), // HUB_REGISTER_DEVICE("/fxml/hub_register_device.fxml"), // HUB_UNAUTHORIZED_DEVICE("/fxml/hub_unauthorized_device.fxml"), // - HUB_UNAUTHORIZED_HOST("/fxml/hub_unauthorized_host.fxml"), // + HUB_UNTRUSTED_HOST("/fxml/hub_untrusted_host.fxml"), // HUB_REQUIRE_ACCOUNT_INIT("/fxml/hub_require_account_init.fxml"), // LOCK_FORCED("/fxml/lock_forced.fxml"), // LOCK_FAILED("/fxml/lock_failed.fxml"), // diff --git a/src/main/java/org/cryptomator/ui/keyloading/hub/CheckHostAuthenticityController.java b/src/main/java/org/cryptomator/ui/keyloading/hub/CheckHostTrustController.java similarity index 88% rename from src/main/java/org/cryptomator/ui/keyloading/hub/CheckHostAuthenticityController.java rename to src/main/java/org/cryptomator/ui/keyloading/hub/CheckHostTrustController.java index 522af7f85..4aee0338c 100644 --- a/src/main/java/org/cryptomator/ui/keyloading/hub/CheckHostAuthenticityController.java +++ b/src/main/java/org/cryptomator/ui/keyloading/hub/CheckHostTrustController.java @@ -28,11 +28,12 @@ import java.util.TreeSet; import java.util.concurrent.CompletableFuture; @KeyLoadingScoped -public class CheckHostAuthenticityController implements FxController { +public class CheckHostTrustController implements FxController { - private static final Logger LOG = LoggerFactory.getLogger(CheckHostAuthenticityController.class); - private static final String MESSAGE_SINGULAR_KEY = "hub.checkHostAuthenticity.message"; - private static final String MESSAGE_PLURAL_KEY = "hub.checkHostAuthenticity.message.plural"; + private static final Logger LOG = LoggerFactory.getLogger(CheckHostTrustController.class); + private static final String MESSAGE_SINGULAR_KEY = "hub.checkHostTrust.message"; + private static final String MESSAGE_PLURAL_KEY = "hub.checkHostTrust.message.plural"; + private static final String TRUSTED_CRYPTOMATOR_CLOUD_DOMAIN = "cryptomator.cloud"; private final Stage window; private final HubConfig hubConfig; @@ -51,7 +52,7 @@ public class CheckHostAuthenticityController implements FxController { private TextFlow hostnamesFlow; @Inject - public CheckHostAuthenticityController(@KeyLoading Stage window, HubConfig hubConfig, @FxmlScene(FxmlFile.HUB_AUTH_FLOW) Lazy authFlowScene, @FxmlScene(FxmlFile.HUB_UNAUTHORIZED_HOST) Lazy unauthorizedHostScene, CompletableFuture result, Settings settings, Environment env, ResourceBundle resourceBundle) { + public CheckHostTrustController(@KeyLoading Stage window, HubConfig hubConfig, @FxmlScene(FxmlFile.HUB_AUTH_FLOW) Lazy authFlowScene, @FxmlScene(FxmlFile.HUB_UNTRUSTED_HOST) Lazy unauthorizedHostScene, CompletableFuture result, Settings settings, Environment env, ResourceBundle resourceBundle) { this.window = window; this.hubConfig = hubConfig; this.authFlowScene = authFlowScene; @@ -121,7 +122,7 @@ public class CheckHostAuthenticityController implements FxController { private boolean isCryptomatorCloud() { var canonicalHubHost = hubConfig.getApiBaseUrl().getHost(); var canonicalAuthHost = URI.create(hubConfig.authEndpoint).getHost(); - return canonicalHubHost.endsWith("cryptomator.cloud") && canonicalAuthHost.endsWith("cryptomator.cloud"); + return canonicalHubHost.endsWith(TRUSTED_CRYPTOMATOR_CLOUD_DOMAIN) && canonicalAuthHost.endsWith(TRUSTED_CRYPTOMATOR_CLOUD_DOMAIN); } @VisibleForTesting diff --git a/src/main/java/org/cryptomator/ui/keyloading/hub/HubKeyLoadingModule.java b/src/main/java/org/cryptomator/ui/keyloading/hub/HubKeyLoadingModule.java index 9aa4b8d5e..be87f2746 100644 --- a/src/main/java/org/cryptomator/ui/keyloading/hub/HubKeyLoadingModule.java +++ b/src/main/java/org/cryptomator/ui/keyloading/hub/HubKeyLoadingModule.java @@ -99,10 +99,10 @@ public abstract class HubKeyLoadingModule { } @Provides - @FxmlScene(FxmlFile.HUB_CHECK_HOST_AUTHENTICITY) + @FxmlScene(FxmlFile.HUB_CHECK_HOST_TRUST) @KeyLoadingScoped static Scene provideHubCheckHostAuthenticityScene(@KeyLoading FxmlLoaderFactory fxmlLoaders) { - return fxmlLoaders.createScene(FxmlFile.HUB_CHECK_HOST_AUTHENTICITY); + return fxmlLoaders.createScene(FxmlFile.HUB_CHECK_HOST_TRUST); } @Provides @@ -176,10 +176,10 @@ public abstract class HubKeyLoadingModule { } @Provides - @FxmlScene(FxmlFile.HUB_UNAUTHORIZED_HOST) + @FxmlScene(FxmlFile.HUB_UNTRUSTED_HOST) @KeyLoadingScoped static Scene provideHubUnauthorizedHostScene(@KeyLoading FxmlLoaderFactory fxmlLoaders) { - return fxmlLoaders.createScene(FxmlFile.HUB_UNAUTHORIZED_HOST); + return fxmlLoaders.createScene(FxmlFile.HUB_UNTRUSTED_HOST); } @Provides @@ -196,8 +196,8 @@ public abstract class HubKeyLoadingModule { @Binds @IntoMap - @FxControllerKey(CheckHostAuthenticityController.class) - abstract FxController bindCheckHostAuthenticityController(CheckHostAuthenticityController controller); + @FxControllerKey(CheckHostTrustController.class) + abstract FxController bindCheckHostAuthenticityController(CheckHostTrustController controller); @Binds @IntoMap @@ -246,8 +246,8 @@ public abstract class HubKeyLoadingModule { @Binds @IntoMap - @FxControllerKey(UnauthorizedHostController.class) - abstract FxController bindUnauthorizedHostController(UnauthorizedHostController controller); + @FxControllerKey(UntrustedHostController.class) + abstract FxController bindUnauthorizedHostController(UntrustedHostController controller); @Binds @IntoMap diff --git a/src/main/java/org/cryptomator/ui/keyloading/hub/HubKeyLoadingStrategy.java b/src/main/java/org/cryptomator/ui/keyloading/hub/HubKeyLoadingStrategy.java index 614db9eb1..f7354c6de 100644 --- a/src/main/java/org/cryptomator/ui/keyloading/hub/HubKeyLoadingStrategy.java +++ b/src/main/java/org/cryptomator/ui/keyloading/hub/HubKeyLoadingStrategy.java @@ -2,7 +2,6 @@ package org.cryptomator.ui.keyloading.hub; import com.google.common.base.Preconditions; import dagger.Lazy; -import org.cryptomator.common.Environment; import org.cryptomator.common.FilesystemOwnerSupplier; import org.cryptomator.common.keychain.KeychainManager; import org.cryptomator.common.keychain.NoKeychainAccessProviderException; @@ -22,7 +21,6 @@ import javafx.scene.Scene; import javafx.stage.Stage; import javafx.stage.Window; import java.net.URI; -import java.util.Arrays; import java.util.concurrent.CancellationException; import java.util.concurrent.CompletableFuture; import java.util.concurrent.ExecutionException; @@ -38,19 +36,19 @@ public class HubKeyLoadingStrategy implements KeyLoadingStrategy, FilesystemOwne private final Stage window; private final KeychainManager keychainManager; private final AtomicReference fsOwnerId; - private final Lazy checkHostAuthenticityScene; + private final Lazy checkHostTrustScene; private final Lazy noKeychainScene; private final CompletableFuture result; private final DeviceKey deviceKey; @Inject - public HubKeyLoadingStrategy(@KeyLoading Stage window, @FxmlScene(FxmlFile.HUB_CHECK_HOST_AUTHENTICITY) Lazy checkHostAuthenticityScene, @FxmlScene(FxmlFile.HUB_NO_KEYCHAIN) Lazy noKeychainScene, CompletableFuture result, DeviceKey deviceKey, KeychainManager keychainManager, @Named("windowTitle") String windowTitle, @Named("filesystemOwnerId") AtomicReference fsOwnerId) { + public HubKeyLoadingStrategy(@KeyLoading Stage window, @FxmlScene(FxmlFile.HUB_CHECK_HOST_TRUST) Lazy checkHostTrustScene, @FxmlScene(FxmlFile.HUB_NO_KEYCHAIN) Lazy noKeychainScene, CompletableFuture result, DeviceKey deviceKey, KeychainManager keychainManager, @Named("windowTitle") String windowTitle, @Named("filesystemOwnerId") AtomicReference fsOwnerId) { this.window = window; this.keychainManager = keychainManager; this.fsOwnerId = fsOwnerId; window.setTitle(windowTitle); window.setOnCloseRequest(_ -> result.cancel(true)); - this.checkHostAuthenticityScene = checkHostAuthenticityScene; + this.checkHostTrustScene = checkHostTrustScene; this.noKeychainScene = noKeychainScene; this.result = result; this.deviceKey = deviceKey; @@ -64,7 +62,7 @@ public class HubKeyLoadingStrategy implements KeyLoadingStrategy, FilesystemOwne throw new NoKeychainAccessProviderException(); } var keypair = deviceKey.get(); - showWindow(checkHostAuthenticityScene); + showWindow(checkHostTrustScene); var jwe = result.get(); return jwe.decryptMasterkey(keypair.getPrivate()); } catch (NoKeychainAccessProviderException e) { diff --git a/src/main/java/org/cryptomator/ui/keyloading/hub/UnauthorizedHostController.java b/src/main/java/org/cryptomator/ui/keyloading/hub/UntrustedHostController.java similarity index 81% rename from src/main/java/org/cryptomator/ui/keyloading/hub/UnauthorizedHostController.java rename to src/main/java/org/cryptomator/ui/keyloading/hub/UntrustedHostController.java index c6b67b330..68a9a8e34 100644 --- a/src/main/java/org/cryptomator/ui/keyloading/hub/UnauthorizedHostController.java +++ b/src/main/java/org/cryptomator/ui/keyloading/hub/UntrustedHostController.java @@ -11,13 +11,13 @@ import javafx.stage.WindowEvent; import java.util.concurrent.CompletableFuture; @KeyLoadingScoped -public class UnauthorizedHostController implements FxController { +public class UntrustedHostController implements FxController { private final Stage window; private final CompletableFuture result; @Inject - public UnauthorizedHostController(@KeyLoading Stage window, CompletableFuture result) { + public UntrustedHostController(@KeyLoading Stage window, CompletableFuture result) { this.window = window; this.result = result; this.window.addEventHandler(WindowEvent.WINDOW_HIDING, this::windowClosed); diff --git a/src/main/resources/fxml/hub_check_host_authenticity.fxml b/src/main/resources/fxml/hub_check_host_trust.fxml similarity index 77% rename from src/main/resources/fxml/hub_check_host_authenticity.fxml rename to src/main/resources/fxml/hub_check_host_trust.fxml index d50ad3da9..ace2e660c 100644 --- a/src/main/resources/fxml/hub_check_host_authenticity.fxml +++ b/src/main/resources/fxml/hub_check_host_trust.fxml @@ -14,7 +14,7 @@ -