mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
LLM-3861: JBAccountInfoService: Add recordAgreementAcceptance()
GitOrigin-RevId: dc0032692dbcda593c68f790ff16f20557da0992
This commit is contained in:
committed by
intellij-monorepo-bot
parent
82cb70c932
commit
bea119a05f
@@ -1,6 +1,8 @@
|
||||
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package com.intellij.ui;
|
||||
|
||||
import com.intellij.ide.gdpr.EndUserAgreement;
|
||||
import com.intellij.ide.gdpr.Version;
|
||||
import com.intellij.idea.AppMode;
|
||||
import com.intellij.openapi.application.ApplicationManager;
|
||||
import com.intellij.openapi.diagnostic.Logger;
|
||||
@@ -111,6 +113,16 @@ public interface JBAccountInfoService {
|
||||
*/
|
||||
@NotNull CompletableFuture<@NotNull LicenseListResult> issueTrialLicense(@NotNull String productCode, @NotNull List<String> consentOptions);
|
||||
|
||||
/**
|
||||
* Records the accepted version of the specified EUA document, and responds whether a newer version of the document is available.
|
||||
* <p>
|
||||
* The returned future never completes exceptionally, other than because of cancellation that
|
||||
* may happen in case of remote dev when the controlling client handling the request is disconnected.
|
||||
*/
|
||||
@NotNull CompletableFuture<@NotNull AgreementAcceptanceResult> recordAgreementAcceptance(@NotNull String productCode,
|
||||
@NotNull String documentName,
|
||||
@NotNull Version acceptedVersion);
|
||||
|
||||
static @Nullable JBAccountInfoService getInstance() {
|
||||
if (AppMode.isRemoteDevHost()) {
|
||||
// see BackendJbaInfoServiceImpl
|
||||
@@ -201,11 +213,18 @@ public interface JBAccountInfoService {
|
||||
record RequestFailed(@NlsSafe @NotNull String errorMessage) implements LicenseListResult { }
|
||||
}
|
||||
|
||||
sealed interface AgreementAcceptanceResult permits AgreementAcceptanceResult.AckAccepted,
|
||||
AgreementAcceptanceResult.RequestFailed,
|
||||
AuthRequired {
|
||||
record AckAccepted(@Nullable EndUserAgreement.Document newerDocument) implements AgreementAcceptanceResult { }
|
||||
record RequestFailed(@NlsSafe @NotNull String errorMessage) implements AgreementAcceptanceResult { }
|
||||
}
|
||||
|
||||
/**
|
||||
* Returned in cases the method returning it is called while unauthenticated,
|
||||
* or when the current auth credentials have expired and need to be revalidated by {@link #startLoginSession signing in} again.
|
||||
*/
|
||||
enum AuthRequired implements LicenseListResult {
|
||||
enum AuthRequired implements LicenseListResult, AgreementAcceptanceResult {
|
||||
INSTANCE;
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.intellij.settingsSync.auth
|
||||
|
||||
import com.intellij.ide.gdpr.Version
|
||||
import com.intellij.settingsSync.SettingsSyncEvents
|
||||
import com.intellij.ui.JBAccountInfoService
|
||||
import java.util.concurrent.CompletableFuture
|
||||
@@ -33,6 +34,10 @@ object DummyJBAccountInfoService : JBAccountInfoService {
|
||||
TODO("Not yet implemented")
|
||||
}
|
||||
|
||||
override fun recordAgreementAcceptance(productCode: String, documentName: String, acceptedVersion: Version): CompletableFuture<JBAccountInfoService.AgreementAcceptanceResult> {
|
||||
TODO("Not yet implemented")
|
||||
}
|
||||
|
||||
override fun invokeJBALogin(userIdConsumer: Consumer<in String>?, onFailure: Runnable?) {
|
||||
refreshIdToken()
|
||||
SettingsSyncEvents.getInstance().fireLoginStateChanged()
|
||||
|
||||
Reference in New Issue
Block a user