mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-03-22 15:19:59 +07:00
LLM-3762: license: add oauth providers to the login API
(cherry picked from commit 635b72f4ec14405e7ea52b68c56491e6d63aee7f) GitOrigin-RevId: 2e56e84565b6bbe53229b44d0838d084d755b52a
This commit is contained in:
committed by
intellij-monorepo-bot
parent
fd263f97f1
commit
c191b6d548
@@ -100,9 +100,19 @@ public interface JBAccountInfoService {
|
||||
}
|
||||
|
||||
/**
|
||||
* Starts the auth flow by opening the browser and waiting for the user to proceed with logging in.
|
||||
* See startLoginSession(@NotNull LoginMode, @Nullable String, Map<@NotNull String, @NotNull String>)
|
||||
*/
|
||||
@NotNull LoginSession startLoginSession(@NotNull LoginMode loginMode, @NotNull Map<@NotNull String, @NotNull String> clientMetadata);
|
||||
default @NotNull LoginSession startLoginSession(@NotNull LoginMode loginMode, @NotNull Map<@NotNull String, @NotNull String> clientMetadata) {
|
||||
return startLoginSession(loginMode, null, clientMetadata);
|
||||
}
|
||||
|
||||
/**
|
||||
* Starts the auth flow based on the provided login mode, optional authProviderId, and client metadata
|
||||
* by opening the browser and waiting for the user to proceed with logging in.
|
||||
*/
|
||||
@NotNull LoginSession startLoginSession(@NotNull LoginMode loginMode,
|
||||
@Nullable String authProviderId,
|
||||
@NotNull Map<@NotNull String, @NotNull String> clientMetadata);
|
||||
|
||||
/**
|
||||
* Returns the list of licenses available in the current user's account matching the specified productCode.
|
||||
@@ -142,7 +152,15 @@ public interface JBAccountInfoService {
|
||||
record JbaServiceConfiguration(
|
||||
@NotNull String accountUrl,
|
||||
@NotNull String signupUrl,
|
||||
@Nullable String paymentMethodsUrl // TODO nullable during the transition period
|
||||
@Nullable String paymentMethodsUrl, // TODO nullable during the transition period
|
||||
@NotNull List<@NotNull JbaOAuthProvider> authProviders
|
||||
) { }
|
||||
|
||||
record JbaOAuthProvider(
|
||||
@NotNull String id,
|
||||
@NotNull String name,
|
||||
@NotNull String logoUrl,
|
||||
@NotNull String logoDarkUrl
|
||||
) { }
|
||||
|
||||
enum LoginMode {
|
||||
|
||||
@@ -21,7 +21,7 @@ object DummyJBAccountInfoService : JBAccountInfoService {
|
||||
return _idToken
|
||||
}
|
||||
|
||||
override fun startLoginSession(loginMode: JBAccountInfoService.LoginMode, clientMetadata: Map<String, String>): JBAccountInfoService.LoginSession {
|
||||
override fun startLoginSession(loginMode: JBAccountInfoService.LoginMode, authProviderId: String?, clientMetadata: Map<String, String>): JBAccountInfoService.LoginSession {
|
||||
TODO("Not yet implemented")
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package com.intellij.settingsSync.auth
|
||||
|
||||
import com.intellij.openapi.application.ex.ApplicationManagerEx
|
||||
import com.intellij.openapi.diagnostic.Logger.getInstance
|
||||
import com.intellij.openapi.diagnostic.logger
|
||||
import com.intellij.settingsSync.SettingsSyncEvents
|
||||
import com.intellij.settingsSync.SettingsSyncPromotion
|
||||
@@ -51,7 +50,7 @@ internal class SettingsSyncDefaultAuthService : SettingsSyncAuthService {
|
||||
if (accountInfoService != null) {
|
||||
try {
|
||||
val loginSession: JBAccountInfoService.LoginSession? = accountInfoService.startLoginSession(
|
||||
JBAccountInfoService.LoginMode.AUTO, loginMetadata)
|
||||
JBAccountInfoService.LoginMode.AUTO, null, loginMetadata)
|
||||
|
||||
loginSession!!.onCompleted().thenAccept(Consumer<JBAccountInfoService.LoginResult> {
|
||||
SettingsSyncEvents.getInstance().fireLoginStateChanged()
|
||||
|
||||
Reference in New Issue
Block a user