From 889dddb80ba4dab092274fde5459f40b0d28d99f Mon Sep 17 00:00:00 2001 From: Nikita Iarychenko Date: Thu, 20 Mar 2025 14:37:43 +0400 Subject: [PATCH] OPENIDE #126 Hide option "Log in via Github" (cherry picked from commit 9e519d146e3b9c5897276f0c51129f087d8350a4) (cherry picked from commit ee293f0b7eedf60dc9be603b50529227b25e40ed) (cherry picked from commit 63a86e4a4211071cf418075bc0c31a299000b7ad) --- .../src/ru/openide/io/WhiteListUrls.kt | 4 +++- .../github/authentication/GHAccountsUtil.kt | 23 +++++++++++-------- 2 files changed, 16 insertions(+), 11 deletions(-) diff --git a/platform/ide-core/src/ru/openide/io/WhiteListUrls.kt b/platform/ide-core/src/ru/openide/io/WhiteListUrls.kt index d5d989824c45..1ec865dd4b7c 100644 --- a/platform/ide-core/src/ru/openide/io/WhiteListUrls.kt +++ b/platform/ide-core/src/ru/openide/io/WhiteListUrls.kt @@ -46,7 +46,9 @@ object WhiteListUrls { "https://api.hsforms.com/submissions/v3/integration/submit/", "https://store.amplicode.ru", "https://ls.store.amplicode.ru", - "https://resources.openide.ru" + "https://resources.openide.ru", + "https://api.github.com", + "https://avatars.githubusercontent.com" ) // Collect urls from KnownSchemaIdentifiers.json diff --git a/plugins/github/github-core/src/org/jetbrains/plugins/github/authentication/GHAccountsUtil.kt b/plugins/github/github-core/src/org/jetbrains/plugins/github/authentication/GHAccountsUtil.kt index 71918074f246..9c96deebfe2e 100644 --- a/plugins/github/github-core/src/org/jetbrains/plugins/github/authentication/GHAccountsUtil.kt +++ b/plugins/github/github-core/src/org/jetbrains/plugins/github/authentication/GHAccountsUtil.kt @@ -1,4 +1,7 @@ -// Copyright 2000-2022 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. +// Copyright 2000-2025 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. +// +// Modified by Nikita Iarychenko at 2025 as part of the OpenIDE project(https://openide.ru). +// Any modifications are available on the same license terms as the original source code. package org.jetbrains.plugins.github.authentication import com.intellij.collaboration.async.cancelledWith @@ -85,7 +88,6 @@ object GHAccountsUtil { internal fun createAddAccountActionGroup(model: GHLoginModel, project: Project, parentComponent: JComponent, loginSource: GHLoginSource): ActionGroup { val group = DefaultActionGroup() val loginData = GHLoginData(loginSource) - group.add(createBrowserLoginAction(model, project, parentComponent, loginData)) group.add(createTokenLoginAction(model, project, parentComponent, loginData)) group.add(Separator()) @@ -204,14 +206,15 @@ object GHAccountsUtil { @JvmStatic @ApiStatus.Internal fun login(model: GHLoginModel, request: GHLoginRequest, project: Project?, parentComponent: Component?) { - if (request.server != GithubServerPath.DEFAULT_SERVER) { - request.loginWithToken(model, project, parentComponent) - } - else when (request.authType) { - AuthorizationType.OAUTH -> request.loginWithOAuth(model, project, parentComponent) - AuthorizationType.TOKEN -> request.loginWithToken(model, project, parentComponent) - AuthorizationType.UNDEFINED -> request.loginWithOAuthOrToken(model, project, parentComponent) - } + //if (request.server != GithubServerPath.DEFAULT_SERVER) { + // request.loginWithToken(model, project, parentComponent) + //} + //else when (request.authType) { + // AuthorizationType.OAUTH -> request.loginWithOAuth(model, project, parentComponent) + // AuthorizationType.TOKEN -> request.loginWithToken(model, project, parentComponent) + // AuthorizationType.UNDEFINED -> request.loginWithOAuthOrToken(model, project, parentComponent) + //} + return request.loginWithToken(model, project, parentComponent) } }