diff --git a/platform/platform-impl/src/com/intellij/ui/JBAccountInfoService.java b/platform/platform-impl/src/com/intellij/ui/JBAccountInfoService.java index 190ee1f3a09f..31708e170b01 100644 --- a/platform/platform-impl/src/com/intellij/ui/JBAccountInfoService.java +++ b/platform/platform-impl/src/com/intellij/ui/JBAccountInfoService.java @@ -76,6 +76,19 @@ public interface JBAccountInfoService { } } + /** + * Returns the information retrieved from {@code JetBrainsAccount.xml}. + * This method can either perform a network operation or return a cached copy if it's fresh enough. + *
+ * The returned future may complete exceptionally with a {@link java.util.concurrent.CompletionException} wrapping + * an {@link java.io.IOException} the caused the failure. + * Note that when awaiting the future from a coroutine using the standard {@code .await()} extension function, + * the original {@link java.io.IOException} is thrown in case of a failure, without an intermediate wrapper exception. + *
+ * The future may also be cancelled in case of remote dev when the controlling client handling the request is disconnected.
+ */
+ @NotNull CompletableFuture<@NotNull JbaServiceConfiguration> getServiceConfiguration();
+
/**
* Starts the auth flow by opening the browser and waiting for the user to proceed with logging in.
*/
@@ -106,6 +119,12 @@ public interface JBAccountInfoService {
return JBAccountInfoServiceHolder.INSTANCE;
}
+ record JbaServiceConfiguration(
+ @NotNull String accountUrl,
+ @NotNull String signupUrl,
+ @NotNull String paymentMethodsUrl
+ ) { }
+
enum LoginMode {
/**
* Open the auth URL in the browser, start the built-in server, and await for the auth callback.
diff --git a/plugins/settings-sync/src/com/intellij/settingsSync/auth/DummyJBAccountInfoService.kt b/plugins/settings-sync/src/com/intellij/settingsSync/auth/DummyJBAccountInfoService.kt
index 8e64893182c8..29cc18f2383e 100644
--- a/plugins/settings-sync/src/com/intellij/settingsSync/auth/DummyJBAccountInfoService.kt
+++ b/plugins/settings-sync/src/com/intellij/settingsSync/auth/DummyJBAccountInfoService.kt
@@ -37,4 +37,8 @@ object DummyJBAccountInfoService : JBAccountInfoService {
refreshIdToken()
SettingsSyncEvents.getInstance().fireLoginStateChanged()
}
-}
\ No newline at end of file
+
+ override fun getServiceConfiguration(): CompletableFuture