web - implement callback auth flow

This commit is contained in:
Benjamin Pasero
2019-08-22 10:41:30 +02:00
parent 284c04475e
commit 719cdaa87c
22 changed files with 303 additions and 65 deletions

View File

@@ -234,6 +234,10 @@ export function createApiFactoryAndRegisterActors(accessor: ServicesAccessor): I
get appName() { return initData.environment.appName; },
get appRoot() { return initData.environment.appRoot!.fsPath; },
get uriScheme() { return initData.environment.appUriScheme; },
createAppUri(options?) {
checkProposedApiEnabled(extension);
return extHostUrls.createAppUri(extension.identifier, options);
},
get logLevel() {
checkProposedApiEnabled(extension);
return typeConverters.LogLevel.to(extHostLogService.getLevel());

View File

@@ -567,6 +567,7 @@ export interface ExtHostWebviewsShape {
export interface MainThreadUrlsShape extends IDisposable {
$registerUriHandler(handle: number, extensionId: ExtensionIdentifier): Promise<void>;
$unregisterUriHandler(handle: number): Promise<void>;
$createAppUri(extensionId: ExtensionIdentifier, options?: { payload?: Partial<UriComponents> }): Promise<UriComponents>;
}
export interface ExtHostUrlsShape {

View File

@@ -55,4 +55,8 @@ export class ExtHostUrls implements ExtHostUrlsShape {
return Promise.resolve(undefined);
}
async createAppUri(extensionId: ExtensionIdentifier, options?: vscode.env.AppUriOptions): Promise<vscode.Uri> {
return URI.revive(await this._proxy.$createAppUri(extensionId, options));
}
}