mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-19 08:08:39 +01:00
Improve GHES flow (#172959)
* Improve GHES flow It's clear to me now that a lot of users of the GHES flow have auth behind a VPN. Something that we cannot support in the OAuth flow because we require making a request to vscode.dev who makes a request to the GHES instance. In light of this, we will remove the OAuth flow for GHES. Fear not, though... because both the Device Code Flow and the PAT flow are there and the PAT flow has been improved in 1.75... so in conclusion, I think GHES is handled as best we can with this PR. Additionally, there is some "Hosted GitHub Enterprise" scenarios popping up, and this future proofs that by allowing "Hosted GitHub Enterprise" experiences to go through the OAuth flow because we know for a fact that they will be accessible from vscode.dev. Fixes #169619 Fixes https://github.com/microsoft/vscode-internalbacklog/issues/3398 * Use api. sub domain and update telemetry logic
This commit is contained in:
committed by
GitHub
parent
ab060f0aa7
commit
06eb374137
@@ -3,6 +3,7 @@
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
import { Uri } from 'vscode';
|
||||
import { AuthProviderType } from '../github';
|
||||
|
||||
const VALID_DESKTOP_CALLBACK_SCHEMES = [
|
||||
'vscode',
|
||||
@@ -15,7 +16,7 @@ const VALID_DESKTOP_CALLBACK_SCHEMES = [
|
||||
'vscode-exploration'
|
||||
];
|
||||
|
||||
export function isSupportedEnvironment(uri: Uri): boolean {
|
||||
export function isSupportedClient(uri: Uri): boolean {
|
||||
return (
|
||||
VALID_DESKTOP_CALLBACK_SCHEMES.includes(uri.scheme) ||
|
||||
// vscode.dev & insiders.vscode.dev
|
||||
@@ -24,3 +25,10 @@ export function isSupportedEnvironment(uri: Uri): boolean {
|
||||
/(?:^|\.)github\.dev$/.test(uri.authority)
|
||||
);
|
||||
}
|
||||
|
||||
export function isSupportedTarget(type: AuthProviderType, gheUri?: Uri): boolean {
|
||||
return (
|
||||
type === AuthProviderType.github ||
|
||||
/\.ghe\.com$/.test(gheUri!.authority)
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user